Coverage Report

Created: 2026-09-12 06:55

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl41/providers/implementations/encode_decode/decode_pem2der.inc
Line
Count
Source
1
/*
2
 * Copyright 2025 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
11
12
/* Machine generated by util/perl/OpenSSL/paramnames.pm */
13
#include <string.h>
14
#include <openssl/params.h>
15
#include <openssl/e_os2.h>
16
#include "internal/common.h"
17
#include "prov/proverr.h"
18
19
/* Machine generated */
20
#ifndef pem2der_set_ctx_params_list
21
static ossl_unused const OSSL_PARAM pem2der_set_ctx_params_list[] = {
22
    OSSL_PARAM_utf8_string(OSSL_DECODER_PARAM_PROPERTIES, NULL, 0),
23
    OSSL_PARAM_utf8_string(OSSL_OBJECT_PARAM_DATA_STRUCTURE, NULL, 0),
24
    OSSL_PARAM_END
25
};
26
#endif
27
28
#ifndef pem2der_set_ctx_params_st
29
struct pem2der_set_ctx_params_st {
30
    OSSL_PARAM *ds;
31
    OSSL_PARAM *propq;
32
};
33
#endif
34
35
#ifndef pem2der_set_ctx_params_decoder
36
static ossl_unused int pem2der_set_ctx_params_decoder
37
    (const OSSL_PARAM *p, struct pem2der_set_ctx_params_st *r)
38
1.58k
{
39
1.58k
    const char *s;
40
41
1.58k
    memset(r, 0, sizeof(*r));
42
1.58k
    if (p != NULL)
43
3.16k
        for (; (s = p->key) != NULL; p++)
44
1.58k
            switch(s[0]) {
45
0
            default:
46
0
                break;
47
1.58k
            case 'd':
48
1.58k
                if (ossl_likely(strcmp("ata-structure", s + 1) == 0)) {
49
                    /* OSSL_OBJECT_PARAM_DATA_STRUCTURE */
50
1.58k
                    if (ossl_unlikely(r->ds != NULL)) {
51
0
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
52
0
                                       "param %s is repeated", s);
53
0
                        return 0;
54
0
                    }
55
1.58k
                    r->ds = (OSSL_PARAM *)p;
56
1.58k
                }
57
1.58k
                break;
58
1.58k
            case 'p':
59
0
                if (ossl_likely(strcmp("roperties", s + 1) == 0)) {
60
                    /* OSSL_DECODER_PARAM_PROPERTIES */
61
0
                    if (ossl_unlikely(r->propq != NULL)) {
62
0
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
63
0
                                       "param %s is repeated", s);
64
0
                        return 0;
65
0
                    }
66
0
                    r->propq = (OSSL_PARAM *)p;
67
0
                }
68
1.58k
            }
69
1.58k
    return 1;
70
1.58k
}
71
#endif
72
/* End of machine generated */