Skip to content

Commit

Permalink
Merge pull request #463 from rhenium/ky/require-digest-gem
Browse files Browse the repository at this point in the history
digest: load digest library using Kernel#require
  • Loading branch information
rhenium committed Oct 14, 2021
2 parents 6880dba + 157f807 commit b013908
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ext/openssl/ossl_digest.c
Expand Up @@ -313,8 +313,6 @@ ossl_digest_block_length(VALUE self)
void
Init_ossl_digest(void)
{
rb_require("digest");

#if 0
mOSSL = rb_define_module("OpenSSL");
eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
Expand Down Expand Up @@ -433,6 +431,12 @@ Init_ossl_digest(void)
* digest2 = sha256.digest(data2)
*
*/

/*
* Digest::Class is defined by the digest library. rb_require() cannot be
* used here because it bypasses RubyGems.
*/
rb_funcall(Qnil, rb_intern_const("require"), 1, rb_str_new_cstr("digest"));
cDigest = rb_define_class_under(mOSSL, "Digest", rb_path2class("Digest::Class"));
/* Document-class: OpenSSL::Digest::DigestError
*
Expand Down

0 comments on commit b013908

Please sign in to comment.