diff options
author | schwarze <> | 2016-11-04 15:29:03 +0000 |
---|---|---|
committer | schwarze <> | 2016-11-04 15:29:03 +0000 |
commit | e23d00ab37299e14c06d5d2b599a3793e3d0575c (patch) | |
tree | f91172cf4f459119421ea45c97eb6fa4aec563bc /src/lib/libcrypto/man/X509_STORE_CTX_get_error.3 | |
parent | f34ab28d6356aae4d0458dd2076438a042314790 (diff) | |
download | openbsd-e23d00ab37299e14c06d5d2b599a3793e3d0575c.tar.gz openbsd-e23d00ab37299e14c06d5d2b599a3793e3d0575c.tar.bz2 openbsd-e23d00ab37299e14c06d5d2b599a3793e3d0575c.zip |
convert X509 manuals from pod to mdoc
Diffstat (limited to 'src/lib/libcrypto/man/X509_STORE_CTX_get_error.3')
-rw-r--r-- | src/lib/libcrypto/man/X509_STORE_CTX_get_error.3 | 297 |
1 files changed, 297 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/X509_STORE_CTX_get_error.3 b/src/lib/libcrypto/man/X509_STORE_CTX_get_error.3 new file mode 100644 index 0000000000..f31e438cde --- /dev/null +++ b/src/lib/libcrypto/man/X509_STORE_CTX_get_error.3 | |||
@@ -0,0 +1,297 @@ | |||
1 | .Dd $Mdocdate: November 4 2016 $ | ||
2 | .Dt X509_STORE_CTX_GET_ERROR 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm X509_STORE_CTX_get_error , | ||
6 | .Nm X509_STORE_CTX_set_error , | ||
7 | .Nm X509_STORE_CTX_get_error_depth , | ||
8 | .Nm X509_STORE_CTX_get_current_cert , | ||
9 | .Nm X509_STORE_CTX_get1_chain , | ||
10 | .Nm X509_verify_cert_error_string | ||
11 | .Nd get or set certificate verification status information | ||
12 | .Sh SYNOPSIS | ||
13 | .In openssl/x509.h | ||
14 | .In openssl/x509_vfy.h | ||
15 | .Ft int | ||
16 | .Fo X509_STORE_CTX_get_error | ||
17 | .Fa "X509_STORE_CTX *ctx" | ||
18 | .Fc | ||
19 | .Ft void | ||
20 | .Fo X509_STORE_CTX_set_error | ||
21 | .Fa "X509_STORE_CTX *ctx" | ||
22 | .Fa "int s" | ||
23 | .Fc | ||
24 | .Ft int | ||
25 | .Fo X509_STORE_CTX_get_error_depth | ||
26 | .Fa "X509_STORE_CTX *ctx" | ||
27 | .Fc | ||
28 | .Ft X509 * | ||
29 | .Fo X509_STORE_CTX_get_current_cert | ||
30 | .Fa "X509_STORE_CTX *ctx" | ||
31 | .Fc | ||
32 | .Ft STACK_OF(X509) * | ||
33 | .Fo X509_STORE_CTX_get1_chain | ||
34 | .Fa "X509_STORE_CTX *ctx" | ||
35 | .Fc | ||
36 | .Ft const char * | ||
37 | .Fo X509_verify_cert_error_string | ||
38 | .Fa "long n" | ||
39 | .Fc | ||
40 | .Sh DESCRIPTION | ||
41 | These functions are typically called after | ||
42 | .Xr X509_verify_cert 3 | ||
43 | has indicated an error or in a verification callback to determine the | ||
44 | nature of an error. | ||
45 | .Pp | ||
46 | .Fn X509_STORE_CTX_get_error | ||
47 | returns the error code of | ||
48 | .Fa ctx . | ||
49 | See the | ||
50 | .Sy ERROR CODES | ||
51 | section for a full description of all error codes. | ||
52 | .Pp | ||
53 | .Fn X509_STORE_CTX_set_error | ||
54 | sets the error code of | ||
55 | .Fa ctx | ||
56 | to | ||
57 | .Fa s . | ||
58 | For example it might be used in a verification callback to set an error | ||
59 | based on additional checks. | ||
60 | .Pp | ||
61 | .Fn X509_STORE_CTX_get_error_depth | ||
62 | returns the depth of the error. | ||
63 | This is a non-negative integer representing where in the certificate | ||
64 | chain the error occurred. | ||
65 | If it is zero, it occurred in the end entity certificate, one if it is | ||
66 | the certificate which signed the end entity certificate, and so on. | ||
67 | .Pp | ||
68 | .Fn X509_STORE_CTX_get_current_cert | ||
69 | returns the certificate in | ||
70 | .Fa ctx | ||
71 | which caused the error or | ||
72 | .Dv NULL | ||
73 | if no certificate is relevant. | ||
74 | .Pp | ||
75 | .Fn X509_STORE_CTX_get1_chain | ||
76 | returns a complete validate chain if a previous call to | ||
77 | .Xr X509_verify_cert 3 | ||
78 | is successful. | ||
79 | If the call to | ||
80 | .Xr X509_verify_cert 3 | ||
81 | is | ||
82 | .Sy not | ||
83 | successful, the returned chain may be incomplete or invalid. | ||
84 | The returned chain persists after the | ||
85 | .Fa ctx | ||
86 | structure is freed. | ||
87 | When it is no longer needed, it should be free up using | ||
88 | .Fn sk_X509_pop_free chain X509_free . | ||
89 | .Pp | ||
90 | .Fn X509_verify_cert_error_string | ||
91 | returns a human readable error string for verification error | ||
92 | .Fa n . | ||
93 | .Pp | ||
94 | The above functions should be used instead of directly referencing the | ||
95 | fields in the | ||
96 | .Sy X509_VERIFY_CTX | ||
97 | structure. | ||
98 | .Pp | ||
99 | In versions of OpenSSL before 1.0, the current certificate returned by | ||
100 | .Fn X509_STORE_CTX_get_current_cert | ||
101 | was never | ||
102 | .Dv NULL . | ||
103 | Applications should check the return value before printing out any | ||
104 | debugging information relating to the current certificate. | ||
105 | .Pp | ||
106 | If an unrecognised error code is passed to | ||
107 | .Fn X509_verify_cert_error_string , | ||
108 | the numerical value of the unknown code is returned in a static buffer. | ||
109 | This is not thread safe but will never happen unless an invalid code is | ||
110 | passed. | ||
111 | .Sh RETURN VALUES | ||
112 | .Fn X509_STORE_CTX_get_error | ||
113 | returns | ||
114 | .Dv X509_V_OK | ||
115 | or an error code. | ||
116 | .Pp | ||
117 | .Fn X509_STORE_CTX_get_error_depth | ||
118 | returns a non-negative error depth. | ||
119 | .Pp | ||
120 | .Fn X509_STORE_CTX_get_current_cert | ||
121 | returns the certificate which caused the error or | ||
122 | .Dv NULL | ||
123 | if no certificate is relevant to the error. | ||
124 | .Pp | ||
125 | .Fn X509_verify_cert_error_string | ||
126 | returns a human readable error string for verification error | ||
127 | .Fa n . | ||
128 | .Sh ERROR CODES | ||
129 | A list of error codes and messages is shown below. | ||
130 | Some of the error codes are defined but currently never returned: | ||
131 | these are described as "unused". | ||
132 | .Bl -tag -width Ds | ||
133 | .It Dv X509_V_OK : No ok | ||
134 | The operation was successful. | ||
135 | .It Dv X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT : \ | ||
136 | No unable to get issuer certificate | ||
137 | The issuer certificate could not be found: this occurs if the issuer | ||
138 | certificate of an untrusted certificate cannot be found. | ||
139 | .It Dv X509_V_ERR_UNABLE_TO_GET_CRL : No unable to get certificate CRL | ||
140 | The CRL of a certificate could not be found. | ||
141 | .It Dv X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE : \ | ||
142 | No unable to decrypt certificate's signature | ||
143 | The certificate signature could not be decrypted. | ||
144 | This means that the actual signature value could not be determined | ||
145 | rather than it not matching the expected value, this is only meaningful | ||
146 | for RSA keys. | ||
147 | .It Dv X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE : \ | ||
148 | No unable to decrypt CRL's signature | ||
149 | The CRL signature could not be decrypted: this means that the actual | ||
150 | signature value could not be determined rather than it not matching the | ||
151 | expected value. | ||
152 | Unused. | ||
153 | .It Dv X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY : \ | ||
154 | No unable to decode issuer public key | ||
155 | The public key in the certificate SubjectPublicKeyInfo could not be read. | ||
156 | .It Dv X509_V_ERR_CERT_SIGNATURE_FAILURE : No certificate signature failure | ||
157 | The signature of the certificate is invalid. | ||
158 | .It Dv X509_V_ERR_CRL_SIGNATURE_FAILURE : No CRL signature failure | ||
159 | The signature of the certificate is invalid. | ||
160 | .It Dv X509_V_ERR_CERT_NOT_YET_VALID : No certificate is not yet valid | ||
161 | The certificate is not yet valid: the notBefore date is after the | ||
162 | current time. | ||
163 | .It Dv X509_V_ERR_CERT_HAS_EXPIRED : No certificate has expired | ||
164 | The certificate has expired: that is the notAfter date is before the | ||
165 | current time. | ||
166 | .It Dv X509_V_ERR_CRL_NOT_YET_VALID : No CRL is not yet valid | ||
167 | The CRL is not yet valid. | ||
168 | .It Dv X509_V_ERR_CRL_HAS_EXPIRED : No CRL has expired | ||
169 | The CRL has expired. | ||
170 | .It Dv X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD : \ | ||
171 | No format error in certificate's notBefore field | ||
172 | The certificate notBefore field contains an invalid time. | ||
173 | .It Dv X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD : \ | ||
174 | No format error in certificate's notAfter field | ||
175 | The certificate notAfter field contains an invalid time. | ||
176 | .It Dv X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD : \ | ||
177 | No format error in CRL's lastUpdate field | ||
178 | The CRL lastUpdate field contains an invalid time. | ||
179 | .It Dv X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD : \ | ||
180 | No format error in CRL's nextUpdate field | ||
181 | The CRL nextUpdate field contains an invalid time. | ||
182 | .It Dv X509_V_ERR_OUT_OF_MEM : No out of memory | ||
183 | An error occurred trying to allocate memory. | ||
184 | This should never happen. | ||
185 | .It Dv X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT : No self signed certificate | ||
186 | The passed certificate is self signed and the same certificate cannot be | ||
187 | found in the list of trusted certificates. | ||
188 | .It Dv X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN : \ | ||
189 | No self signed certificate in certificate chain | ||
190 | The certificate chain could be built up using the untrusted certificates | ||
191 | but the root could not be found locally. | ||
192 | .It Dv X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY : \ | ||
193 | No unable to get local issuer certificate | ||
194 | The issuer certificate of a locally looked up certificate could not be found. | ||
195 | This normally means the list of trusted certificates is not complete. | ||
196 | .It Dv X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE : \ | ||
197 | No unable to verify the first certificate | ||
198 | No signatures could be verified because the chain contains only one | ||
199 | certificate and it is not self signed. | ||
200 | .It Dv X509_V_ERR_CERT_CHAIN_TOO_LONG : No certificate chain too long | ||
201 | The certificate chain length is greater than the supplied maximum depth. | ||
202 | Unused. | ||
203 | .It Dv X509_V_ERR_CERT_REVOKED : No certificate revoked | ||
204 | The certificate has been revoked. | ||
205 | .It Dv X509_V_ERR_INVALID_CA : No invalid CA certificate | ||
206 | A CA certificate is invalid. | ||
207 | Either it is not a CA or its extensions are not consistent with the | ||
208 | supplied purpose. | ||
209 | .It Dv X509_V_ERR_PATH_LENGTH_EXCEEDED : No path length constraint exceeded | ||
210 | The basicConstraints pathlength parameter has been exceeded. | ||
211 | .It Dv X509_V_ERR_INVALID_PURPOSE : No unsupported certificate purpose | ||
212 | The supplied certificate cannot be used for the specified purpose. | ||
213 | .It Dv X509_V_ERR_CERT_UNTRUSTED : No certificate not trusted | ||
214 | The root CA is not marked as trusted for the specified purpose. | ||
215 | .It Dv X509_V_ERR_CERT_REJECTED : No certificate rejected | ||
216 | The root CA is marked to reject the specified purpose. | ||
217 | .It Dv X509_V_ERR_SUBJECT_ISSUER_MISMATCH : No subject issuer mismatch | ||
218 | The current candidate issuer certificate was rejected because its | ||
219 | subject name did not match the issuer name of the current certificate. | ||
220 | This is only set if issuer check debugging is enabled it is used for | ||
221 | status notification and is | ||
222 | .Sy not | ||
223 | in itself an error. | ||
224 | .It Dv X509_V_ERR_AKID_SKID_MISMATCH : \ | ||
225 | No authority and subject key identifier mismatch | ||
226 | The current candidate issuer certificate was rejected because its | ||
227 | subject key identifier was present and did not match the authority key | ||
228 | identifier current certificate. | ||
229 | This is only set if issuer check debugging is enabled it is used for | ||
230 | status notification and is | ||
231 | .Sy not | ||
232 | in itself an error. | ||
233 | .It Dv X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH : \ | ||
234 | Noauthority and issuer serial number mismatch | ||
235 | The current candidate issuer certificate was rejected because its issuer | ||
236 | name and serial number was present and did not match the authority key | ||
237 | identifier of the current certificate. | ||
238 | This is only set if issuer check debugging is enabled it is used for | ||
239 | status notification and is | ||
240 | .Sy not | ||
241 | in itself an error. | ||
242 | .It Dv X509_V_ERR_KEYUSAGE_NO_CERTSIGN : \ | ||
243 | No key usage does not include certificate signing | ||
244 | The current candidate issuer certificate was rejected because its | ||
245 | keyUsage extension does not permit certificate signing. | ||
246 | This is only set if issuer check debugging is enabled it is used for | ||
247 | status notification and is | ||
248 | .Sy not | ||
249 | in itself an error. | ||
250 | .It Dv X509_V_ERR_INVALID_EXTENSION : \ | ||
251 | No invalid or inconsistent certificate extension | ||
252 | A certificate extension had an invalid value (for example an incorrect | ||
253 | encoding) or some value inconsistent with other extensions. | ||
254 | .It Dv X509_V_ERR_INVALID_POLICY_EXTENSION : \ | ||
255 | No invalid or inconsistent certificate policy extension | ||
256 | A certificate policies extension had an invalid value (for example an | ||
257 | incorrect encoding) or some value inconsistent with other extensions. | ||
258 | This error only occurs if policy processing is enabled. | ||
259 | .It Dv X509_V_ERR_NO_EXPLICIT_POLICY : No no explicit policy | ||
260 | The verification flags were set to require and explicit policy but none | ||
261 | was present. | ||
262 | .It Dv X509_V_ERR_DIFFERENT_CRL_SCOPE : No different CRL scope | ||
263 | The only CRLs that could be found did not match the scope of the | ||
264 | certificate. | ||
265 | .It Dv X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE : \ | ||
266 | No unsupported extension feature | ||
267 | Some feature of a certificate extension is not supported. | ||
268 | Unused. | ||
269 | .It Dv X509_V_ERR_PERMITTED_VIOLATION : No permitted subtree violation | ||
270 | A name constraint violation occurred in the permitted subtrees. | ||
271 | .It Dv X509_V_ERR_EXCLUDED_VIOLATION : No excluded subtree violation | ||
272 | A name constraint violation occurred in the excluded subtrees. | ||
273 | .It Dv X509_V_ERR_SUBTREE_MINMAX : \ | ||
274 | No name constraints minimum and maximum not supported | ||
275 | A certificate name constraints extension included a minimum or maximum | ||
276 | field: this is not supported. | ||
277 | .It Dv X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE : \ | ||
278 | No unsupported name constraint type | ||
279 | An unsupported name constraint type was encountered. | ||
280 | OpenSSL currently only supports directory name, DNS name, email and URI | ||
281 | types. | ||
282 | .It Dv X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX : \ | ||
283 | No unsupported or invalid name constraint syntax | ||
284 | The format of the name constraint is not recognised: for example an | ||
285 | email address format of a form not mentioned in RFC3280. | ||
286 | This could be caused by a garbage extension or some new feature not | ||
287 | currently supported. | ||
288 | .It Dv X509_V_ERR_CRL_PATH_VALIDATION_ERROR : No CRL path validation error | ||
289 | An error occurred when attempting to verify the CRL path. | ||
290 | This error can only happen if extended CRL checking is enabled. | ||
291 | .It Dv X509_V_ERR_APPLICATION_VERIFICATION : \ | ||
292 | No application verification failure | ||
293 | An application specific error. | ||
294 | This will never be returned unless explicitly set by an application. | ||
295 | .El | ||
296 | .Sh SEE ALSO | ||
297 | .Xr X509_verify_cert 3 | ||