test: Add coverage for res_crypto

We're validating the following functionality:

encrypting a block of data with RSA
decrypting a block of data with RSA
signing a block of data with RSA
verifying a signature with RSA
encrypting a block of data with AES-ECB
encrypting a block of data with AES-ECB

as well as accessing test keys from the keystore.

ASTERISK-30045 #close

Change-Id: I0d10e7b41009c5290a4356c6480e636712d5c96d
This commit is contained in:
Philip Prindeville
2022-05-03 18:27:48 -06:00
committed by George Joseph
parent 6e9c8caded
commit f82ec339fc
6 changed files with 668 additions and 2 deletions

View File

@@ -39,6 +39,12 @@ typedef char ast_aes_encrypt_key;
typedef char ast_aes_decrypt_key;
#endif /* HAVE_CRYPTO */
/* We previously used the key length explicitly; replace with constant.
* For now, Asterisk is limited to 1024 bit (128 byte) RSA keys.
*/
#define AST_CRYPTO_RSA_KEY_BITS 1024
#define AST_CRYPTO_AES_BLOCKSIZE 128
#define AST_KEY_PUBLIC (1 << 0)
#define AST_KEY_PRIVATE (1 << 1)