Project

General

Profile

Bug #4944 ยป snapshot-digestfail.patch

Check for EVP_DigestInit_ex failure and raise exception - jared.jennings.ctr (Jared Jennings), 06/30/2011 12:19 AM

View differences:

snapshot-digestfail/ext/openssl/ossl_digest.c 2011-06-29 08:57:46.000000000 -0500
ret = ossl_digest_alloc(cDigest);
GetDigest(ret, ctx);
EVP_DigestInit_ex(ctx, md, NULL);
if(!EVP_DigestInit_ex(ctx, md, NULL)) {
rb_raise(rb_eArgError, "digest algorithm init failed");
}
return ret;
}
......
if (!NIL_P(data)) StringValue(data);
GetDigest(self, ctx);
EVP_DigestInit_ex(ctx, md, NULL);
if(!EVP_DigestInit_ex(ctx, md, NULL)) {
rb_raise(rb_eArgError, "digest algorithm init failed");
}
if (!NIL_P(data)) return ossl_digest_update(self, data);
return self;
}
......
EVP_MD_CTX *ctx;
GetDigest(self, ctx);
EVP_DigestInit_ex(ctx, EVP_MD_CTX_md(ctx), NULL);
if(!EVP_DigestInit_ex(ctx, EVP_MD_CTX_md(ctx), NULL)) {
rb_raise(rb_eArgError, "digest algorithm init failed");
}
return self;
}
    (1-1/1)