[BACK]Return to crypto_openssl.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / crypto / dist / ipsec-tools / src / racoon

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/crypto/dist/ipsec-tools/src/racoon/crypto_openssl.c between version 1.11 and 1.11.6.5

version 1.11, 2006/11/09 20:22:18 version 1.11.6.5, 2009/04/20 13:33:30
Line 89 
Line 89 
 #include "crypto/sha2/sha2.h"  #include "crypto/sha2/sha2.h"
 #endif  #endif
 #endif  #endif
   #include "plog.h"
   
 /* 0.9.7 stuff? */  /* 0.9.7 stuff? */
 #if OPENSSL_VERSION_NUMBER < 0x0090700fL  #if OPENSSL_VERSION_NUMBER < 0x0090700fL
Line 132  eay_str2asn1dn(str, len)
Line 133  eay_str2asn1dn(str, len)
         char *buf;          char *buf;
         char *field, *value;          char *field, *value;
         int i, j;          int i, j;
         vchar_t *ret;          vchar_t *ret = NULL;
         caddr_t p;          caddr_t p;
   
         if (len == -1)          if (len == -1)
Line 217  eay_str2asn1dn(str, len)
Line 218  eay_str2asn1dn(str, len)
                 racoon_free(buf);                  racoon_free(buf);
         if (name)          if (name)
                 X509_NAME_free(name);                  X509_NAME_free(name);
           if (ret)
                   vfree(ret);
         return NULL;          return NULL;
 }  }
   
Line 673  eay_get_x509subjectaltname(cert, altname
Line 676  eay_get_x509subjectaltname(cert, altname
                 {                  {
                         plog(LLV_ERROR, LOCATION, NULL,                          plog(LLV_ERROR, LOCATION, NULL,
                                  "data is not terminated by NUL.");                                   "data is not terminated by NUL.");
                         hexdump(gen->d.ia5->data, gen->d.ia5->length + 1);                          racoon_hexdump(gen->d.ia5->data, gen->d.ia5->length + 1);
                         goto end;                          goto end;
                 }                  }
   
Line 898  eay_check_x509sign(source, sig, cert)
Line 901  eay_check_x509sign(source, sig, cert)
         evp = X509_get_pubkey(x509);          evp = X509_get_pubkey(x509);
         if (! evp) {          if (! evp) {
                 plog(LLV_ERROR, LOCATION, NULL, "X509_get_pubkey(): %s\n", eay_strerror());                  plog(LLV_ERROR, LOCATION, NULL, "X509_get_pubkey(): %s\n", eay_strerror());
                   X509_free(x509);
                 return -1;                  return -1;
         }          }
   
         res = eay_rsa_verify(source, sig, evp->pkey.rsa);          res = eay_rsa_verify(source, sig, evp->pkey.rsa);
   
         EVP_PKEY_free(evp);          EVP_PKEY_free(evp);
           X509_free(x509);
   
         return res;          return res;
 }  }
Line 1291  eay_idea_encrypt(data, key, iv)
Line 1296  eay_idea_encrypt(data, key, iv)
         vchar_t *res;          vchar_t *res;
         IDEA_KEY_SCHEDULE ks;          IDEA_KEY_SCHEDULE ks;
   
         idea_set_encrypt_key(key->v, &ks);          idea_set_encrypt_key((unsigned char *)key->v, &ks);
   
         /* allocate buffer for result */          /* allocate buffer for result */
         if ((res = vmalloc(data->l)) == NULL)          if ((res = vmalloc(data->l)) == NULL)
                 return NULL;                  return NULL;
   
         /* decryption data */          /* decryption data */
         idea_cbc_encrypt(data->v, res->v, data->l,          idea_cbc_encrypt((unsigned char *)data->v, (unsigned char *)res->v, data->l,
                         &ks, iv->v, IDEA_ENCRYPT);                          &ks, (unsigned char *)iv->v, IDEA_ENCRYPT);
   
         return res;          return res;
 }  }
Line 1311  eay_idea_decrypt(data, key, iv)
Line 1316  eay_idea_decrypt(data, key, iv)
         vchar_t *res;          vchar_t *res;
         IDEA_KEY_SCHEDULE ks, dks;          IDEA_KEY_SCHEDULE ks, dks;
   
         idea_set_encrypt_key(key->v, &ks);          idea_set_encrypt_key((unsigned char *)key->v, &ks);
         idea_set_decrypt_key(&ks, &dks);          idea_set_decrypt_key(&ks, &dks);
   
         /* allocate buffer for result */          /* allocate buffer for result */
Line 1319  eay_idea_decrypt(data, key, iv)
Line 1324  eay_idea_decrypt(data, key, iv)
                 return NULL;                  return NULL;
   
         /* decryption data */          /* decryption data */
         idea_cbc_encrypt(data->v, res->v, data->l,          idea_cbc_encrypt((unsigned char *)data->v, (unsigned char *)res->v, data->l,
                         &dks, iv->v, IDEA_DECRYPT);                          &dks, (unsigned char *)iv->v, IDEA_DECRYPT);
   
         return res;          return res;
 }  }
Line 1389  eay_rc5_encrypt(data, key, iv)
Line 1394  eay_rc5_encrypt(data, key, iv)
         RC5_32_KEY ks;          RC5_32_KEY ks;
   
         /* in RFC 2451, there is information about the number of round. */          /* in RFC 2451, there is information about the number of round. */
         RC5_32_set_key(&ks, key->l, key->v, 16);          RC5_32_set_key(&ks, key->l, (unsigned char *)key->v, 16);
   
         /* allocate buffer for result */          /* allocate buffer for result */
         if ((res = vmalloc(data->l)) == NULL)          if ((res = vmalloc(data->l)) == NULL)
                 return NULL;                  return NULL;
   
         /* decryption data */          /* decryption data */
         RC5_32_cbc_encrypt(data->v, res->v, data->l,          RC5_32_cbc_encrypt((unsigned char *)data->v, (unsigned char *)res->v, data->l,
                 &ks, iv->v, RC5_ENCRYPT);                  &ks, (unsigned char *)iv->v, RC5_ENCRYPT);
   
         return res;          return res;
 }  }
Line 1410  eay_rc5_decrypt(data, key, iv)
Line 1415  eay_rc5_decrypt(data, key, iv)
         RC5_32_KEY ks;          RC5_32_KEY ks;
   
         /* in RFC 2451, there is information about the number of round. */          /* in RFC 2451, there is information about the number of round. */
         RC5_32_set_key(&ks, key->l, key->v, 16);          RC5_32_set_key(&ks, key->l, (unsigned char *)key->v, 16);
   
         /* allocate buffer for result */          /* allocate buffer for result */
         if ((res = vmalloc(data->l)) == NULL)          if ((res = vmalloc(data->l)) == NULL)
                 return NULL;                  return NULL;
   
         /* decryption data */          /* decryption data */
         RC5_32_cbc_encrypt(data->v, res->v, data->l,          RC5_32_cbc_encrypt((unsigned char *)data->v, (unsigned char *)res->v, data->l,
                 &ks, iv->v, RC5_DECRYPT);                  &ks, (unsigned char *)iv->v, RC5_DECRYPT);
   
         return res;          return res;
 }  }

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.11.6.5

CVSweb <webmaster@jp.NetBSD.org>