We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c42b6a commit 842169bCopy full SHA for 842169b
src/encauth/ccm/ccm_memory.c
@@ -78,6 +78,9 @@ int ccm_memory(int cipher,
78
if (*taglen < 4 || *taglen > 16 || (*taglen % 2) == 1 || headerlen > 0x7fffffffu) {
79
return CRYPT_INVALID_ARG;
80
}
81
+ if (noncelen < 7) {
82
+ return CRYPT_INVALID_ARG;
83
+ }
84
85
/* is there an accelerator? */
86
if (cipher_descriptor[cipher].accel_ccm_memory != NULL) {
@@ -144,7 +147,7 @@ int ccm_memory(int cipher,
144
147
(L-1));
145
148
146
149
/* nonce */
- for (y = 0; y < 15 - L; y++) {
150
+ for (y = 0; y < noncelen; y++) {
151
PAD[x++] = nonce[y];
152
153
0 commit comments