forked from Mirrors/freeswitch
Set the algorithm member on cipher_t when allocating AES crypto instance. Apply same fix to NULL cipher.
This commit is contained in:
parent
aa4261d11f
commit
b9da5149e2
@ -118,6 +118,17 @@ aes_icm_alloc_ismacryp(cipher_t **c, int key_len, int forIsmacryp) {
|
||||
|
||||
/* set pointers */
|
||||
*c = (cipher_t *)pointer;
|
||||
switch (key_len) {
|
||||
case 46:
|
||||
(*c)->algorithm = AES_256_ICM;
|
||||
break;
|
||||
case 38:
|
||||
(*c)->algorithm = AES_192_ICM;
|
||||
break;
|
||||
default:
|
||||
(*c)->algorithm = AES_128_ICM;
|
||||
break;
|
||||
}
|
||||
(*c)->type = &aes_icm;
|
||||
(*c)->state = pointer + sizeof(cipher_t);
|
||||
|
||||
|
@ -68,6 +68,7 @@ null_cipher_alloc(cipher_t **c, int key_len) {
|
||||
|
||||
/* set pointers */
|
||||
*c = (cipher_t *)pointer;
|
||||
(*c)->algorithm = NULL_CIPHER;
|
||||
(*c)->type = &null_cipher;
|
||||
(*c)->state = pointer + sizeof(cipher_t);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user