diff options
author | Michal Rokos <m.rokos@sh.cvut.cz> | 2002-07-24 11:31:08 +0000 |
---|---|---|
committer | Michal Rokos <m.rokos@sh.cvut.cz> | 2002-07-24 11:31:08 +0000 |
commit | 3909160612455b0ef2d512fa9c47e6c2d715812c (patch) | |
tree | 1971699beaf556006833312fe6b624fceaa78f89 /ossl_ns_spki.c | |
parent | d7a9c57681d71ea9584ae552ce8291f4775701ae (diff) | |
download | ruby-openssl-history-3909160612455b0ef2d512fa9c47e6c2d715812c.tar.gz |
ossl_config.c: changed #value so: value("AAA"), means value(nil, "AAA")
Diffstat (limited to 'ossl_ns_spki.c')
-rw-r--r-- | ossl_ns_spki.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/ossl_ns_spki.c b/ossl_ns_spki.c index 005952e..271c667 100644 --- a/ossl_ns_spki.c +++ b/ossl_ns_spki.c @@ -129,13 +129,10 @@ static VALUE ossl_spki_set_public_key(VALUE self, VALUE key) { NETSCAPE_SPKI *spki; - EVP_PKEY *pkey; GetSPKI(self, spki); - pkey = GetPKeyPtr(key); /* NO NEED TO DUP */ - - if (!NETSCAPE_SPKI_set_pubkey(spki, pkey)) { + if (!NETSCAPE_SPKI_set_pubkey(spki, GetPKeyPtr(key))) { /* NO NEED TO DUP */ ossl_raise(eSPKIError, ""); } return key; @@ -148,10 +145,11 @@ ossl_spki_get_challenge(VALUE self) GetSPKI(self, spki); - if (spki->spkac->challenge->length > 0) { - return rb_str_new(spki->spkac->challenge->data, spki->spkac->challenge->length); + if (spki->spkac->challenge->length <= 0) { + OSSL_Debug("Challenge.length <= 0?"); + return rb_str_new2(""); } - return rb_str_new2(""); + return rb_str_new(spki->spkac->challenge->data, spki->spkac->challenge->length); } static VALUE @@ -194,14 +192,11 @@ static VALUE ossl_spki_verify(VALUE self, VALUE key) { NETSCAPE_SPKI *spki; - EVP_PKEY *pkey; int result; GetSPKI(self, spki); - pkey = GetPKeyPtr(key); /* NO NEED TO DUP */ - - if ((result = NETSCAPE_SPKI_verify(spki, pkey)) < 0) { + if ((result = NETSCAPE_SPKI_verify(spki, GetPKeyPtr(key))) < 0) { /* NO NEED TO DUP */ ossl_raise(eSPKIError, ""); } if (result > 0) { |