Coverage Report

Created: 2026-09-12 06:55

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl35/crypto/x509/x_crl.c
Line
Count
Source
1
/*
2
 * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
3
 *
4
 * Licensed under the Apache License 2.0 (the "License").  You may not use
5
 * this file except in compliance with the License.  You can obtain a copy
6
 * in the file LICENSE in the source distribution or at
7
 * https://www.openssl.org/source/license.html
8
 */
9
10
#include <stdio.h>
11
#include "internal/cryptlib.h"
12
#include <openssl/asn1t.h>
13
#include <openssl/x509.h>
14
#include "crypto/x509.h"
15
#include <openssl/x509v3.h>
16
#include "x509_local.h"
17
18
static int X509_REVOKED_cmp(const X509_REVOKED *const *a,
19
    const X509_REVOKED *const *b);
20
static int setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp);
21
22
ASN1_SEQUENCE(X509_REVOKED) = {
23
    ASN1_EMBED(X509_REVOKED, serialNumber, ASN1_INTEGER),
24
    ASN1_SIMPLE(X509_REVOKED, revocationDate, ASN1_TIME),
25
    ASN1_SEQUENCE_OF_OPT(X509_REVOKED, extensions, X509_EXTENSION)
26
838k
} ASN1_SEQUENCE_END(X509_REVOKED)
27
838k
28
838k
static int def_crl_verify(X509_CRL *crl, EVP_PKEY *r);
29
838k
static int def_crl_lookup(X509_CRL *crl,
30
838k
    X509_REVOKED **ret, const ASN1_INTEGER *serial,
31
838k
    const X509_NAME *issuer);
32
838k
33
838k
static X509_CRL_METHOD int_crl_meth = {
34
838k
    0,
35
838k
    0, 0,
36
838k
    def_crl_lookup,
37
838k
    def_crl_verify
38
838k
};
39
838k
40
838k
static const X509_CRL_METHOD *default_crl_method = &int_crl_meth;
41
838k
42
838k
/*
43
838k
 * The X509_CRL_INFO structure needs a bit of customisation. Since we cache
44
838k
 * the original encoding the signature won't be affected by reordering of the
45
838k
 * revoked field.
46
838k
 */
47
838k
static int crl_inf_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
48
838k
    void *exarg)
49
1.32M
{
50
1.32M
    X509_CRL_INFO *a = (X509_CRL_INFO *)*pval;
51
52
1.32M
    if (!a || !a->revoked)
53
1.27M
        return 1;
54
47.4k
    switch (operation) {
55
        /*
56
         * Just set cmp function here. We don't sort because that would
57
         * affect the output of X509_CRL_print().
58
         */
59
22.5k
    case ASN1_OP_D2I_POST:
60
22.5k
        (void)sk_X509_REVOKED_set_cmp_func(a->revoked, X509_REVOKED_cmp);
61
22.5k
        break;
62
47.4k
    }
63
47.4k
    return 1;
64
47.4k
}
65
66
ASN1_SEQUENCE_enc(X509_CRL_INFO, enc, crl_inf_cb) = {
67
    ASN1_OPT(X509_CRL_INFO, version, ASN1_INTEGER),
68
    ASN1_EMBED(X509_CRL_INFO, sig_alg, X509_ALGOR),
69
    ASN1_SIMPLE(X509_CRL_INFO, issuer, X509_NAME),
70
    ASN1_SIMPLE(X509_CRL_INFO, lastUpdate, ASN1_TIME),
71
    ASN1_OPT(X509_CRL_INFO, nextUpdate, ASN1_TIME),
72
    ASN1_SEQUENCE_OF_OPT(X509_CRL_INFO, revoked, X509_REVOKED),
73
    ASN1_EXP_SEQUENCE_OF_OPT(X509_CRL_INFO, extensions, X509_EXTENSION, 0)
74
} ASN1_SEQUENCE_END_enc(X509_CRL_INFO, X509_CRL_INFO)
75
76
/*
77
 * Set CRL entry issuer according to CRL certificate issuer extension. Check
78
 * for unhandled critical CRL entry extensions.
79
 */
