version 1.20, 2010/10/20 13:40:02 |
version 1.20.8.2, 2013/01/16 05:25:55 |
Line 1700 eay_aes_keylen(len) |
|
Line 1700 eay_aes_keylen(len) |
|
return len; |
return len; |
} |
} |
|
|
|
int |
|
eay_aesgcm_keylen(len) |
|
int len; |
|
{ |
|
/* RFC 4106: |
|
* The size of the KEYMAT for the AES-GCM-ESP MUST be four octets longer |
|
* than is needed for the associated AES key. The keying material is |
|
* used as follows: |
|
* |
|
* AES-GCM-ESP with a 128 bit key |
|
* The KEYMAT requested for each AES-GCM key is 20 octets. The first |
|
* 16 octets are the 128-bit AES key, and the remaining four octets |
|
* are used as the salt value in the nonce. |
|
* |
|
* AES-GCM-ESP with a 192 bit key |
|
* The KEYMAT requested for each AES-GCM key is 28 octets. The first |
|
* 24 octets are the 192-bit AES key, and the remaining four octets |
|
* are used as the salt value in the nonce. |
|
* |
|
* AES-GCM-ESP with a 256 bit key |
|
* The KEYMAT requested for each AES GCM key is 36 octets. The first |
|
* 32 octets are the 256-bit AES key, and the remaining four octets |
|
* are used as the salt value in the nonce. |
|
*/ |
|
if (len == 0) |
|
len = 128; |
|
|
|
if (len != 128 && len != 192 && len != 256) |
|
return -1; |
|
|
|
return len + 32; |
|
} |
|
|
#if defined(HAVE_OPENSSL_CAMELLIA_H) |
#if defined(HAVE_OPENSSL_CAMELLIA_H) |
/* |
/* |
* CAMELLIA-CBC |
* CAMELLIA-CBC |
Line 2501 eay_bn2v(var, bn) |
|
Line 2534 eay_bn2v(var, bn) |
|
vchar_t **var; |
vchar_t **var; |
BIGNUM *bn; |
BIGNUM *bn; |
{ |
{ |
*var = vmalloc(bn->top * BN_BYTES); |
*var = vmalloc(BN_num_bytes(bn)); |
if (*var == NULL) |
if (*var == NULL) |
return(-1); |
return(-1); |
|
|