reset ctx->num for CTR mode for FIPS EVP
authorDr. Stephen Henson <steve@openssl.org>
Sun, 14 Oct 2012 12:38:58 +0000 (12:38 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 14 Oct 2012 12:38:58 +0000 (12:38 +0000)
fips/utl/fips_enc.c

index 1358b1f4a4bb7f0c40073ecc85a4ef396cf4f1a5..13ac4ac9f57c1b1a7a4f0b1f8ed955b3b8193588 100644 (file)
@@ -208,6 +208,7 @@ int FIPS_cipherinit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
                        break;
 
                        case EVP_CIPH_CTR_MODE:
+                       ctx->num = 0;
                        /* Don't reuse IV for CTR mode */
                        if(iv)
                                memcpy(ctx->iv, iv, M_EVP_CIPHER_CTX_iv_length(ctx));