80
81
static int crl_set_issuers(X509_CRL *crl)
82
111k
{
83
84
111k
    int i, j;
85
111k
    GENERAL_NAMES *gens, *gtmp;
86
111k
    STACK_OF(X509_REVOKED) *revoked;
87
88
111k
    revoked = X509_CRL_get_REVOKED(crl);
89
90
111k
    gens = NULL;
91
266k
    for (i = 0; i < sk_X509_REVOKED_num(revoked); i++) {
92
161k
        X509_REVOKED *rev = sk_X509_REVOKED_value(revoked, i);
93
161k
        STACK_OF(X509_EXTENSION) *exts;
94
161k
        ASN1_ENUMERATED *reason;
95
161k
        X509_EXTENSION *ext;
96
97
161k
        gtmp = X509_REVOKED_get_ext_d2i(rev,
98
161k
            NID_certificate_issuer, &j, NULL);
99
161k
        if (gtmp == NULL && j != -1) {
100
1.33k
            crl->flags |= EXFLAG_INVALID;
101
1.33k
            return 1;
102
1.33k
        }
103
104
160k
        if (gtmp != NULL) {
105
16.9k
            if (crl->issuers == NULL) {
106
2.55k
                crl->issuers = sk_GENERAL_NAMES_new_null();
107
2.55k
                if (crl->issuers == NULL) {
108
0
                    GENERAL_NAMES_free(gtmp);
109
0
                    return 0;
110
0
                }
111
2.55k
            }
112
16.9k
            if (!sk_GENERAL_NAMES_push(crl->issuers, gtmp)) {
113
0
                GENERAL_NAMES_free(gtmp);
114
0
                return 0;
115
0
            }
116
16.9k
            gens = gtmp;
117
16.9k
        }
118
160k
        rev->issuer = gens;
119
120
160k
        reason = X509_REVOKED_get_ext_d2i(rev, NID_crl_reason, &j, NULL);
121
160k
        if (reason == NULL && j != -1) {
122
5.29k
            crl->flags |= EXFLAG_INVALID;
123
5.29k
            return 1;
124
5.29k
        }
125
126
155k
        if (reason != NULL) {
127
59.2k
            rev->reason = ASN1_ENUMERATED_get(reason);
128
59.2k
            ASN1_ENUMERATED_free(reason);
129
59.2k
        } else
130
96.0k
            rev->reason = CRL_REASON_NONE;
131
132
        /* Check for critical CRL entry extensions */
133
134
155k
        exts = rev->extensions;
135
136
273k
        for (j = 0; j < sk_X509_EXTENSION_num(exts); j++) {
137
120k
            ext = sk_X509_EXTENSION_value(exts, j);
138
120k
            if (X509_EXTENSION_get_critical(ext)) {
139
2.33k
                if (OBJ_obj2nid(X509_EXTENSION_get_object(ext))
140
2.33k
                    == NID_certificate_issuer)
141
261
                    continue;
142
2.07k
                crl->flags |= EXFLAG_CRITICAL;
143
2.07k
                break;
144
2.33k
            }
145
120k
        }
146
155k
    }
147
148
104k
    return 1;
149
111k
}
150
151
/*
152
 * The X509_CRL structure needs a bit of customisation. Cache some extensions
153
 * and hash of the whole CRL or set EXFLAG_NO_FINGERPRINT if this fails.
154
 */
155
static int crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
156
    void *exarg)
