Browse Source

Fix #930

pull/936/head
Max Lv 8 years ago
parent
commit
29658019d4
1 changed files with 9 additions and 2 deletions
  1. 11
      src/encrypt.c

11
src/encrypt.c

@ -436,7 +436,10 @@ int
cipher_iv_size(const cipher_t *cipher)
{
#if defined(USE_CRYPTO_OPENSSL)
return cipher->iv_len;
if (cipher->info == NULL)
return cipher->iv_len;
else
return EVP_CIPHER_iv_length(cipher->info);
#elif defined(USE_CRYPTO_POLARSSL) || defined(USE_CRYPTO_MBEDTLS)
if (cipher == NULL) {
return 0;
@ -449,7 +452,10 @@ int
cipher_key_size(const cipher_t *cipher)
{
#if defined(USE_CRYPTO_OPENSSL)
return cipher->key_len;
if (cipher->info == NULL)
return cipher->key_len;
else
return EVP_CIPHER_key_length(cipher->info);
#elif defined(USE_CRYPTO_POLARSSL)
if (cipher == NULL) {
return 0;
@ -510,6 +516,7 @@ bytes_to_key(const cipher_t *cipher, const digest_type_t *md,
key[j] = md_buf[i];
}
}
return nkey;
#elif defined(USE_CRYPTO_POLARSSL)

Loading…
Cancel
Save