diff options
author | Michal Rokos <m.rokos@sh.cvut.cz> | 2002-03-05 15:05:29 +0000 |
---|---|---|
committer | Michal Rokos <m.rokos@sh.cvut.cz> | 2002-03-05 15:05:29 +0000 |
commit | 3c8abbf103555809d110c21f89de60869a4a6bea (patch) | |
tree | 71beab86d7d0e6fc143a6d5c55a25cc2a75e0b6f /ossl_hmac.c | |
parent | 59dd8c5696d83aff78c506d2a161ea4ffb404088 (diff) | |
download | ruby-openssl-history-3c8abbf103555809d110c21f89de60869a4a6bea.tar.gz |
* WARNING! All to_str methods are not used any longer (use to_text instead)
* made an aliases to_pem as to_s
* more relaxed params checking - everywhere where string was needed it is OK that obj implements to_s method
Diffstat (limited to 'ossl_hmac.c')
-rw-r--r-- | ossl_hmac.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ossl_hmac.c b/ossl_hmac.c index 8bb5aec..e49072b 100644 --- a/ossl_hmac.c +++ b/ossl_hmac.c @@ -70,7 +70,7 @@ ossl_hmac_initialize(int argc, VALUE *argv, VALUE self) rb_scan_args(argc, argv, "20", &key, &digest); - Check_Type(key, T_STRING); + key = rb_String(key); md = ossl_digest_get_EVP_MD(digest); if (!(hmacp->hmac = OPENSSL_malloc(sizeof(HMAC_CTX)))) { @@ -88,7 +88,7 @@ ossl_hmac_update(VALUE self, VALUE data) GetHMAC(self, hmacp); - Check_Type(data, T_STRING); + data = rb_String(data); HMAC_Update(hmacp->hmac, RSTRING(data)->ptr, RSTRING(data)->len); @@ -174,7 +174,7 @@ Init_hmac(VALUE module) rb_define_method(cHMAC, "hmac", ossl_hmac_hmac, 0); rb_define_method(cHMAC, "hexhmac", ossl_hmac_hexhmac, 0); rb_define_alias(cHMAC, "inspect", "hexhmac"); - rb_define_alias(cHMAC, "to_str", "hexhmac"); + rb_define_alias(cHMAC, "to_s", "hexhmac"); } #else /* NO_HMAC */ |