157
1.25M
{
158
1.25M
    X509_CRL *crl = (X509_CRL *)*pval;
159
1.25M
    STACK_OF(X509_EXTENSION) *exts;
160
1.25M
    X509_EXTENSION *ext;
161
1.25M
    int idx, i;
162
163
1.25M
    switch (operation) {
164
146k
    case ASN1_OP_D2I_PRE:
165
146k
        if (crl->meth->crl_free) {
166
0
            if (!crl->meth->crl_free(crl))
167
0
                return 0;
168
0
        }
169
146k
        AUTHORITY_KEYID_free(crl->akid);
170
146k
        ISSUING_DIST_POINT_free(crl->idp);
171
146k
        ASN1_INTEGER_free(crl->crl_number);
172
146k
        ASN1_INTEGER_free(crl->base_crl_number);
173
146k
        sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free);
174
        /* fall through */
175
176
293k
    case ASN1_OP_NEW_POST:
177
293k
        crl->idp = NULL;
178
293k
        crl->akid = NULL;
179
293k
        crl->flags = 0;
180
293k
        crl->idp_flags = 0;
181
293k
        crl->idp_reasons = CRLDP_ALL_REASONS;
182
293k
        crl->meth = default_crl_method;
183
293k
        crl->meth_data = NULL;
184
293k
        crl->issuers = NULL;
185
293k
        crl->crl_number = NULL;
186
293k
        crl->base_crl_number = NULL;
187
293k
        break;
188
189
111k
    case ASN1_OP_D2I_POST:
190
111k
        if (!X509_CRL_digest(crl, EVP_sha1(), crl->sha1_hash, NULL))
191
0
            crl->flags |= EXFLAG_NO_FINGERPRINT;
192
111k
        crl->idp = X509_CRL_get_ext_d2i(crl,
193
111k
            NID_issuing_distribution_point, &i,
194
111k
            NULL);
195
111k
        if (crl->idp != NULL) {
196
17.6k
            if (!setup_idp(crl, crl->idp))
197
750
                crl->flags |= EXFLAG_INVALID;
198
93.5k
        } else if (i != -1) {
199
36.1k
            crl->flags |= EXFLAG_INVALID;
200
36.1k
        }
201
202
111k
        crl->akid = X509_CRL_get_ext_d2i(crl,
203
111k
            NID_authority_key_identifier, &i,
204
111k
            NULL);
205
111k
        if (crl->akid == NULL && i != -1)
206
22.4k
            crl->flags |= EXFLAG_INVALID;
207
208
111k
        crl->crl_number = X509_CRL_get_ext_d2i(crl,
209
111k
            NID_crl_number, &i, NULL);
210
111k
        if (crl->crl_number == NULL && i != -1)
211
10.5k
            crl->flags |= EXFLAG_INVALID;
212
213
111k
        crl->base_crl_number = X509_CRL_get_ext_d2i(crl,
214
111k
            NID_delta_crl, &i,
215
111k
            NULL);
216
111k
        if (crl->base_crl_number == NULL && i != -1)
217
5.78k
            crl->flags |= EXFLAG_INVALID;
218
        /* Delta CRLs must have CRL number */
219
111k
        if (crl->base_crl_number && !crl->crl_number)
220
710
            crl->flags |= EXFLAG_INVALID;
221
222
        /*
223
         * See if we have any unhandled critical CRL extensions and indicate
224
         * this in a flag. We only currently handle IDP so anything else
225
         * critical sets the flag. This code accesses the X509_CRL structure
226
         * directly: applications shouldn't do this.
227
         */
228
229
111k
        exts = crl->crl.extensions;
230
231
774k
        for (idx = 0; idx < sk_X509_EXTENSION_num(exts); idx++) {
232
667k
            int nid;
233
667k
            ext = sk_X509_EXTENSION_value(exts, idx);
234
667k
            nid = OBJ_obj2nid(X509_EXTENSION_get_object(ext));
235
667k
            if (nid == NID_freshest_crl)
236
19.6k
                crl->flags |= EXFLAG_FRESHEST;
237
667k
            if (X509_EXTENSION_get_critical(ext)) {
238
                /* We handle IDP and deltas */
239
28.7k
                if ((nid == NID_issuing_distribution_point)
240
12.4k
                    || (nid == NID_authority_key_identifier)
241
5.99k
                    || (nid == NID_delta_crl))
242
24.5k
                    continue;
243
4.21k
                crl->flags |= EXFLAG_CRITICAL;
244
4.21k
                break;
245
28.7k
            }
246
667k
        }
247
248
111k
        if (!crl_set_issuers(crl))
249
0
            return 0;
250
251
111k
        if (crl->meth->crl_init) {
252
0
            if (crl->meth->crl_init(crl) == 0)
253
0
                return 0;
254
0
        }
255
256
111k
        crl->flags |= EXFLAG_SET;
257
111k
        break;
258
259
146k
    case ASN1_OP_FREE_POST:
260
146k
        if (crl->meth != NULL && crl->meth->crl_free != NULL) {
261
0
            if (!crl->meth->crl_free(crl))
262
0
                return 0;
263
0
        }
264
146k
        AUTHORITY_KEYID_free(crl->akid);
265
146k
        ISSUING_DIST_POINT_free(crl->idp);
266
146k
        ASN1_INTEGER_free(crl->crl_number);
267
146k
        ASN1_INTEGER_free(crl->base_crl_number);
268
146k
        sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free);
