Coverage Report

Created: 2025-12-10 06:24

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl/crypto/cms/cms_err.c
Line
Count
Source
1
/*
2
 * Generated by util/mkerr.pl DO NOT EDIT
3
 * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
4
 *
5
 * Licensed under the Apache License 2.0 (the "License").  You may not use
6
 * this file except in compliance with the License.  You can obtain a copy
7
 * in the file LICENSE in the source distribution or at
8
 * https://www.openssl.org/source/license.html
9
 */
10
11
#include <openssl/err.h>
12
#include <openssl/cmserr.h>
13
#include "crypto/cmserr.h"
14
15
#ifndef OPENSSL_NO_CMS
16
17
#ifndef OPENSSL_NO_ERR
18
19
static const ERR_STRING_DATA CMS_str_reasons[] = {
20
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_ADD_SIGNER_ERROR), "add signer error" },
21
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_ATTRIBUTE_ERROR), "attribute error" },
22
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CERTIFICATE_ALREADY_PRESENT),
23
        "certificate already present" },
24
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CERTIFICATE_HAS_NO_KEYID),
25
        "certificate has no keyid" },
26
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CERTIFICATE_VERIFY_ERROR),
27
        "certificate verify error" },
28
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CIPHER_AEAD_IN_ENVELOPED_DATA),
29
        "cipher aead in enveloped data" },
30
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CIPHER_AEAD_SET_TAG_ERROR),
31
        "cipher aead set tag error" },
32
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CIPHER_GET_TAG), "cipher get tag" },
33
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CIPHER_INITIALISATION_ERROR),
34
        "cipher initialisation error" },
35
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR),
36
        "cipher parameter initialisation error" },
37
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CMS_DATAFINAL_ERROR),
38
        "cms datafinal error" },
39
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CMS_LIB), "cms lib" },
40
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CONTENTIDENTIFIER_MISMATCH),
41
        "contentidentifier mismatch" },
42
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CONTENT_NOT_FOUND), "content not found" },
43
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CONTENT_TYPE_MISMATCH),
44
        "content type mismatch" },
45
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA),
46
        "content type not compressed data" },
47
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA),
48
        "content type not enveloped data" },
49
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA),
50
        "content type not signed data" },
51
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CONTENT_VERIFY_ERROR),
52
        "content verify error" },
53
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CTRL_ERROR), "ctrl error" },
54
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CTRL_FAILURE), "ctrl failure" },
55
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_DECODE_ERROR), "decode error" },
56
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_DECRYPT_ERROR), "decrypt error" },
57
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_ERROR_GETTING_PUBLIC_KEY),
58
        "error getting public key" },
59
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE),
60
        "error reading messagedigest attribute" },
61
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_ERROR_SETTING_KEY), "error setting key" },
62
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_ERROR_SETTING_RECIPIENTINFO),
63
        "error setting recipientinfo" },
64
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_ERROR_UNSUPPORTED_STATIC_KEY_AGREEMENT),
65
        "error unsupported static key agreement" },
66
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_ESS_SIGNING_CERTID_MISMATCH_ERROR),
67
        "ess signing certid mismatch error" },
68
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_INVALID_ENCRYPTED_KEY_LENGTH),
69
        "invalid encrypted key length" },
70
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER),
71
        "invalid key encryption parameter" },
72
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_INVALID_KEY_LENGTH), "invalid key length" },
73
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_INVALID_LABEL), "invalid label" },
74
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_INVALID_OAEP_PARAMETERS),
75
        "invalid oaep parameters" },
76
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_KDF_PARAMETER_ERROR),
77
        "kdf parameter error" },
78
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_MD_BIO_INIT_ERROR), "md bio init error" },
79
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH),
80
        "messagedigest attribute wrong length" },
81
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_MESSAGEDIGEST_WRONG_LENGTH),
82
        "messagedigest wrong length" },
83
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_MSGSIGDIGEST_ERROR), "msgsigdigest error" },
84
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE),
85
        "msgsigdigest verification failure" },
86
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_MSGSIGDIGEST_WRONG_LENGTH),
87
        "msgsigdigest wrong length" },
88
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NEED_ONE_SIGNER), "need one signer" },
89
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NOT_A_SIGNED_RECEIPT),
90
        "not a signed receipt" },
