1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
$NetBSD: patch-ee,v 1.1 2010/09/10 03:29:01 taca Exp $
* r18172: suppress warnings.
* r23015: (GetDigestPtr): use StringValueCStr instead of STR2CSTR.
* r23506: (Init_ossl_digest): avoid recursing require.
--- ext/openssl/ossl_digest.c.orig 2008-02-25 08:48:57.000000000 +0000
+++ ext/openssl/ossl_digest.c
@@ -38,7 +38,7 @@ GetDigestPtr(VALUE obj)
const EVP_MD *md;
if (TYPE(obj) == T_STRING) {
- const char *name = STR2CSTR(obj);
+ const char *name = StringValueCStr(obj);
md = EVP_get_digestbyname(name);
if (!md)
@@ -96,7 +96,6 @@ ossl_digest_initialize(int argc, VALUE *
{
EVP_MD_CTX *ctx;
const EVP_MD *md;
- char *name;
VALUE type, data;
rb_scan_args(argc, argv, "11", &type, &data);
@@ -182,7 +181,7 @@ ossl_digest_finish(int argc, VALUE *argv
rb_str_resize(str, EVP_MD_CTX_size(ctx));
}
- EVP_DigestFinal_ex(ctx, RSTRING_PTR(str), NULL);
+ EVP_DigestFinal_ex(ctx, (unsigned char *)RSTRING_PTR(str), NULL);
return str;
}
@@ -234,7 +233,6 @@ ossl_digest_block_length(VALUE self)
void
Init_ossl_digest()
{
- rb_require("openssl");
rb_require("digest");
#if 0 /* let rdoc know about mOSSL */
|