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