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
|
$NetBSD: patch-ef,v 1.1 2010/09/10 03:29:01 taca Exp $
* r18172: suppress warnings.
--- ext/openssl/ossl_pkcs12.c.orig 2007-06-08 15:02:04.000000000 +0000
+++ ext/openssl/ossl_pkcs12.c
@@ -137,15 +137,17 @@ ossl_pkcs12_initialize(int argc, VALUE *
X509 *x509;
STACK_OF(X509) *x509s = NULL;
int st = 0;
+ PKCS12 *pkcs = DATA_PTR(self);
if(rb_scan_args(argc, argv, "02", &arg, &pass) == 0) return self;
passphrase = NIL_P(pass) ? NULL : StringValuePtr(pass);
in = ossl_obj2bio(arg);
- d2i_PKCS12_bio(in, (PKCS12 **)&DATA_PTR(self));
+ d2i_PKCS12_bio(in, &pkcs);
+ DATA_PTR(self) = pkcs;
BIO_free(in);
pkey = cert = ca = Qnil;
- if(!PKCS12_parse((PKCS12*)DATA_PTR(self), passphrase, &key, &x509, &x509s))
+ if(!PKCS12_parse(pkcs, passphrase, &key, &x509, &x509s))
ossl_raise(ePKCS12Error, "PKCS12_parse");
pkey = rb_protect((VALUE(*)_((VALUE)))ossl_pkey_new, (VALUE)key,
&st); /* NO DUP */
@@ -181,7 +183,7 @@ ossl_pkcs12_to_der(VALUE self)
if((len = i2d_PKCS12(p12, NULL)) <= 0)
ossl_raise(ePKCS12Error, NULL);
str = rb_str_new(0, len);
- p = RSTRING_PTR(str);
+ p = (unsigned char *)RSTRING_PTR(str);
if(i2d_PKCS12(p12, &p) <= 0)
ossl_raise(ePKCS12Error, NULL);
ossl_str_adjust(str, p);
|