diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-19 12:19:42 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-19 12:19:42 +0100 |
commit | af5fd82514406b1c3d95ca353589798872062395 (patch) | |
tree | f8d84b5bce237a0e03cd64e7ef169801b5aff59b /src/libcryptobox | |
parent | 6e96935b1399008099e388bfc29747da401e081c (diff) | |
download | rspamd-af5fd82514406b1c3d95ca353589798872062395.tar.gz rspamd-af5fd82514406b1c3d95ca353589798872062395.zip |
Fix nonces and pk sizes for openssl mode
Diffstat (limited to 'src/libcryptobox')
-rw-r--r-- | src/libcryptobox/cryptobox.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libcryptobox/cryptobox.c b/src/libcryptobox/cryptobox.c index 7978aa9a6..c3c0f3b35 100644 --- a/src/libcryptobox/cryptobox.c +++ b/src/libcryptobox/cryptobox.c @@ -391,7 +391,8 @@ rspamd_cryptobox_encrypt_init (void *enc_ctx, const rspamd_nonce_t nonce, s = cryptobox_align_ptr (enc_ctx, CRYPTOBOX_ALIGNMENT); memset (s, 0, sizeof (*s)); g_assert (EVP_EncryptInit_ex (s, EVP_aes_256_gcm (), NULL, NULL, NULL) == 1); - g_assert (EVP_CIPHER_CTX_ctrl (s, EVP_CTRL_GCM_SET_IVLEN, 24, NULL) == 1); + g_assert (EVP_CIPHER_CTX_ctrl (s, EVP_CTRL_GCM_SET_IVLEN, + rspamd_cryptobox_nonce_bytes (), NULL) == 1); g_assert (EVP_EncryptInit_ex (s, NULL, NULL, nm, nonce) == 1); return s; @@ -555,7 +556,8 @@ rspamd_cryptobox_decrypt_init (void *enc_ctx, const rspamd_nonce_t nonce, s = cryptobox_align_ptr (enc_ctx, CRYPTOBOX_ALIGNMENT); memset (s, 0, sizeof (*s)); g_assert (EVP_DecryptInit_ex(s, EVP_aes_256_gcm (), NULL, NULL, NULL) == 1); - g_assert (EVP_CIPHER_CTX_ctrl (s, EVP_CTRL_GCM_SET_IVLEN, 24, NULL) == 1); + g_assert (EVP_CIPHER_CTX_ctrl (s, EVP_CTRL_GCM_SET_IVLEN, + rspamd_cryptobox_nonce_bytes (), NULL) == 1); g_assert (EVP_DecryptInit_ex (s, NULL, NULL, nm, nonce) == 1); return s; |