Index: engines/ccgost/gost_crypt.c
===================================================================
--- engines/ccgost/gost_crypt.c (revision 8135)
+++ engines/ccgost/gost_crypt.c (working copy)
@@ -565,6 +565,13 @@
    GOSTerr(GOST_F_GOST_IMIT_FINAL, GOST_R_MAC_KEY_NOT_SET);
    return 0;
  }
+ if (c->count < 8 && c->bytes_left)
+ {
+   unsigned char buffer[8];
+   memset(buffer, 0, 8);
+   gost_imit_update(ctx, buffer, 8);
+ }
+
  if (c->bytes_left)
    {
    int i;

