From caca4f33aad84f71b4f542d1455e954f4dd08313 Mon Sep 17 00:00:00 2001 From: Brian White Date: Mon, 3 Mar 2014 00:25:11 -0500 Subject: [PATCH] crypto: fix CipherFinal return value check --- src/node_crypto.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 0991f543f3..3f7a7d187a 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -2478,7 +2478,7 @@ bool CipherBase::Final(unsigned char** out, int *out_len) { return false; *out = new unsigned char[EVP_CIPHER_CTX_block_size(&ctx_)]; - bool r = EVP_CipherFinal_ex(&ctx_, *out, out_len); + int r = EVP_CipherFinal_ex(&ctx_, *out, out_len); if (r && kind_ == kCipher) { delete[] auth_tag_; @@ -2497,7 +2497,7 @@ bool CipherBase::Final(unsigned char** out, int *out_len) { EVP_CIPHER_CTX_cleanup(&ctx_); initialised_ = false; - return r; + return r == 1; }