269
146k
        OPENSSL_free(crl->propq);
270
146k
        break;
271
0
    case ASN1_OP_DUP_POST: {
272
0
        X509_CRL *old = exarg;
273
274
0
        if (!ossl_x509_crl_set0_libctx(crl, old->libctx, old->propq))
275
0
            return 0;
276
0
    } break;
277
1.25M
    }
278
1.25M
    return 1;
279
1.25M
}
280
281
/* Convert IDP into a more convenient form */
282
283
static int setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp)
284
17.9k
{
285
17.9k
    int idp_only = 0;
286
17.9k
    int ret = 0;
287
288
    /* Set various flags according to IDP */
289
17.9k
    crl->idp_flags |= IDP_PRESENT;
290
17.9k
    if (idp->onlyuser > 0) {
291
239
        idp_only++;
292
239
        crl->idp_flags |= IDP_ONLYUSER;
293
239
    }
294
17.9k
    if (idp->onlyCA > 0) {
295
1.87k
        idp_only++;
296
1.87k
        crl->idp_flags |= IDP_ONLYCA;
297
1.87k
    }
298
17.9k
    if (idp->onlyattr > 0) {
299
379
        idp_only++;
300
379
        crl->idp_flags |= IDP_ONLYATTR;
301
379
    }
302
303
17.9k
    if (idp_only > 1)
304
169
        crl->idp_flags |= IDP_INVALID;
305
306
17.9k
    if (idp->indirectCRL > 0)
307
128
        crl->idp_flags |= IDP_INDIRECT;
308
309
17.9k
    if (idp->onlysomereasons) {
310
1.85k
        crl->idp_flags |= IDP_REASONS;
311
1.85k
        if (idp->onlysomereasons->length > 0)
312
1.34k
            crl->idp_reasons = idp->onlysomereasons->data[0];
313
1.85k
        if (idp->onlysomereasons->length > 1)
314
1.03k
            crl->idp_reasons |= (idp->onlysomereasons->data[1] << 8);
315
1.85k
        crl->idp_reasons &= CRLDP_ALL_REASONS;
316
1.85k
    }
317
318
17.9k
    ret = DIST_POINT_set_dpname(idp->distpoint, X509_CRL_get_issuer(crl));
319
320
    /*
321
     * RFC5280 specifies that if onlyContainsUserCerts, onlyContainsCACerts,
322
     * indirectCRL, and OnlyContainsAttributeCerts are all FALSE, there must
323
     * be either a distributionPoint field or an onlySomeReasons field present.
324
     */
325
17.9k
    if (crl->idp_flags == IDP_PRESENT && idp->distpoint == NULL)
326
2.11k
        crl->idp_flags |= IDP_INVALID;
327
328
17.9k
    return ret;
329
17.9k
}
330
331
ASN1_SEQUENCE_ref(X509_CRL, crl_cb) = {
332
    ASN1_EMBED(X509_CRL, crl, X509_CRL_INFO),
333
    ASN1_EMBED(X509_CRL, sig_alg, X509_ALGOR),
334
    ASN1_EMBED(X509_CRL, signature, ASN1_BIT_STRING)
335
} ASN1_SEQUENCE_END_ref(X509_CRL, X509_CRL)
336
337
IMPLEMENT_ASN1_FUNCTIONS(X509_REVOKED)
338
339
IMPLEMENT_ASN1_DUP_FUNCTION(X509_REVOKED)
340
341
IMPLEMENT_ASN1_FUNCTIONS(X509_CRL_INFO)
342
343
IMPLEMENT_ASN1_FUNCTIONS(X509_CRL)
344
345
IMPLEMENT_ASN1_DUP_FUNCTION(X509_CRL)
346
347
static int X509_REVOKED_cmp(const X509_REVOKED *const *a,
348
    const X509_REVOKED *const *b)
