mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/openssl/{ossl.[ch],ossl_pkey.c} Add documentation.
* ext/openssl/ossl_hmac.c Add reset method. * ext/openssl/ossl_cipher.c (Cipher#update) Take additional buffer argument. * ext/openssl/{ossl_bio.c,ossl_ssl.c,ruby_missing.h} compatibility with 1.8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
790999028d
commit
3930d3b36b
10 changed files with 138 additions and 21 deletions
|
@ -172,6 +172,22 @@ ossl_hmac_hexdigest(VALUE self)
|
|||
return hexdigest;
|
||||
}
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* hmac.reset -> self
|
||||
*
|
||||
*/
|
||||
static VALUE
|
||||
ossl_hmac_reset(VALUE self)
|
||||
{
|
||||
HMAC_CTX *ctx;
|
||||
|
||||
GetHMAC(self, ctx);
|
||||
HMAC_Init_ex(ctx, NULL, 0, NULL, NULL);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* HMAC.digest(digest, key, data) -> aString
|
||||
|
@ -237,6 +253,7 @@ Init_ossl_hmac()
|
|||
rb_define_method(cHMAC, "initialize", ossl_hmac_initialize, 2);
|
||||
rb_define_copy_func(cHMAC, ossl_hmac_copy);
|
||||
|
||||
rb_define_method(cHMAC, "reset", ossl_hmac_reset, 0);
|
||||
rb_define_method(cHMAC, "update", ossl_hmac_update, 1);
|
||||
rb_define_alias(cHMAC, "<<", "update");
|
||||
rb_define_method(cHMAC, "digest", ossl_hmac_digest, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue