diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/x509/x509_txt.c | 129 |
1 files changed, 64 insertions, 65 deletions
diff --git a/src/lib/libcrypto/x509/x509_txt.c b/src/lib/libcrypto/x509/x509_txt.c index 8485aeb5d1..58c0566686 100644 --- a/src/lib/libcrypto/x509/x509_txt.c +++ b/src/lib/libcrypto/x509/x509_txt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_txt.c,v 1.22 2022/11/29 07:03:40 tb Exp $ */ | 1 | /* $OpenBSD: x509_txt.c,v 1.23 2022/11/29 07:06:12 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -72,132 +72,131 @@ X509_verify_cert_error_string(long n) | |||
72 | { | 72 | { |
73 | switch ((int)n) { | 73 | switch ((int)n) { |
74 | case X509_V_OK: | 74 | case X509_V_OK: |
75 | return("ok"); | 75 | return "ok"; |
76 | case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: | 76 | case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: |
77 | return("unable to get issuer certificate"); | 77 | return "unable to get issuer certificate"; |
78 | case X509_V_ERR_UNABLE_TO_GET_CRL: | 78 | case X509_V_ERR_UNABLE_TO_GET_CRL: |
79 | return("unable to get certificate CRL"); | 79 | return "unable to get certificate CRL"; |
80 | case X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: | 80 | case X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: |
81 | return("unable to decrypt certificate's signature"); | 81 | return "unable to decrypt certificate's signature"; |
82 | case X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE: | 82 | case X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE: |
83 | return("unable to decrypt CRL's signature"); | 83 | return "unable to decrypt CRL's signature"; |
84 | case X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: | 84 | case X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: |
85 | return("unable to decode issuer public key"); | 85 | return "unable to decode issuer public key"; |
86 | case X509_V_ERR_CERT_SIGNATURE_FAILURE: | 86 | case X509_V_ERR_CERT_SIGNATURE_FAILURE: |
87 | return("certificate signature failure"); | 87 | return "certificate signature failure"; |
88 | case X509_V_ERR_CRL_SIGNATURE_FAILURE: | 88 | case X509_V_ERR_CRL_SIGNATURE_FAILURE: |
89 | return("CRL signature failure"); | 89 | return "CRL signature failure"; |
90 | case X509_V_ERR_CERT_NOT_YET_VALID: | 90 | case X509_V_ERR_CERT_NOT_YET_VALID: |
91 | return("certificate is not yet valid"); | 91 | return "certificate is not yet valid"; |
92 | case X509_V_ERR_CRL_NOT_YET_VALID: | 92 | case X509_V_ERR_CRL_NOT_YET_VALID: |
93 | return("CRL is not yet valid"); | 93 | return "CRL is not yet valid"; |
94 | case X509_V_ERR_CERT_HAS_EXPIRED: | 94 | case X509_V_ERR_CERT_HAS_EXPIRED: |
95 | return("certificate has expired"); | 95 | return "certificate has expired"; |
96 | case X509_V_ERR_CRL_HAS_EXPIRED: | 96 | case X509_V_ERR_CRL_HAS_EXPIRED: |
97 | return("CRL has expired"); | 97 | return "CRL has expired"; |
98 | case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: | 98 | case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: |
99 | return("format error in certificate's notBefore field"); | 99 | return "format error in certificate's notBefore field"; |
100 | case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: | 100 | case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: |
101 | return("format error in certificate's notAfter field"); | 101 | return "format error in certificate's notAfter field"; |
102 | case X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD: | 102 | case X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD: |
103 | return("format error in CRL's lastUpdate field"); | 103 | return "format error in CRL's lastUpdate field"; |
104 | case X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: | 104 | case X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: |
105 | return("format error in CRL's nextUpdate field"); | 105 | return "format error in CRL's nextUpdate field"; |
106 | case X509_V_ERR_OUT_OF_MEM: | 106 | case X509_V_ERR_OUT_OF_MEM: |
107 | return("out of memory"); | 107 | return "out of memory"; |
108 | case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: | 108 | case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: |
109 | return("self signed certificate"); | 109 | return "self signed certificate"; |
110 | case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: | 110 | case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: |
111 | return("self signed certificate in certificate chain"); | 111 | return "self signed certificate in certificate chain"; |
112 | case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: | 112 | case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: |
113 | return("unable to get local issuer certificate"); | 113 | return "unable to get local issuer certificate"; |
114 | case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: | 114 | case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: |
115 | return("unable to verify the first certificate"); | 115 | return "unable to verify the first certificate"; |
116 | case X509_V_ERR_CERT_CHAIN_TOO_LONG: | 116 | case X509_V_ERR_CERT_CHAIN_TOO_LONG: |
117 | return("certificate chain too long"); | 117 | return "certificate chain too long"; |
118 | case X509_V_ERR_CERT_REVOKED: | 118 | case X509_V_ERR_CERT_REVOKED: |
119 | return("certificate revoked"); | 119 | return "certificate revoked"; |
120 | case X509_V_ERR_INVALID_CA: | 120 | case X509_V_ERR_INVALID_CA: |
121 | return ("invalid CA certificate"); | 121 | return "invalid CA certificate"; |
122 | case X509_V_ERR_INVALID_NON_CA: | 122 | case X509_V_ERR_INVALID_NON_CA: |
123 | return ("invalid non-CA certificate (has CA markings)"); | 123 | return "invalid non-CA certificate (has CA markings)"; |
124 | case X509_V_ERR_PATH_LENGTH_EXCEEDED: | 124 | case X509_V_ERR_PATH_LENGTH_EXCEEDED: |
125 | return ("path length constraint exceeded"); | 125 | return "path length constraint exceeded"; |
126 | case X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED: | 126 | case X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED: |
127 | return("proxy path length constraint exceeded"); | 127 | return "proxy path length constraint exceeded"; |
128 | case X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED: | 128 | case X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED: |
129 | return("proxy certificates not allowed, please set the appropriate flag"); | 129 | return "proxy certificates not allowed, please set the appropriate flag"; |
130 | case X509_V_ERR_INVALID_PURPOSE: | 130 | case X509_V_ERR_INVALID_PURPOSE: |
131 | return ("unsupported certificate purpose"); | 131 | return "unsupported certificate purpose"; |
132 | case X509_V_ERR_CERT_UNTRUSTED: | 132 | case X509_V_ERR_CERT_UNTRUSTED: |
133 | return ("certificate not trusted"); | 133 | return "certificate not trusted"; |
134 | case X509_V_ERR_CERT_REJECTED: | 134 | case X509_V_ERR_CERT_REJECTED: |
135 | return ("certificate rejected"); | 135 | return "certificate rejected"; |
136 | case X509_V_ERR_APPLICATION_VERIFICATION: | 136 | case X509_V_ERR_APPLICATION_VERIFICATION: |
137 | return("application verification failure"); | 137 | return "application verification failure"; |
138 | case X509_V_ERR_SUBJECT_ISSUER_MISMATCH: | 138 | case X509_V_ERR_SUBJECT_ISSUER_MISMATCH: |
139 | return("subject issuer mismatch"); | 139 | return "subject issuer mismatch"; |
140 | case X509_V_ERR_AKID_SKID_MISMATCH: | 140 | case X509_V_ERR_AKID_SKID_MISMATCH: |
141 | return("authority and subject key identifier mismatch"); | 141 | return "authority and subject key identifier mismatch"; |
142 | case X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH: | 142 | case X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH: |
143 | return("authority and issuer serial number mismatch"); | 143 | return "authority and issuer serial number mismatch"; |
144 | case X509_V_ERR_KEYUSAGE_NO_CERTSIGN: | 144 | case X509_V_ERR_KEYUSAGE_NO_CERTSIGN: |
145 | return("key usage does not include certificate signing"); | 145 | return "key usage does not include certificate signing"; |
146 | case X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER: | 146 | case X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER: |
147 | return("unable to get CRL issuer certificate"); | 147 | return "unable to get CRL issuer certificate"; |
148 | case X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION: | 148 | case X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION: |
149 | return("unhandled critical extension"); | 149 | return "unhandled critical extension"; |
150 | case X509_V_ERR_KEYUSAGE_NO_CRL_SIGN: | 150 | case X509_V_ERR_KEYUSAGE_NO_CRL_SIGN: |
151 | return("key usage does not include CRL signing"); | 151 | return "key usage does not include CRL signing"; |
152 | case X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE: | 152 | case X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE: |
153 | return("key usage does not include digital signature"); | 153 | return "key usage does not include digital signature"; |
154 | case X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION: | 154 | case X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION: |
155 | return("unhandled critical CRL extension"); | 155 | return "unhandled critical CRL extension"; |
156 | case X509_V_ERR_INVALID_EXTENSION: | 156 | case X509_V_ERR_INVALID_EXTENSION: |
157 | return("invalid or inconsistent certificate extension"); | 157 | return "invalid or inconsistent certificate extension"; |
158 | case X509_V_ERR_INVALID_POLICY_EXTENSION: | 158 | case X509_V_ERR_INVALID_POLICY_EXTENSION: |
159 | return("invalid or inconsistent certificate policy extension"); | 159 | return "invalid or inconsistent certificate policy extension"; |
160 | case X509_V_ERR_NO_EXPLICIT_POLICY: | 160 | case X509_V_ERR_NO_EXPLICIT_POLICY: |
161 | return("no explicit policy"); | 161 | return "no explicit policy"; |
162 | case X509_V_ERR_DIFFERENT_CRL_SCOPE: | 162 | case X509_V_ERR_DIFFERENT_CRL_SCOPE: |
163 | return("Different CRL scope"); | 163 | return "Different CRL scope"; |
164 | case X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE: | 164 | case X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE: |
165 | return("Unsupported extension feature"); | 165 | return "Unsupported extension feature"; |
166 | case X509_V_ERR_UNNESTED_RESOURCE: | 166 | case X509_V_ERR_UNNESTED_RESOURCE: |
167 | return("RFC 3779 resource not subset of parent's resources"); | 167 | return "RFC 3779 resource not subset of parent's resources"; |
168 | case X509_V_ERR_PERMITTED_VIOLATION: | 168 | case X509_V_ERR_PERMITTED_VIOLATION: |
169 | return("permitted subtree violation"); | 169 | return "permitted subtree violation"; |
170 | case X509_V_ERR_EXCLUDED_VIOLATION: | 170 | case X509_V_ERR_EXCLUDED_VIOLATION: |
171 | return("excluded subtree violation"); | 171 | return "excluded subtree violation"; |
172 | case X509_V_ERR_SUBTREE_MINMAX: | 172 | case X509_V_ERR_SUBTREE_MINMAX: |
173 | return("name constraints minimum and maximum not supported"); | 173 | return "name constraints minimum and maximum not supported"; |
174 | case X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE: | 174 | case X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE: |
175 | return("unsupported name constraint type"); | 175 | return "unsupported name constraint type"; |
176 | case X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX: | 176 | case X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX: |
177 | return("unsupported or invalid name constraint syntax"); | 177 | return "unsupported or invalid name constraint syntax"; |
178 | case X509_V_ERR_UNSUPPORTED_NAME_SYNTAX: | 178 | case X509_V_ERR_UNSUPPORTED_NAME_SYNTAX: |
179 | return("unsupported or invalid name syntax"); | 179 | return "unsupported or invalid name syntax"; |
180 | case X509_V_ERR_CRL_PATH_VALIDATION_ERROR: | 180 | case X509_V_ERR_CRL_PATH_VALIDATION_ERROR: |
181 | return("CRL path validation error"); | 181 | return "CRL path validation error"; |
182 | case X509_V_ERR_HOSTNAME_MISMATCH: | 182 | case X509_V_ERR_HOSTNAME_MISMATCH: |
183 | return("Hostname mismatch"); | 183 | return "Hostname mismatch"; |
184 | case X509_V_ERR_EMAIL_MISMATCH: | 184 | case X509_V_ERR_EMAIL_MISMATCH: |
185 | return("Email address mismatch"); | 185 | return "Email address mismatch"; |
186 | case X509_V_ERR_IP_ADDRESS_MISMATCH: | 186 | case X509_V_ERR_IP_ADDRESS_MISMATCH: |
187 | return("IP address mismatch"); | 187 | return "IP address mismatch"; |
188 | case X509_V_ERR_INVALID_CALL: | 188 | case X509_V_ERR_INVALID_CALL: |
189 | return("Invalid certificate verification context"); | 189 | return "Invalid certificate verification context"; |
190 | case X509_V_ERR_STORE_LOOKUP: | 190 | case X509_V_ERR_STORE_LOOKUP: |
191 | return("Issuer certificate lookup error"); | 191 | return "Issuer certificate lookup error"; |
192 | case X509_V_ERR_EE_KEY_TOO_SMALL: | 192 | case X509_V_ERR_EE_KEY_TOO_SMALL: |
193 | return("EE certificate key too weak"); | 193 | return "EE certificate key too weak"; |
194 | case X509_V_ERR_CA_KEY_TOO_SMALL: | 194 | case X509_V_ERR_CA_KEY_TOO_SMALL: |
195 | return("CA certificate key too weak"); | 195 | return "CA certificate key too weak"; |
196 | case X509_V_ERR_CA_MD_TOO_WEAK: | 196 | case X509_V_ERR_CA_MD_TOO_WEAK: |
197 | return("CA signature digest algorithm too weak"); | 197 | return "CA signature digest algorithm too weak"; |
198 | |||
199 | default: | 198 | default: |
200 | return("Unknown certificate verification error"); | 199 | return "Unknown certificate verification error"; |
201 | } | 200 | } |
202 | } | 201 | } |
203 | LCRYPTO_ALIAS(X509_verify_cert_error_string) | 202 | LCRYPTO_ALIAS(X509_verify_cert_error_string) |