1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/openssl/openssl_missing.c (HMAC_CTX_copy): adopted to

prototype change in openssl bundled with newer OpenBSD.
  a patch from Takahiro Kambe <taca at back-street.net> in
  [ruby-dev:34691].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-05-15 09:44:38 +00:00
parent 22361a3d1c
commit a8a1114efe
4 changed files with 70 additions and 15 deletions

View file

@ -87,9 +87,7 @@ ossl_hmac_copy(VALUE self, VALUE other)
GetHMAC(self, ctx1);
SafeGetHMAC(other, ctx2);
if (!HMAC_CTX_copy(ctx1, ctx2)) {
ossl_raise(eHMACError, NULL);
}
HMAC_CTX_copy(ctx1, ctx2);
return self;
}
@ -115,9 +113,7 @@ hmac_final(HMAC_CTX *ctx, char **buf, int *buf_len)
{
HMAC_CTX final;
if (!HMAC_CTX_copy(&final, ctx)) {
ossl_raise(eHMACError, NULL);
}
HMAC_CTX_copy(&final, ctx);
if (!(*buf = OPENSSL_malloc(HMAC_size(&final)))) {
HMAC_CTX_cleanup(&final);
OSSL_Debug("Allocating %d mem", HMAC_size(&final));