From 08dee27359566a35ea3181d4062b1e43ccf46dab Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 9 Nov 2017 19:47:27 +0100 Subject: [PATCH] fixes #323 ccm_process fails to process input buffer longer than 256 bytes --- src/encauth/ccm/ccm_process.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/encauth/ccm/ccm_process.c b/src/encauth/ccm/ccm_process.c index 2446f2810..8346d2259 100644 --- a/src/encauth/ccm/ccm_process.c +++ b/src/encauth/ccm/ccm_process.c @@ -24,7 +24,8 @@ int ccm_process(ccm_state *ccm, unsigned char *ct, int direction) { - unsigned char y, z, b; + unsigned char z, b; + unsigned long y; int err; LTC_ARGCHK(ccm != NULL); @@ -44,9 +45,8 @@ int ccm_process(ccm_state *ccm, if (ptlen > 0) { LTC_ARGCHK(pt != NULL); LTC_ARGCHK(ct != NULL); - y = 0; - for (; y < ptlen; y++) { + for (y = 0; y < ptlen; y++) { /* increment the ctr? */ if (ccm->CTRlen == 16) { for (z = 15; z > 15-ccm->L; z--) {