From cf67ec09e48e8043f2d7cadeedc5fced9af1b410 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Thu, 22 Aug 2019 16:52:16 -0700 Subject: [PATCH] Make |EVP_CIPHER_CTX_reset| return one. (It does upstream.) Change-Id: I0c00e393b32a7ed237abba682b45d81889cf9fa8 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/37245 Commit-Queue: Adam Langley Commit-Queue: David Benjamin Reviewed-by: David Benjamin --- crypto/fipsmodule/cipher/cipher.c | 3 ++- include/openssl/cipher.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crypto/fipsmodule/cipher/cipher.c b/crypto/fipsmodule/cipher/cipher.c index 39e038beb..7c6fa8e48 100644 --- a/crypto/fipsmodule/cipher/cipher.c +++ b/crypto/fipsmodule/cipher/cipher.c @@ -125,9 +125,10 @@ int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in) { return 1; } -void EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx) { +int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx) { EVP_CIPHER_CTX_cleanup(ctx); EVP_CIPHER_CTX_init(ctx); + return 1; } int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, diff --git a/include/openssl/cipher.h b/include/openssl/cipher.h index ea7a940ab..17b7b91cc 100644 --- a/include/openssl/cipher.h +++ b/include/openssl/cipher.h @@ -136,8 +136,8 @@ OPENSSL_EXPORT int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in); // EVP_CIPHER_CTX_reset calls |EVP_CIPHER_CTX_cleanup| followed by -// |EVP_CIPHER_CTX_init|. -OPENSSL_EXPORT void EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx); +// |EVP_CIPHER_CTX_init| and returns one. +OPENSSL_EXPORT int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx); // Cipher context configuration.