Browse Source

Fixed buf offset EVP_EncryptFinal_ex() to include outlen.

pull/1960/head
Chad Fraleigh 1 year ago
parent
commit
627b8dca83
No known key found for this signature in database
GPG Key ID: 2415C39758458A8F
  1. 2
      libi2pd/Crypto.cpp

2
libi2pd/Crypto.cpp

@ -991,7 +991,7 @@ namespace crypto @@ -991,7 +991,7 @@ namespace crypto
EVP_EncryptInit_ex(ctx, NULL, NULL, key, nonce);
EVP_EncryptUpdate(ctx, NULL, &outlen, ad, adLen);
EVP_EncryptUpdate(ctx, buf, &outlen, msg, msgLen);
EVP_EncryptFinal_ex(ctx, buf, &outlen);
EVP_EncryptFinal_ex(ctx, buf + outlen, &outlen);
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_GET_TAG, 16, buf + msgLen);
}
else

Loading…
Cancel
Save