13 #define WrapX509CRL(klass, obj, crl) do { \
15 ossl_raise(rb_eRuntimeError, "CRL wasn't initialized!"); \
17 (obj) = Data_Wrap_Struct((klass), 0, X509_CRL_free, (crl)); \
19 #define GetX509CRL(obj, crl) do { \
20 Data_Get_Struct((obj), X509_CRL, (crl)); \
22 ossl_raise(rb_eRuntimeError, "CRL wasn't initialized!"); \
25 #define SafeGetX509CRL(obj, crl) do { \
26 OSSL_Check_Kind((obj), cX509CRL); \
27 GetX509CRL((obj), (crl)); \
55 CRYPTO_add(&crl->references, 1, CRYPTO_LOCK_X509_CRL);
66 tmp = crl ? X509_CRL_dup(crl) : X509_CRL_new();
82 if (!(crl = X509_CRL_new())) {
102 crl = PEM_read_bio_X509_CRL(in, &x,
NULL,
NULL);
106 crl = d2i_X509_CRL_bio(in, &x);
118 X509_CRL *a, *b, *crl;
121 if (
self == other)
return self;
124 if (!(crl = X509_CRL_dup(b))) {
140 ver = X509_CRL_get_version(crl);
151 if ((ver =
NUM2LONG(version)) < 0) {
171 if (!(out = BIO_new(BIO_s_mem()))) {
174 if (!i2a_ASN1_OBJECT(out, crl->sig_alg->algorithm)) {
178 BIO_get_mem_ptr(out, &buf);
225 if (!X509_time_adj(crl->crl->lastUpdate, 0, &sec)) {
251 if (!(crl->crl->nextUpdate = X509_time_adj(crl->crl->nextUpdate, 0, &sec))){
267 num = sk_X509_REVOKED_num(X509_CRL_get_REVOKED(crl));
273 for(i=0; i<num; i++) {
275 rev = sk_X509_REVOKED_value(X509_CRL_get_REVOKED(crl), i);
296 sk_X509_REVOKED_pop_free(crl->crl->revoked, X509_REVOKED_free);
297 crl->crl->revoked =
NULL;
335 if (!X509_CRL_sign(crl, pkey, md)) {
349 if ((ret = X509_CRL_verify(crl,
GetPKeyPtr(key))) < 0) {
368 if (!(out = BIO_new(BIO_s_mem()))) {
371 if (!i2d_X509_CRL_bio(out, crl)) {
375 BIO_get_mem_ptr(out, &buf);
391 if (!(out = BIO_new(BIO_s_mem()))) {
394 if (!PEM_write_bio_X509_CRL(out, crl)) {
398 BIO_get_mem_ptr(out, &buf);
414 if (!(out = BIO_new(BIO_s_mem()))) {
417 if (!X509_CRL_print(out, crl)) {
421 BIO_get_mem_ptr(out, &buf);
440 count = X509_CRL_get_ext_count(crl);
446 for (i=0; i<
count; i++) {
447 ext = X509_CRL_get_ext(crl, i);
470 sk_X509_EXTENSION_pop_free(crl->crl->extensions, X509_EXTENSION_free);
471 crl->crl->extensions =
NULL;
474 if(!X509_CRL_add_ext(crl, ext, -1)) {
475 X509_EXTENSION_free(ext);
478 X509_EXTENSION_free(ext);
492 if (!X509_CRL_add_ext(crl, ext, -1)) {
493 X509_EXTENSION_free(ext);
496 X509_EXTENSION_free(ext);