91
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NOT_ENCRYPTED_DATA), "not encrypted data" },
92
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NOT_KEK), "not kek" },
93
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NOT_KEM), "not kem" },
94
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NOT_KEY_AGREEMENT), "not key agreement" },
95
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NOT_KEY_TRANSPORT), "not key transport" },
96
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NOT_PWRI), "not pwri" },
97
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE),
98
        "not supported for this key type" },
99
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_CIPHER), "no cipher" },
100
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_CONTENT), "no content" },
101
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_CONTENT_TYPE), "no content type" },
102
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_DEFAULT_DIGEST), "no default digest" },
103
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_DIGEST_SET), "no digest set" },
104
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_KEY), "no key" },
105
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_KEY_OR_CERT), "no key or cert" },
106
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_MATCHING_DIGEST), "no matching digest" },
107
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_MATCHING_RECIPIENT),
108
        "no matching recipient" },
109
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_MATCHING_SIGNATURE),
110
        "no matching signature" },
111
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_MSGSIGDIGEST), "no msgsigdigest" },
112
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_PASSWORD), "no password" },
113
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_PRIVATE_KEY), "no private key" },
114
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_PUBLIC_KEY), "no public key" },
115
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_RECEIPT_REQUEST), "no receipt request" },
116
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_SIGNERS), "no signers" },
117
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_OPERATION_UNSUPPORTED),
118
        "operation unsupported" },
119
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_PEER_KEY_ERROR), "peer key error" },
120
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE),
121
        "private key does not match certificate" },
122
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_RECEIPT_DECODE_ERROR),
123
        "receipt decode error" },
124
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_RECIPIENT_ERROR), "recipient error" },
125
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_SHARED_INFO_ERROR), "shared info error" },
126
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_SIGNER_CERTIFICATE_NOT_FOUND),
127
        "signer certificate not found" },
128
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_SIGNFINAL_ERROR), "signfinal error" },
129
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_SMIME_TEXT_ERROR), "smime text error" },
130
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_STORE_INIT_ERROR), "store init error" },
131
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_TYPE_NOT_COMPRESSED_DATA),
132
        "type not compressed data" },
133
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_TYPE_NOT_DATA), "type not data" },
134
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_TYPE_NOT_DIGESTED_DATA),
135
        "type not digested data" },
136
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_TYPE_NOT_ENCRYPTED_DATA),
137
        "type not encrypted data" },
138
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_TYPE_NOT_ENVELOPED_DATA),
139
        "type not enveloped data" },
140
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNABLE_TO_FINALIZE_CONTEXT),
141
        "unable to finalize context" },
142
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNKNOWN_CIPHER), "unknown cipher" },
143
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNKNOWN_DIGEST_ALGORITHM),
144
        "unknown digest algorithm" },
145
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNKNOWN_ID), "unknown id" },
146
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNKNOWN_KDF_ALGORITHM),
147
        "unknown kdf algorithm" },
148
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM),
149
        "unsupported compression algorithm" },
150
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM),
151
        "unsupported content encryption algorithm" },
152
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_CONTENT_TYPE),
153
        "unsupported content type" },
154
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_ENCRYPTION_TYPE),
155
        "unsupported encryption type" },
156
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_KDF_ALGORITHM),
157
        "unsupported kdf algorithm" },
158
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_KEK_ALGORITHM),
159
        "unsupported kek algorithm" },
160
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM),
161
        "unsupported key encryption algorithm" },
162
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_LABEL_SOURCE),
163
        "unsupported label source" },
164
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE),
165
        "unsupported recipientinfo type" },
166
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_RECIPIENT_TYPE),
167
        "unsupported recipient type" },
168
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_SIGNATURE_ALGORITHM),
169
        "unsupported signature algorithm" },
170
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_TYPE), "unsupported type" },
171
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNWRAP_ERROR), "unwrap error" },
172
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNWRAP_FAILURE), "unwrap failure" },
173
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_VERIFICATION_FAILURE),
174
        "verification failure" },
175
    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_WRAP_ERROR), "wrap error" },
176
    { 0, NULL }
177
};
178
179
#endif
180
181
int ossl_err_load_CMS_strings(void)
182
3
{
183
3
#ifndef OPENSSL_NO_ERR
184
3
    if (ERR_reason_error_string(CMS_str_reasons[0].error) == NULL)
185
3
        ERR_load_strings_const(CMS_str_reasons);
186
3
#endif
187
3
    return 1;
188
3
}
189
#else
190
NON_EMPTY_TRANSLATION_UNIT
191
#endif