aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-04-20 17:22:09 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-04-27 23:07:41 +0900
commit73cdcd19945e7306e473095fdd617a388c4b2612 (patch)
treeb33586da15f9ef98767179c32af1f730055e3418
parente9cc5e209b520a87f05f994b2961da0ac0fd1e6d (diff)
downloadruby-73cdcd19945e7306e473095fdd617a388c4b2612.tar.gz
ext/openssl: the return type of HMAC_CTX_copy() is int
-rw-r--r--ext/openssl/openssl_missing.c5
-rw-r--r--ext/openssl/openssl_missing.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/ext/openssl/openssl_missing.c b/ext/openssl/openssl_missing.c
index 7bd4fb7..5c60852 100644
--- a/ext/openssl/openssl_missing.c
+++ b/ext/openssl/openssl_missing.c
@@ -65,15 +65,16 @@ EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in)
#endif
#if !defined(HAVE_HMAC_CTX_COPY)
-void
+int
HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in)
{
- if (!out || !in) return;
memcpy(out, in, sizeof(HMAC_CTX));
EVP_MD_CTX_copy(&out->md_ctx, &in->md_ctx);
EVP_MD_CTX_copy(&out->i_ctx, &in->i_ctx);
EVP_MD_CTX_copy(&out->o_ctx, &in->o_ctx);
+
+ return 1;
}
#endif
diff --git a/ext/openssl/openssl_missing.h b/ext/openssl/openssl_missing.h
index 19644af..1e4b2ae 100644
--- a/ext/openssl/openssl_missing.h
+++ b/ext/openssl/openssl_missing.h
@@ -34,7 +34,7 @@ int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in);
#endif
#if !defined(HAVE_HMAC_CTX_COPY)
-void HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
+int HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
#endif
/*** added in 1.0.1 ***/