Coverage Report

Created: 2026-05-30 06:06

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