aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_ocsp.c
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-07-23 15:30:58 +0900
committerKazuki Yamaguchi <k@rhe.jp>2017-07-23 15:30:58 +0900
commitf745503f49de768ef5112ceaff4e7120bfcef50c (patch)
tree680f009205113db940360bbc6e1598092df133f7 /ext/openssl/ossl_ocsp.c
parent333bb3696e565ef6c5921a4956262ff497780bf0 (diff)
parent6b67c6d91389d73b06d76c10d4d25b67b827b259 (diff)
downloadruby-openssl-f745503f49de768ef5112ceaff4e7120bfcef50c.tar.gz
Merge branch 'topic/asn1-overhaul'
* topic/asn1-overhaul: asn1: do not treat EOC octets as part of content octets asn1: prevent EOC octets from being in the middle of the content asn1: harmonize OpenSSL::ASN1::*#to_der asn1: clean up OpenSSL::ASN1::Constructive#to_der asn1: use ossl_asn1_tag() asn1: allow tag number to be >= 32 for universal tag class asn1: prohibit indefinite length form for primitive encoding asn1: allow constructed encoding with definite length form asn1: avoid truncating OID in OpenSSL::ASN1::ObjectId#oid asn1: disallow NULL to be passed to asn1time_to_time() asn1: check for illegal 'unused_bits' value of BitString asn1: initialize 'unused_bits' attribute of BitString with 0 asn1: require tag information when instantiating generic type asn1: remove an unnecessary function prototype asn1: rearrange tests asn1: infinite length -> indefinite length
Diffstat (limited to 'ext/openssl/ossl_ocsp.c')
-rw-r--r--ext/openssl/ossl_ocsp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/openssl/ossl_ocsp.c b/ext/openssl/ossl_ocsp.c
index 28cc2791..c0237791 100644
--- a/ext/openssl/ossl_ocsp.c
+++ b/ext/openssl/ossl_ocsp.c
@@ -1328,8 +1328,10 @@ ossl_ocspsres_get_this_update(VALUE self)
status = OCSP_single_get0_status(sres, NULL, NULL, &time, NULL);
if (status < 0)
ossl_raise(eOCSPError, "OCSP_single_get0_status");
+ if (!time)
+ return Qnil;
- return asn1time_to_time(time); /* will handle NULL */
+ return asn1time_to_time(time);
}
/*
@@ -1347,6 +1349,8 @@ ossl_ocspsres_get_next_update(VALUE self)
status = OCSP_single_get0_status(sres, NULL, NULL, NULL, &time);
if (status < 0)
ossl_raise(eOCSPError, "OCSP_single_get0_status");
+ if (!time)
+ return Qnil;
return asn1time_to_time(time);
}
@@ -1368,6 +1372,8 @@ ossl_ocspsres_get_revocation_time(VALUE self)
ossl_raise(eOCSPError, "OCSP_single_get0_status");
if (status != V_OCSP_CERTSTATUS_REVOKED)
ossl_raise(eOCSPError, "certificate is not revoked");
+ if (!time)
+ return Qnil;
return asn1time_to_time(time);
}