提交 b9da5149 authored 作者: jfigus's avatar jfigus 提交者: Travis Cross

Set the algorithm member on cipher_t when allocating AES crypto instance. Apply…

Set the algorithm member on cipher_t when allocating AES crypto instance.  Apply same fix to NULL cipher.
上级 aa4261d1
......@@ -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);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论