349
24
{
350
24
    return (ASN1_STRING_cmp((ASN1_STRING *)&(*a)->serialNumber,
351
24
        (ASN1_STRING *)&(*b)->serialNumber));
352
24
}
353
354
X509_CRL *X509_CRL_new_ex(OSSL_LIB_CTX *libctx, const char *propq)
355
0
{
356
0
    X509_CRL *crl = NULL;
357
358
0
    crl = (X509_CRL *)ASN1_item_new((X509_CRL_it()));
359
0
    if (!ossl_x509_crl_set0_libctx(crl, libctx, propq)) {
360
0
        X509_CRL_free(crl);
361
0
        crl = NULL;
362
0
    }
363
0
    return crl;
364
0
}
365
366
int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev)
367
0
{
368
0
    X509_CRL_INFO *inf;
369
370
0
    inf = &crl->crl;
371
0
    if (inf->revoked == NULL)
372
0
        inf->revoked = sk_X509_REVOKED_new(X509_REVOKED_cmp);
373
0
    if (inf->revoked == NULL || !sk_X509_REVOKED_push(inf->revoked, rev)) {
374
0
        ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
375
0
        return 0;
376
0
    }
377
0
    inf->enc.modified = 1;
378
0
    return 1;
379
0
}
380
381
int X509_CRL_verify(X509_CRL *crl, EVP_PKEY *r)
382
2.92k
{
383
2.92k
    if (crl->meth->crl_verify)
384
2.92k
        return crl->meth->crl_verify(crl, r);
385
0
    return 0;
386
2.92k
}
387
388
int X509_CRL_get0_by_serial(X509_CRL *crl,
389
    X509_REVOKED **ret, const ASN1_INTEGER *serial)
390
0
{
391
0
    if (crl->meth->crl_lookup)
392
0
        return crl->meth->crl_lookup(crl, ret, serial, NULL);
393
0
    return 0;
394
0
}
395
396
int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x)
397
2.92k
{
398
2.92k
    if (crl->meth->crl_lookup)
399
2.92k
        return crl->meth->crl_lookup(crl, ret,
400
2.92k
            X509_get0_serialNumber(x),
401
2.92k
            X509_get_issuer_name(x));
402
0
    return 0;
403
2.92k
}
404
405
static int def_crl_verify(X509_CRL *crl, EVP_PKEY *r)
406
2.92k
{
407
2.92k
    if (X509_ALGOR_cmp(&crl->sig_alg, &crl->crl.sig_alg) != 0) {
408
1.33k
        ERR_raise(ERR_LIB_X509, X509_R_CRL_SIGNATURE_ALGORITHM_MISMATCH);
409
1.33k
        return 0;
410
1.33k
    }
411
1.58k
    return ASN1_item_verify_ex(ASN1_ITEM_rptr(X509_CRL_INFO),
412
1.58k
        &crl->sig_alg, &crl->signature, &crl->crl, NULL,
413
1.58k
        r, crl->libctx, crl->propq);
414
2.92k
}
415
416
static int crl_revoked_issuer_match(X509_CRL *crl, const X509_NAME *nm,
417
    X509_REVOKED *rev)
418
2
{
419
2
    int i;
420
421
2
    if (!rev->issuer) {
422
2
        if (!nm)
423
0
            return 1;
424
2
        if (!X509_NAME_cmp(nm, X509_CRL_get_issuer(crl)))
425
2
            return 1;
426
0
        return 0;
427
2
    }
428
429
0
    if (!nm)
430
0
        nm = X509_CRL_get_issuer(crl);
431
432
0
    for (i = 0; i < sk_GENERAL_NAME_num(rev->issuer); i++) {
433
0
        GENERAL_NAME *gen = sk_GENERAL_NAME_value(rev->issuer, i);
434
0
        if (gen->type != GEN_DIRNAME)
435
0
            continue;
436
0
        if (!X509_NAME_cmp(nm, gen->d.directoryName))
437
0
            return 1;
438
0
    }
439
0
    return 0;
440
0
}
441
442
static int def_crl_lookup(X509_CRL *crl,
443
    X509_REVOKED **ret, const ASN1_INTEGER *serial,
444
    const X509_NAME *issuer)
