diff options
author | Andy Polyakov <appro@openssl.org> | 2013-01-19 18:24:03 +0100 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2013-01-19 18:24:03 +0100 |
commit | 5cfefd3ce33a90e89c24e8860ecbc2c6ef113fe7 (patch) | |
tree | e6760b57a11c3bba65a6c725e04ae3532d02e5a7 /engines/ccgost/gost89.c | |
parent | 3c92471723a66d8753cffeeac2ab15ec29439d49 (diff) |
engines/ccgost: GOST fixes [from master].
Submitted by: Dmitry Belyavsky, Seguei Leontiev
PR: 2821
Diffstat (limited to 'engines/ccgost/gost89.c')
-rw-r--r-- | engines/ccgost/gost89.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/engines/ccgost/gost89.c b/engines/ccgost/gost89.c index 7ebae0f71f..b0568c6b3c 100644 --- a/engines/ccgost/gost89.c +++ b/engines/ccgost/gost89.c @@ -369,7 +369,13 @@ int gost_mac(gost_ctx *ctx,int mac_len,const unsigned char *data, memset(buf2,0,8); memcpy(buf2,data+i,data_len-i); mac_block(ctx,buffer,buf2); - } + i+=8; + } + if (i==8) + { + memset(buf2,0,8); + mac_block(ctx,buffer,buf2); + } get_mac(buffer,mac_len,mac); return 1; } @@ -389,7 +395,13 @@ int gost_mac_iv(gost_ctx *ctx,int mac_len,const unsigned char *iv,const unsigned memset(buf2,0,8); memcpy(buf2,data+i,data_len-i); mac_block(ctx,buffer,buf2); + i+=8; } + if (i==8) + { + memset(buf2,0,8); + mac_block(ctx,buffer,buf2); + } get_mac(buffer,mac_len,mac); return 1; } |