aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_x509crl.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/ossl_x509crl.c')
-rw-r--r--ext/openssl/ossl_x509crl.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/ext/openssl/ossl_x509crl.c b/ext/openssl/ossl_x509crl.c
index 9ad98430ab..9d836a3f1e 100644
--- a/ext/openssl/ossl_x509crl.c
+++ b/ext/openssl/ossl_x509crl.c
@@ -241,7 +241,7 @@ ossl_x509crl_set_last_update(VALUE self, VALUE time)
sec = time_to_time_t(time);
GetX509CRL(self, crl);
- if (!X509_time_adj(crl->crl->lastUpdate, 0, &sec)) {
+ if (!X509_time_adj(X509_CRL_get_lastUpdate(crl), 0, &sec)) {
ossl_raise(eX509CRLError, NULL);
}
@@ -263,13 +263,17 @@ ossl_x509crl_set_next_update(VALUE self, VALUE time)
{
X509_CRL *crl;
time_t sec;
+ ASN1_TIME *tm;
sec = time_to_time_t(time);
GetX509CRL(self, crl);
/* This must be some thinko in OpenSSL */
- if (!(crl->crl->nextUpdate = X509_time_adj(crl->crl->nextUpdate, 0, &sec))){
+ tm = X509_time_adj(X509_CRL_get_nextUpdate(crl), 0, &sec);
+ if (!X509_CRL_set_nextUpdate(crl, tm)) {
+ ASN1_TIME_free(tm);
ossl_raise(eX509CRLError, NULL);
}
+ ASN1_TIME_free(tm);
return time;
}
@@ -304,6 +308,7 @@ ossl_x509crl_set_revoked(VALUE self, VALUE ary)
{
X509_CRL *crl;
X509_REVOKED *rev;
+ STACK_OF(X509_REVOKED) *rev_stack;
long i;
Check_Type(ary, T_ARRAY);
@@ -312,8 +317,9 @@ ossl_x509crl_set_revoked(VALUE self, VALUE ary)
OSSL_Check_Kind(RARRAY_AREF(ary, i), cX509Rev);
}
GetX509CRL(self, crl);
- sk_X509_REVOKED_pop_free(crl->crl->revoked, X509_REVOKED_free);
- crl->crl->revoked = NULL;
+ rev_stack = X509_CRL_get_REVOKED(crl);
+ while ((rev = sk_X509_REVOKED_delete(rev_stack, 0)))
+ X509_REVOKED_free(rev);
for (i=0; i<RARRAY_LEN(ary); i++) {
rev = DupX509RevokedPtr(RARRAY_AREF(ary, i));
if (!X509_CRL_add0_revoked(crl, rev)) { /* NO DUP - don't free! */
@@ -486,8 +492,8 @@ ossl_x509crl_set_extensions(VALUE self, VALUE ary)
OSSL_Check_Kind(RARRAY_AREF(ary, i), cX509Ext);
}
GetX509CRL(self, crl);
- sk_X509_EXTENSION_pop_free(crl->crl->extensions, X509_EXTENSION_free);
- crl->crl->extensions = NULL;
+ while ((ext = X509_CRL_delete_ext(crl, 0)))
+ X509_EXTENSION_free(ext);
for (i=0; i<RARRAY_LEN(ary); i++) {
ext = DupX509ExtPtr(RARRAY_AREF(ary, i));
if(!X509_CRL_add_ext(crl, ext, -1)) { /* DUPs ext - FREE it */