445
2.92k
{
446
2.92k
    X509_REVOKED rtmp, *rev;
447
2.92k
    int idx, num;
448
449
2.92k
    if (crl->crl.revoked == NULL)
450
2.88k
        return 0;
451
452
    /*
453
     * Sort revoked into serial number order if not already sorted. Do this
454
     * under a lock to avoid race condition.
455
     */
456
39
    if (!sk_X509_REVOKED_is_sorted(crl->crl.revoked)) {
457
36
        if (!CRYPTO_THREAD_write_lock(crl->lock))
458
0
            return 0;
459
36
        sk_X509_REVOKED_sort(crl->crl.revoked);
460
36
        CRYPTO_THREAD_unlock(crl->lock);
461
36
    }
462
39
    rtmp.serialNumber = *serial;
463
39
    idx = sk_X509_REVOKED_find(crl->crl.revoked, &rtmp);
464
39
    if (idx < 0)
465
37
        return 0;
466
    /* Need to look for matching name */
467
2
    for (num = sk_X509_REVOKED_num(crl->crl.revoked); idx < num; idx++) {
468
2
        rev = sk_X509_REVOKED_value(crl->crl.revoked, idx);
469
2
        if (ASN1_INTEGER_cmp(&rev->serialNumber, serial))
470
0
            return 0;
471
2
        if (crl_revoked_issuer_match(crl, issuer, rev)) {
472
2
            if (ret)
473
2
                *ret = rev;
474
2
            if (rev->reason == CRL_REASON_REMOVE_FROM_CRL)
475
0
                return 2;
476
2
            return 1;
477
2
        }
478
2
    }
479
0
    return 0;
480
2
}
481
482
void X509_CRL_set_default_method(const X509_CRL_METHOD *meth)
483
0
{
484
0
    if (meth == NULL)
485
0
        default_crl_method = &int_crl_meth;
486
0
    else
487
0
        default_crl_method = meth;
488
0
}
489
490
X509_CRL_METHOD *X509_CRL_METHOD_new(int (*crl_init)(X509_CRL *crl),
491
    int (*crl_free)(X509_CRL *crl),
492
    int (*crl_lookup)(X509_CRL *crl,
493
        X509_REVOKED **ret,
494
        const ASN1_INTEGER *ser,
495
        const X509_NAME *issuer),
496
    int (*crl_verify)(X509_CRL *crl,
497
        EVP_PKEY *pk))
498
0
{
499
0
    X509_CRL_METHOD *m = OPENSSL_malloc(sizeof(*m));
500
501
0
    if (m == NULL)
502
0
        return NULL;
503
0
    m->crl_init = crl_init;
504
0
    m->crl_free = crl_free;
505
0
    m->crl_lookup = crl_lookup;
506
0
    m->crl_verify = crl_verify;
507
0
    m->flags = X509_CRL_METHOD_DYNAMIC;
508
0
    return m;
509
0
}
510
511
void X509_CRL_METHOD_free(X509_CRL_METHOD *m)
512
0
{
513
0
    if (m == NULL || !(m->flags & X509_CRL_METHOD_DYNAMIC))
514
0
        return;
515
0
    OPENSSL_free(m);
516
0
}
517
518
void X509_CRL_set_meth_data(X509_CRL *crl, void *dat)
519
0
{
520
0
    crl->meth_data = dat;
521
0
}
522
523
void *X509_CRL_get_meth_data(X509_CRL *crl)
524
0
{
525
0
    return crl->meth_data;
526
0
}
527
528
int ossl_x509_crl_set0_libctx(X509_CRL *x, OSSL_LIB_CTX *libctx,
529
    const char *propq)
530
0
{
531
0
    if (x != NULL) {
532
0
        x->libctx = libctx;
533
0
        OPENSSL_free(x->propq);
534
0
        x->propq = NULL;
535
0
        if (propq != NULL) {
536
0
            x->propq = OPENSSL_strdup(propq);
537
0
            if (x->propq == NULL)
538
0
                return 0;
539
0
        }
540
0
    }
541
0
    return 1;
542
0
}