mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
res_crypto: Use EVP API's instead of legacy API's
ASTERISK-30046 #close Change-Id: I5c738756de75fd27ebad54be144c0ac6193f21b2
This commit is contained in:
committed by
George Joseph
parent
0972106d51
commit
bb8b2259bc
@@ -498,7 +498,10 @@ AST_TEST_DEFINE(crypto_aes_encrypt)
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
ast_aes_set_encrypt_key(key, &aes_key);
|
||||
ast_aes_encrypt(plaintext, buf, &aes_key);
|
||||
if (ast_aes_encrypt(plaintext, buf, &aes_key) <= 0) {
|
||||
ast_test_status_update(test, "ast_aes_encrypt() failed\n");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
args[KEY] = hexstring(key, sizeof(key));
|
||||
if (ast_test_capture_command(&cap, command, args, (const char *)buf, sizeof(buf)) != 1) {
|
||||
@@ -594,7 +597,10 @@ AST_TEST_DEFINE(crypto_aes_decrypt)
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
ast_aes_set_decrypt_key(key, &aes_key);
|
||||
ast_aes_decrypt((const unsigned char *)cap.outbuf, buf, &aes_key);
|
||||
if (ast_aes_decrypt((const unsigned char *)cap.outbuf, buf, &aes_key) <= 0) {
|
||||
ast_test_status_update(test, "ast_aes_decrypt() failed\n");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (memcmp(plaintext, buf, sizeof(plaintext))) {
|
||||
ast_test_status_update(test, "AES decryption mismatch\n");
|
||||
|
Reference in New Issue
Block a user