aboutsummaryrefslogtreecommitdiff
path: root/openssl/engines/ccgost/gost89.c
diff options
context:
space:
mode:
Diffstat (limited to 'openssl/engines/ccgost/gost89.c')
-rw-r--r--openssl/engines/ccgost/gost89.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/openssl/engines/ccgost/gost89.c b/openssl/engines/ccgost/gost89.c
index 7ebae0f71..b0568c6b3 100644
--- a/openssl/engines/ccgost/gost89.c
+++ b/openssl/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;
}