diff options
Diffstat (limited to 'src/lib/libcrypto/doc')
19 files changed, 0 insertions, 1805 deletions
diff --git a/src/lib/libcrypto/doc/X509_NAME_ENTRY_get_object.pod b/src/lib/libcrypto/doc/X509_NAME_ENTRY_get_object.pod deleted file mode 100644 index 4603202db8..0000000000 --- a/src/lib/libcrypto/doc/X509_NAME_ENTRY_get_object.pod +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | X509_NAME_ENTRY_get_object, X509_NAME_ENTRY_get_data, | ||
6 | X509_NAME_ENTRY_set_object, X509_NAME_ENTRY_set_data, | ||
7 | X509_NAME_ENTRY_create_by_txt, X509_NAME_ENTRY_create_by_NID, | ||
8 | X509_NAME_ENTRY_create_by_OBJ - X509_NAME_ENTRY utility functions | ||
9 | |||
10 | =head1 SYNOPSIS | ||
11 | |||
12 | #include <openssl/x509.h> | ||
13 | |||
14 | ASN1_OBJECT * X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne); | ||
15 | ASN1_STRING * X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne); | ||
16 | |||
17 | int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, ASN1_OBJECT *obj); | ||
18 | int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, const unsigned char *bytes, int len); | ||
19 | |||
20 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, const char *field, int type, const unsigned char *bytes, int len); | ||
21 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, int type,unsigned char *bytes, int len); | ||
22 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, ASN1_OBJECT *obj, int type, const unsigned char *bytes, int len); | ||
23 | |||
24 | =head1 DESCRIPTION | ||
25 | |||
26 | X509_NAME_ENTRY_get_object() retrieves the field name of B<ne> in | ||
27 | and B<ASN1_OBJECT> structure. | ||
28 | |||
29 | X509_NAME_ENTRY_get_data() retrieves the field value of B<ne> in | ||
30 | and B<ASN1_STRING> structure. | ||
31 | |||
32 | X509_NAME_ENTRY_set_object() sets the field name of B<ne> to B<obj>. | ||
33 | |||
34 | X509_NAME_ENTRY_set_data() sets the field value of B<ne> to string type | ||
35 | B<type> and value determined by B<bytes> and B<len>. | ||
36 | |||
37 | X509_NAME_ENTRY_create_by_txt(), X509_NAME_ENTRY_create_by_NID() | ||
38 | and X509_NAME_ENTRY_create_by_OBJ() create and return an | ||
39 | B<X509_NAME_ENTRY> structure. | ||
40 | |||
41 | =head1 NOTES | ||
42 | |||
43 | X509_NAME_ENTRY_get_object() and X509_NAME_ENTRY_get_data() can be | ||
44 | used to examine an B<X509_NAME_ENTRY> function as returned by | ||
45 | X509_NAME_get_entry() for example. | ||
46 | |||
47 | X509_NAME_ENTRY_create_by_txt(), X509_NAME_ENTRY_create_by_NID(), | ||
48 | and X509_NAME_ENTRY_create_by_OBJ() create and return an | ||
49 | |||
50 | X509_NAME_ENTRY_create_by_txt(), X509_NAME_ENTRY_create_by_OBJ(), | ||
51 | X509_NAME_ENTRY_create_by_NID() and X509_NAME_ENTRY_set_data() | ||
52 | are seldom used in practice because B<X509_NAME_ENTRY> structures | ||
53 | are almost always part of B<X509_NAME> structures and the | ||
54 | corresponding B<X509_NAME> functions are typically used to | ||
55 | create and add new entries in a single operation. | ||
56 | |||
57 | The arguments of these functions support similar options to the similarly | ||
58 | named ones of the corresponding B<X509_NAME> functions such as | ||
59 | X509_NAME_add_entry_by_txt(). So for example B<type> can be set to | ||
60 | B<MBSTRING_ASC> but in the case of X509_set_data() the field name must be | ||
61 | set first so the relevant field information can be looked up internally. | ||
62 | |||
63 | =head1 RETURN VALUES | ||
64 | |||
65 | =head1 SEE ALSO | ||
66 | |||
67 | L<ERR_get_error(3)|ERR_get_error(3)>, L<d2i_X509_NAME(3)|d2i_X509_NAME(3)>, | ||
68 | L<OBJ_nid2obj(3)|OBJ_nid2obj(3)> | ||
69 | |||
70 | =cut | ||
diff --git a/src/lib/libcrypto/doc/X509_NAME_add_entry_by_txt.pod b/src/lib/libcrypto/doc/X509_NAME_add_entry_by_txt.pod deleted file mode 100644 index f97e05e683..0000000000 --- a/src/lib/libcrypto/doc/X509_NAME_add_entry_by_txt.pod +++ /dev/null | |||
@@ -1,117 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | X509_NAME_add_entry_by_txt, X509_NAME_add_entry_by_OBJ, | ||
6 | X509_NAME_add_entry_by_NID, X509_NAME_add_entry, X509_NAME_delete_entry - | ||
7 | X509_NAME modification functions | ||
8 | |||
9 | =head1 SYNOPSIS | ||
10 | |||
11 | #include <openssl/x509.h> | ||
12 | |||
13 | int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, const unsigned char *bytes, int len, int loc, int set); | ||
14 | |||
15 | int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, unsigned char *bytes, int len, int loc, int set); | ||
16 | |||
17 | int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, unsigned char *bytes, int len, int loc, int set); | ||
18 | |||
19 | int X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne, int loc, int set); | ||
20 | |||
21 | X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); | ||
22 | |||
23 | =head1 DESCRIPTION | ||
24 | |||
25 | X509_NAME_add_entry_by_txt(), X509_NAME_add_entry_by_OBJ() and | ||
26 | X509_NAME_add_entry_by_NID() add a field whose name is defined | ||
27 | by a string B<field>, an object B<obj> or a NID B<nid> respectively. | ||
28 | The field value to be added is in B<bytes> of length B<len>. If | ||
29 | B<len> is -1 then the field length is calculated internally using | ||
30 | strlen(bytes). | ||
31 | |||
32 | The type of field is determined by B<type> which can either be a | ||
33 | definition of the type of B<bytes> (such as B<MBSTRING_ASC>) or a | ||
34 | standard ASN1 type (such as B<V_ASN1_IA5STRING>). The new entry is | ||
35 | added to a position determined by B<loc> and B<set>. | ||
36 | |||
37 | X509_NAME_add_entry() adds a copy of B<X509_NAME_ENTRY> structure B<ne> | ||
38 | to B<name>. The new entry is added to a position determined by B<loc> | ||
39 | and B<set>. Since a copy of B<ne> is added B<ne> must be freed up after | ||
40 | the call. | ||
41 | |||
42 | X509_NAME_delete_entry() deletes an entry from B<name> at position | ||
43 | B<loc>. The deleted entry is returned and must be freed up. | ||
44 | |||
45 | =head1 NOTES | ||
46 | |||
47 | The use of string types such as B<MBSTRING_ASC> or B<MBSTRING_UTF8> | ||
48 | is strongly recommended for the B<type> parameter. This allows the | ||
49 | internal code to correctly determine the type of the field and to | ||
50 | apply length checks according to the relevant standards. This is | ||
51 | done using ASN1_STRING_set_by_NID(). | ||
52 | |||
53 | If instead an ASN1 type is used no checks are performed and the | ||
54 | supplied data in B<bytes> is used directly. | ||
55 | |||
56 | In X509_NAME_add_entry_by_txt() the B<field> string represents | ||
57 | the field name using OBJ_txt2obj(field, 0). | ||
58 | |||
59 | The B<loc> and B<set> parameters determine where a new entry should | ||
60 | be added. For almost all applications B<loc> can be set to -1 and B<set> | ||
61 | to 0. This adds a new entry to the end of B<name> as a single valued | ||
62 | RelativeDistinguishedName (RDN). | ||
63 | |||
64 | B<loc> actually determines the index where the new entry is inserted: | ||
65 | if it is -1 it is appended. | ||
66 | |||
67 | B<set> determines how the new type is added. If it is zero a | ||
68 | new RDN is created. | ||
69 | |||
70 | If B<set> is -1 or 1 it is added to the previous or next RDN | ||
71 | structure respectively. This will then be a multivalued RDN: | ||
72 | since multivalues RDNs are very seldom used B<set> is almost | ||
73 | always set to zero. | ||
74 | |||
75 | =head1 EXAMPLES | ||
76 | |||
77 | Create an B<X509_NAME> structure: | ||
78 | |||
79 | "C=UK, O=Disorganized Organization, CN=Joe Bloggs" | ||
80 | |||
81 | X509_NAME *nm; | ||
82 | nm = X509_NAME_new(); | ||
83 | if (nm == NULL) | ||
84 | /* Some error */ | ||
85 | if (!X509_NAME_add_entry_by_txt(nm, MBSTRING_ASC, | ||
86 | "C", "UK", -1, -1, 0)) | ||
87 | /* Error */ | ||
88 | if (!X509_NAME_add_entry_by_txt(nm, MBSTRING_ASC, | ||
89 | "O", "Disorganized Organization", -1, -1, 0)) | ||
90 | /* Error */ | ||
91 | if (!X509_NAME_add_entry_by_txt(nm, MBSTRING_ASC, | ||
92 | "CN", "Joe Bloggs", -1, -1, 0)) | ||
93 | /* Error */ | ||
94 | |||
95 | =head1 RETURN VALUES | ||
96 | |||
97 | X509_NAME_add_entry_by_txt(), X509_NAME_add_entry_by_OBJ(), | ||
98 | X509_NAME_add_entry_by_NID() and X509_NAME_add_entry() return 1 for | ||
99 | success of 0 if an error occurred. | ||
100 | |||
101 | X509_NAME_delete_entry() returns either the deleted B<X509_NAME_ENTRY> | ||
102 | structure of B<NULL> if an error occurred. | ||
103 | |||
104 | =head1 BUGS | ||
105 | |||
106 | B<type> can still be set to B<V_ASN1_APP_CHOOSE> to use a | ||
107 | different algorithm to determine field types. Since this form does | ||
108 | not understand multicharacter types, performs no length checks and | ||
109 | can result in invalid field types its use is strongly discouraged. | ||
110 | |||
111 | =head1 SEE ALSO | ||
112 | |||
113 | L<ERR_get_error(3)|ERR_get_error(3)>, L<d2i_X509_NAME(3)|d2i_X509_NAME(3)> | ||
114 | |||
115 | =head1 HISTORY | ||
116 | |||
117 | =cut | ||
diff --git a/src/lib/libcrypto/doc/X509_NAME_get_index_by_NID.pod b/src/lib/libcrypto/doc/X509_NAME_get_index_by_NID.pod deleted file mode 100644 index 48510890e8..0000000000 --- a/src/lib/libcrypto/doc/X509_NAME_get_index_by_NID.pod +++ /dev/null | |||
@@ -1,102 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | X509_NAME_get_index_by_NID, X509_NAME_get_index_by_OBJ, X509_NAME_get_entry, | ||
6 | X509_NAME_entry_count, X509_NAME_get_text_by_NID, X509_NAME_get_text_by_OBJ - | ||
7 | X509_NAME lookup and enumeration functions | ||
8 | |||
9 | =head1 SYNOPSIS | ||
10 | |||
11 | #include <openssl/x509.h> | ||
12 | |||
13 | int X509_NAME_get_index_by_NID(X509_NAME *name,int nid,int lastpos); | ||
14 | int X509_NAME_get_index_by_OBJ(X509_NAME *name,ASN1_OBJECT *obj, int lastpos); | ||
15 | |||
16 | int X509_NAME_entry_count(X509_NAME *name); | ||
17 | X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc); | ||
18 | |||
19 | int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf,int len); | ||
20 | int X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, char *buf,int len); | ||
21 | |||
22 | =head1 DESCRIPTION | ||
23 | |||
24 | These functions allow an B<X509_NAME> structure to be examined. The | ||
25 | B<X509_NAME> structure is the same as the B<Name> type defined in | ||
26 | RFC2459 (and elsewhere) and used for example in certificate subject | ||
27 | and issuer names. | ||
28 | |||
29 | X509_NAME_get_index_by_NID() and X509_NAME_get_index_by_OBJ() retrieve | ||
30 | the next index matching B<nid> or B<obj> after B<lastpos>. B<lastpos> | ||
31 | should initially be set to -1. If there are no more entries -1 is returned. | ||
32 | |||
33 | X509_NAME_entry_count() returns the total number of entries in B<name>. | ||
34 | |||
35 | X509_NAME_get_entry() retrieves the B<X509_NAME_ENTRY> from B<name> | ||
36 | corresponding to index B<loc>. Acceptable values for B<loc> run from | ||
37 | 0 to (X509_NAME_entry_count(name) - 1). The value returned is an | ||
38 | internal pointer which must not be freed. | ||
39 | |||
40 | X509_NAME_get_text_by_NID(), X509_NAME_get_text_by_OBJ() retrieve | ||
41 | the "text" from the first entry in B<name> which matches B<nid> or | ||
42 | B<obj>, if no such entry exists -1 is returned. At most B<len> bytes | ||
43 | will be written and the text written to B<buf> will be null | ||
44 | terminated. The length of the output string written is returned | ||
45 | excluding the terminating null. If B<buf> is <NULL> then the amount | ||
46 | of space needed in B<buf> (excluding the final null) is returned. | ||
47 | |||
48 | =head1 NOTES | ||
49 | |||
50 | X509_NAME_get_text_by_NID() and X509_NAME_get_text_by_OBJ() are | ||
51 | legacy functions which have various limitations which make them | ||
52 | of minimal use in practice. They can only find the first matching | ||
53 | entry and will copy the contents of the field verbatim: this can | ||
54 | be highly confusing if the target is a multicharacter string type | ||
55 | like a BMPString or a UTF8String. | ||
56 | |||
57 | For a more general solution X509_NAME_get_index_by_NID() or | ||
58 | X509_NAME_get_index_by_OBJ() should be used followed by | ||
59 | X509_NAME_get_entry() on any matching indices and then the | ||
60 | various B<X509_NAME_ENTRY> utility functions on the result. | ||
61 | |||
62 | =head1 EXAMPLES | ||
63 | |||
64 | Process all entries: | ||
65 | |||
66 | int i; | ||
67 | X509_NAME_ENTRY *e; | ||
68 | |||
69 | for (i = 0; i < X509_NAME_entry_count(nm); i++) { | ||
70 | e = X509_NAME_get_entry(nm, i); | ||
71 | /* Do something with e */ | ||
72 | } | ||
73 | |||
74 | Process all commonName entries: | ||
75 | |||
76 | int loc; | ||
77 | X509_NAME_ENTRY *e; | ||
78 | |||
79 | loc = -1; | ||
80 | for (;;) { | ||
81 | lastpos = X509_NAME_get_index_by_NID(nm, NID_commonName, lastpos); | ||
82 | if (lastpos == -1) | ||
83 | break; | ||
84 | e = X509_NAME_get_entry(nm, lastpos); | ||
85 | /* Do something with e */ | ||
86 | } | ||
87 | |||
88 | =head1 RETURN VALUES | ||
89 | |||
90 | X509_NAME_get_index_by_NID() and X509_NAME_get_index_by_OBJ() | ||
91 | return the index of the next matching entry or -1 if not found. | ||
92 | |||
93 | X509_NAME_entry_count() returns the total number of entries. | ||
94 | |||
95 | X509_NAME_get_entry() returns an B<X509_NAME> pointer to the | ||
96 | requested entry or B<NULL> if the index is invalid. | ||
97 | |||
98 | =head1 SEE ALSO | ||
99 | |||
100 | L<ERR_get_error(3)|ERR_get_error(3)>, L<d2i_X509_NAME(3)|d2i_X509_NAME(3)> | ||
101 | |||
102 | =cut | ||
diff --git a/src/lib/libcrypto/doc/X509_NAME_print_ex.pod b/src/lib/libcrypto/doc/X509_NAME_print_ex.pod deleted file mode 100644 index 5cdf636c16..0000000000 --- a/src/lib/libcrypto/doc/X509_NAME_print_ex.pod +++ /dev/null | |||
@@ -1,103 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | X509_NAME_print_ex, X509_NAME_print_ex_fp, X509_NAME_print, | ||
6 | X509_NAME_oneline - X509_NAME printing routines. | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/x509.h> | ||
11 | |||
12 | int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags); | ||
13 | int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags); | ||
14 | char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); | ||
15 | int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); | ||
16 | |||
17 | =head1 DESCRIPTION | ||
18 | |||
19 | X509_NAME_print_ex() prints a human readable version of B<nm> to BIO B<out>. | ||
20 | Each line (for multiline formats) is indented by B<indent> spaces. The output | ||
21 | format can be extensively customised by use of the B<flags> parameter. | ||
22 | |||
23 | X509_NAME_print_ex_fp() is identical to X509_NAME_print_ex() except the output | ||
24 | is written to FILE pointer B<fp>. | ||
25 | |||
26 | X509_NAME_oneline() prints an ASCII version of B<a> to B<buf>. At most B<size> | ||
27 | bytes will be written. If B<buf> is B<NULL> then a buffer is dynamically | ||
28 | allocated and returned, otherwise B<buf> is returned. | ||
29 | |||
30 | X509_NAME_print() prints out B<name> to B<bp> indenting each line by B<obase> | ||
31 | characters. Multiple lines are used if the output (including indent) exceeds | ||
32 | 80 characters. | ||
33 | |||
34 | =head1 NOTES | ||
35 | |||
36 | The functions X509_NAME_oneline() and X509_NAME_print() are legacy functions | ||
37 | which produce a non standard output form, they don't handle multi character | ||
38 | fields and have various quirks and inconsistencies. Their use is strongly | ||
39 | discouraged in new applications. | ||
40 | |||
41 | Although there are a large number of possible flags for most purposes | ||
42 | B<XN_FLAG_ONELINE>, B<XN_FLAG_MULTILINE> or B<XN_FLAG_RFC2253> will suffice. | ||
43 | As noted on the L<ASN1_STRING_print_ex(3)|ASN1_STRING_print_ex(3)> manual page | ||
44 | for UTF8 terminals the B<ASN1_STRFLGS_ESC_MSB> should be unset: so for example | ||
45 | B<XN_FLAG_ONELINE & ~ASN1_STRFLGS_ESC_MSB> would be used. | ||
46 | |||
47 | The complete set of the flags supported by X509_NAME_print_ex() is listed below. | ||
48 | |||
49 | Several options can be ored together. | ||
50 | |||
51 | The options B<XN_FLAG_SEP_COMMA_PLUS>, B<XN_FLAG_SEP_CPLUS_SPC>, | ||
52 | B<XN_FLAG_SEP_SPLUS_SPC> and B<XN_FLAG_SEP_MULTILINE> determine the field | ||
53 | separators to use. Two distinct separators are used between distinct | ||
54 | RelativeDistinguishedName components and separate values in the same RDN for a | ||
55 | multi-valued RDN. Multi-valued RDNs are currently very rare so the second | ||
56 | separator will hardly ever be used. | ||
57 | |||
58 | B<XN_FLAG_SEP_COMMA_PLUS> uses comma and plus as separators. | ||
59 | B<XN_FLAG_SEP_CPLUS_SPC> uses comma and plus with spaces: this is more readable | ||
60 | that plain comma and plus. B<XN_FLAG_SEP_SPLUS_SPC> uses spaced semicolon and | ||
61 | plus. B<XN_FLAG_SEP_MULTILINE> uses spaced newline and plus respectively. | ||
62 | |||
63 | If B<XN_FLAG_DN_REV> is set the whole DN is printed in reversed order. | ||
64 | |||
65 | The fields B<XN_FLAG_FN_SN>, B<XN_FLAG_FN_LN>, B<XN_FLAG_FN_OID>, | ||
66 | B<XN_FLAG_FN_NONE> determine how a field name is displayed. It will | ||
67 | use the short name (e.g. CN) the long name (e.g. commonName) always | ||
68 | use OID numerical form (normally OIDs are only used if the field name is not | ||
69 | recognised) and no field name respectively. | ||
70 | |||
71 | If B<XN_FLAG_SPC_EQ> is set then spaces will be placed around the '=' character | ||
72 | separating field names and values. | ||
73 | |||
74 | If B<XN_FLAG_DUMP_UNKNOWN_FIELDS> is set then the encoding of unknown fields is | ||
75 | printed instead of the values. | ||
76 | |||
77 | If B<XN_FLAG_FN_ALIGN> is set then field names are padded to 20 characters: this | ||
78 | is only of use for multiline format. | ||
79 | |||
80 | Additionally all the options supported by ASN1_STRING_print_ex() can be used to | ||
81 | control how each field value is displayed. | ||
82 | |||
83 | In addition a number options can be set for commonly used formats. | ||
84 | |||
85 | B<XN_FLAG_RFC2253> sets options which produce an output compatible with RFC2253 it | ||
86 | is equivalent to: | ||
87 | B<ASN1_STRFLGS_RFC2253 | XN_FLAG_SEP_COMMA_PLUS | XN_FLAG_DN_REV | XN_FLAG_FN_SN | XN_FLAG_DUMP_UNKNOWN_FIELDS> | ||
88 | |||
89 | |||
90 | B<XN_FLAG_ONELINE> is a more readable one line format which is the same as: | ||
91 | B<ASN1_STRFLGS_RFC2253 | ASN1_STRFLGS_ESC_QUOTE | XN_FLAG_SEP_CPLUS_SPC | XN_FLAG_SPC_EQ | XN_FLAG_FN_SN> | ||
92 | |||
93 | B<XN_FLAG_MULTILINE> is a multiline format which is the same as: | ||
94 | B<ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB | XN_FLAG_SEP_MULTILINE | XN_FLAG_SPC_EQ | XN_FLAG_FN_LN | XN_FLAG_FN_ALIGN> | ||
95 | |||
96 | B<XN_FLAG_COMPAT> uses a format identical to X509_NAME_print(): in fact it | ||
97 | calls X509_NAME_print() internally. | ||
98 | |||
99 | =head1 SEE ALSO | ||
100 | |||
101 | L<ASN1_STRING_print_ex(3)|ASN1_STRING_print_ex(3)> | ||
102 | |||
103 | =cut | ||
diff --git a/src/lib/libcrypto/doc/X509_STORE_CTX_get_error.pod b/src/lib/libcrypto/doc/X509_STORE_CTX_get_error.pod deleted file mode 100644 index 270b265ce5..0000000000 --- a/src/lib/libcrypto/doc/X509_STORE_CTX_get_error.pod +++ /dev/null | |||
@@ -1,323 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | X509_STORE_CTX_get_error, X509_STORE_CTX_set_error, | ||
6 | X509_STORE_CTX_get_error_depth, X509_STORE_CTX_get_current_cert, | ||
7 | X509_STORE_CTX_get1_chain, X509_verify_cert_error_string - get or set | ||
8 | certificate verification status information | ||
9 | |||
10 | =head1 SYNOPSIS | ||
11 | |||
12 | #include <openssl/x509.h> | ||
13 | #include <openssl/x509_vfy.h> | ||
14 | |||
15 | int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx); | ||
16 | void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx,int s); | ||
17 | int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx); | ||
18 | X509 * X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx); | ||
19 | |||
20 | STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx); | ||
21 | |||
22 | const char *X509_verify_cert_error_string(long n); | ||
23 | |||
24 | =head1 DESCRIPTION | ||
25 | |||
26 | These functions are typically called after X509_verify_cert() has indicated | ||
27 | an error or in a verification callback to determine the nature of an error. | ||
28 | |||
29 | X509_STORE_CTX_get_error() returns the error code of B<ctx>, see | ||
30 | the B<ERROR CODES> section for a full description of all error codes. | ||
31 | |||
32 | X509_STORE_CTX_set_error() sets the error code of B<ctx> to B<s>. For example | ||
33 | it might be used in a verification callback to set an error based on additional | ||
34 | checks. | ||
35 | |||
36 | X509_STORE_CTX_get_error_depth() returns the B<depth> of the error. This is a | ||
37 | non-negative integer representing where in the certificate chain the error | ||
38 | occurred. If it is zero it occurred in the end entity certificate, one if | ||
39 | it is the certificate which signed the end entity certificate and so on. | ||
40 | |||
41 | X509_STORE_CTX_get_current_cert() returns the certificate in B<ctx> which | ||
42 | caused the error or B<NULL> if no certificate is relevant. | ||
43 | |||
44 | X509_STORE_CTX_get1_chain() returns a complete validate chain if a previous | ||
45 | call to X509_verify_cert() is successful. If the call to X509_verify_cert() | ||
46 | is B<not> successful the returned chain may be incomplete or invalid. The | ||
47 | returned chain persists after the B<ctx> structure is freed, when it is | ||
48 | no longer needed it should be free up using: | ||
49 | |||
50 | sk_X509_pop_free(chain, X509_free); | ||
51 | |||
52 | X509_verify_cert_error_string() returns a human readable error string for | ||
53 | verification error B<n>. | ||
54 | |||
55 | =head1 RETURN VALUES | ||
56 | |||
57 | X509_STORE_CTX_get_error() returns B<X509_V_OK> or an error code. | ||
58 | |||
59 | X509_STORE_CTX_get_error_depth() returns a non-negative error depth. | ||
60 | |||
61 | X509_STORE_CTX_get_current_cert() returns the certificate which caused the | ||
62 | error or B<NULL> if no certificate is relevant to the error. | ||
63 | |||
64 | X509_verify_cert_error_string() returns a human readable error string for | ||
65 | verification error B<n>. | ||
66 | |||
67 | =head1 ERROR CODES | ||
68 | |||
69 | A list of error codes and messages is shown below. Some of the | ||
70 | error codes are defined but currently never returned: these are described as | ||
71 | "unused". | ||
72 | |||
73 | =over 4 | ||
74 | |||
75 | =item B<X509_V_OK: ok> | ||
76 | |||
77 | the operation was successful. | ||
78 | |||
79 | =item B<X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: unable to get issuer certificate> | ||
80 | |||
81 | the issuer certificate could not be found: this occurs if the issuer certificate | ||
82 | of an untrusted certificate cannot be found. | ||
83 | |||
84 | =item B<X509_V_ERR_UNABLE_TO_GET_CRL: unable to get certificate CRL> | ||
85 | |||
86 | the CRL of a certificate could not be found. | ||
87 | |||
88 | =item B<X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: unable to decrypt | ||
89 | certificate's signature> | ||
90 | |||
91 | the certificate signature could not be decrypted. This means that the actual | ||
92 | signature value could not be determined rather than it not matching the | ||
93 | expected value, this is only meaningful for RSA keys. | ||
94 | |||
95 | =item B<X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE: unable to decrypt CRL's | ||
96 | signature> | ||
97 | |||
98 | the CRL signature could not be decrypted: this means that the actual signature | ||
99 | value could not be determined rather than it not matching the expected value. | ||
100 | Unused. | ||
101 | |||
102 | =item B<X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: unable to decode issuer | ||
103 | public key> | ||
104 | |||
105 | the public key in the certificate SubjectPublicKeyInfo could not be read. | ||
106 | |||
107 | =item B<X509_V_ERR_CERT_SIGNATURE_FAILURE: certificate signature failure> | ||
108 | |||
109 | the signature of the certificate is invalid. | ||
110 | |||
111 | =item B<X509_V_ERR_CRL_SIGNATURE_FAILURE: CRL signature failure> | ||
112 | |||
113 | the signature of the certificate is invalid. | ||
114 | |||
115 | =item B<X509_V_ERR_CERT_NOT_YET_VALID: certificate is not yet valid> | ||
116 | |||
117 | the certificate is not yet valid: the notBefore date is after the current time. | ||
118 | |||
119 | =item B<X509_V_ERR_CERT_HAS_EXPIRED: certificate has expired> | ||
120 | |||
121 | the certificate has expired: that is the notAfter date is before the current | ||
122 | time. | ||
123 | |||
124 | =item B<X509_V_ERR_CRL_NOT_YET_VALID: CRL is not yet valid> | ||
125 | |||
126 | the CRL is not yet valid. | ||
127 | |||
128 | =item B<X509_V_ERR_CRL_HAS_EXPIRED: CRL has expired> | ||
129 | |||
130 | the CRL has expired. | ||
131 | |||
132 | =item B<X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: format error in | ||
133 | certificate's notBefore field> | ||
134 | |||
135 | the certificate notBefore field contains an invalid time. | ||
136 | |||
137 | =item B<X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: format error in certificate's | ||
138 | notAfter field> | ||
139 | |||
140 | the certificate notAfter field contains an invalid time. | ||
141 | |||
142 | =item B<X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD: format error in CRL's | ||
143 | lastUpdate field> | ||
144 | |||
145 | the CRL lastUpdate field contains an invalid time. | ||
146 | |||
147 | =item B<X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: format error in CRL's | ||
148 | nextUpdate field> | ||
149 | |||
150 | the CRL nextUpdate field contains an invalid time. | ||
151 | |||
152 | =item B<X509_V_ERR_OUT_OF_MEM: out of memory> | ||
153 | |||
154 | an error occurred trying to allocate memory. This should never happen. | ||
155 | |||
156 | =item B<X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: self signed certificate> | ||
157 | |||
158 | the passed certificate is self signed and the same certificate cannot be found | ||
159 | in the list of trusted certificates. | ||
160 | |||
161 | =item B<X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: self signed certificate in | ||
162 | certificate chain> | ||
163 | |||
164 | the certificate chain could be built up using the untrusted certificates but | ||
165 | the root could not be found locally. | ||
166 | |||
167 | =item B<X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: unable to get local | ||
168 | issuer certificate> | ||
169 | |||
170 | the issuer certificate of a locally looked up certificate could not be found. | ||
171 | This normally means the list of trusted certificates is not complete. | ||
172 | |||
173 | =item B<X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: unable to verify the first | ||
174 | certificate> | ||
175 | |||
176 | no signatures could be verified because the chain contains only one certificate | ||
177 | and it is not self signed. | ||
178 | |||
179 | =item B<X509_V_ERR_CERT_CHAIN_TOO_LONG: certificate chain too long> | ||
180 | |||
181 | the certificate chain length is greater than the supplied maximum depth. Unused. | ||
182 | |||
183 | =item B<X509_V_ERR_CERT_REVOKED: certificate revoked> | ||
184 | |||
185 | the certificate has been revoked. | ||
186 | |||
187 | =item B<X509_V_ERR_INVALID_CA: invalid CA certificate> | ||
188 | |||
189 | a CA certificate is invalid. Either it is not a CA or its extensions are not | ||
190 | consistent with the supplied purpose. | ||
191 | |||
192 | =item B<X509_V_ERR_PATH_LENGTH_EXCEEDED: path length constraint exceeded> | ||
193 | |||
194 | the basicConstraints pathlength parameter has been exceeded. | ||
195 | |||
196 | =item B<X509_V_ERR_INVALID_PURPOSE: unsupported certificate purpose> | ||
197 | |||
198 | the supplied certificate cannot be used for the specified purpose. | ||
199 | |||
200 | =item B<X509_V_ERR_CERT_UNTRUSTED: certificate not trusted> | ||
201 | |||
202 | the root CA is not marked as trusted for the specified purpose. | ||
203 | |||
204 | =item B<X509_V_ERR_CERT_REJECTED: certificate rejected> | ||
205 | |||
206 | the root CA is marked to reject the specified purpose. | ||
207 | |||
208 | =item B<X509_V_ERR_SUBJECT_ISSUER_MISMATCH: subject issuer mismatch> | ||
209 | |||
210 | the current candidate issuer certificate was rejected because its subject name | ||
211 | did not match the issuer name of the current certificate. This is only set | ||
212 | if issuer check debugging is enabled it is used for status notification and | ||
213 | is B<not> in itself an error. | ||
214 | |||
215 | =item B<X509_V_ERR_AKID_SKID_MISMATCH: authority and subject key identifier | ||
216 | mismatch> | ||
217 | |||
218 | the current candidate issuer certificate was rejected because its subject key | ||
219 | identifier was present and did not match the authority key identifier current | ||
220 | certificate. This is only set if issuer check debugging is enabled it is used | ||
221 | for status notification and is B<not> in itself an error. | ||
222 | |||
223 | =item B<X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH: authority and issuer serial | ||
224 | number mismatch> | ||
225 | |||
226 | the current candidate issuer certificate was rejected because its issuer name | ||
227 | and serial number was present and did not match the authority key identifier of | ||
228 | the current certificate. This is only set if issuer check debugging is enabled | ||
229 | it is used for status notification and is B<not> in itself an error. | ||
230 | |||
231 | =item B<X509_V_ERR_KEYUSAGE_NO_CERTSIGN:key usage does not include certificate | ||
232 | signing> | ||
233 | |||
234 | the current candidate issuer certificate was rejected because its keyUsage | ||
235 | extension does not permit certificate signing. This is only set if issuer check | ||
236 | debugging is enabled it is used for status notification and is B<not> in itself | ||
237 | an error. | ||
238 | |||
239 | =item B<X509_V_ERR_INVALID_EXTENSION: invalid or inconsistent certificate | ||
240 | extension> | ||
241 | |||
242 | A certificate extension had an invalid value (for example an incorrect | ||
243 | encoding) or some value inconsistent with other extensions. | ||
244 | |||
245 | |||
246 | =item B<X509_V_ERR_INVALID_POLICY_EXTENSION: invalid or inconsistent | ||
247 | certificate policy extension> | ||
248 | |||
249 | A certificate policies extension had an invalid value (for example an incorrect | ||
250 | encoding) or some value inconsistent with other extensions. This error only | ||
251 | occurs if policy processing is enabled. | ||
252 | |||
253 | =item B<X509_V_ERR_NO_EXPLICIT_POLICY: no explicit policy> | ||
254 | |||
255 | The verification flags were set to require and explicit policy but none was | ||
256 | present. | ||
257 | |||
258 | =item B<X509_V_ERR_DIFFERENT_CRL_SCOPE: Different CRL scope> | ||
259 | |||
260 | The only CRLs that could be found did not match the scope of the certificate. | ||
261 | |||
262 | =item B<X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE: Unsupported extension feature> | ||
263 | |||
264 | Some feature of a certificate extension is not supported. Unused. | ||
265 | |||
266 | =item B<X509_V_ERR_PERMITTED_VIOLATION: permitted subtree violation> | ||
267 | |||
268 | A name constraint violation occurred in the permitted subtrees. | ||
269 | |||
270 | =item B<X509_V_ERR_EXCLUDED_VIOLATION: excluded subtree violation> | ||
271 | |||
272 | A name constraint violation occurred in the excluded subtrees. | ||
273 | |||
274 | =item B<X509_V_ERR_SUBTREE_MINMAX: name constraints minimum and maximum not | ||
275 | supported> | ||
276 | |||
277 | A certificate name constraints extension included a minimum or maximum field: | ||
278 | this is not supported. | ||
279 | |||
280 | =item B<X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE: unsupported name constraint | ||
281 | type> | ||
282 | |||
283 | An unsupported name constraint type was encountered. OpenSSL currently only | ||
284 | supports directory name, DNS name, email and URI types. | ||
285 | |||
286 | =item B<X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX: unsupported or invalid name | ||
287 | constraint syntax> | ||
288 | |||
289 | The format of the name constraint is not recognised: for example an email | ||
290 | address format of a form not mentioned in RFC3280. This could be caused by | ||
291 | a garbage extension or some new feature not currently supported. | ||
292 | |||
293 | =item B<X509_V_ERR_CRL_PATH_VALIDATION_ERROR: CRL path validation error> | ||
294 | |||
295 | An error occurred when attempting to verify the CRL path. This error can only | ||
296 | happen if extended CRL checking is enabled. | ||
297 | |||
298 | =item B<X509_V_ERR_APPLICATION_VERIFICATION: application verification failure> | ||
299 | |||
300 | an application specific error. This will never be returned unless explicitly | ||
301 | set by an application. | ||
302 | |||
303 | =back | ||
304 | |||
305 | =head1 NOTES | ||
306 | |||
307 | The above functions should be used instead of directly referencing the fields | ||
308 | in the B<X509_VERIFY_CTX> structure. | ||
309 | |||
310 | In versions of OpenSSL before 1.0 the current certificate returned by | ||
311 | X509_STORE_CTX_get_current_cert() was never B<NULL>. Applications should | ||
312 | check the return value before printing out any debugging information relating | ||
313 | to the current certificate. | ||
314 | |||
315 | If an unrecognised error code is passed to X509_verify_cert_error_string() the | ||
316 | numerical value of the unknown code is returned in a static buffer. This is not | ||
317 | thread safe but will never happen unless an invalid code is passed. | ||
318 | |||
319 | =head1 SEE ALSO | ||
320 | |||
321 | L<X509_verify_cert(3)|X509_verify_cert(3)> | ||
322 | |||
323 | =cut | ||
diff --git a/src/lib/libcrypto/doc/X509_STORE_CTX_get_ex_new_index.pod b/src/lib/libcrypto/doc/X509_STORE_CTX_get_ex_new_index.pod deleted file mode 100644 index 25224cef1b..0000000000 --- a/src/lib/libcrypto/doc/X509_STORE_CTX_get_ex_new_index.pod +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | X509_STORE_CTX_get_ex_new_index, X509_STORE_CTX_set_ex_data, | ||
6 | X509_STORE_CTX_get_ex_data - add application specific data to X509_STORE_CTX | ||
7 | structures | ||
8 | |||
9 | =head1 SYNOPSIS | ||
10 | |||
11 | #include <openssl/x509_vfy.h> | ||
12 | |||
13 | int X509_STORE_CTX_get_ex_new_index(long argl, void *argp, | ||
14 | CRYPTO_EX_new *new_func, | ||
15 | CRYPTO_EX_dup *dup_func, | ||
16 | CRYPTO_EX_free *free_func); | ||
17 | |||
18 | int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *d, int idx, void *arg); | ||
19 | |||
20 | void *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *d, int idx); | ||
21 | |||
22 | =head1 DESCRIPTION | ||
23 | |||
24 | These functions handle application specific data in X509_STORE_CTX structures. | ||
25 | Their usage is identical to that of RSA_get_ex_new_index(), RSA_set_ex_data() | ||
26 | and RSA_get_ex_data() as described in L<RSA_get_ex_new_index(3)>. | ||
27 | |||
28 | =head1 NOTES | ||
29 | |||
30 | This mechanism is used internally by the B<ssl> library to store the B<SSL> | ||
31 | structure associated with a verification operation in an B<X509_STORE_CTX> | ||
32 | structure. | ||
33 | |||
34 | =head1 SEE ALSO | ||
35 | |||
36 | L<RSA_get_ex_new_index(3)|RSA_get_ex_new_index(3)> | ||
37 | |||
38 | =head1 HISTORY | ||
39 | |||
40 | X509_STORE_CTX_get_ex_new_index(), X509_STORE_CTX_set_ex_data() and | ||
41 | X509_STORE_CTX_get_ex_data() are available since OpenSSL 0.9.5. | ||
42 | |||
43 | =cut | ||
diff --git a/src/lib/libcrypto/doc/X509_STORE_CTX_new.pod b/src/lib/libcrypto/doc/X509_STORE_CTX_new.pod deleted file mode 100644 index 66c0da04d2..0000000000 --- a/src/lib/libcrypto/doc/X509_STORE_CTX_new.pod +++ /dev/null | |||
@@ -1,126 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | X509_STORE_CTX_new, X509_STORE_CTX_cleanup, X509_STORE_CTX_free, | ||
6 | X509_STORE_CTX_init, X509_STORE_CTX_trusted_stack, X509_STORE_CTX_set_cert, | ||
7 | X509_STORE_CTX_set_chain, X509_STORE_CTX_set0_crls, X509_STORE_CTX_get0_param, | ||
8 | X509_STORE_CTX_set0_param, X509_STORE_CTX_set_default - X509_STORE_CTX | ||
9 | initialisation | ||
10 | |||
11 | =head1 SYNOPSIS | ||
12 | |||
13 | #include <openssl/x509_vfy.h> | ||
14 | |||
15 | X509_STORE_CTX *X509_STORE_CTX_new(void); | ||
16 | void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx); | ||
17 | void X509_STORE_CTX_free(X509_STORE_CTX *ctx); | ||
18 | |||
19 | int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, | ||
20 | X509 *x509, STACK_OF(X509) *chain); | ||
21 | |||
22 | void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); | ||
23 | |||
24 | void X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx,X509 *x); | ||
25 | void X509_STORE_CTX_set_chain(X509_STORE_CTX *ctx,STACK_OF(X509) *sk); | ||
26 | void X509_STORE_CTX_set0_crls(X509_STORE_CTX *ctx, STACK_OF(X509_CRL) *sk); | ||
27 | |||
28 | X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *ctx); | ||
29 | void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param); | ||
30 | int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name); | ||
31 | |||
32 | =head1 DESCRIPTION | ||
33 | |||
34 | These functions initialise an B<X509_STORE_CTX> structure for subsequent use | ||
35 | by X509_verify_cert(). | ||
36 | |||
37 | X509_STORE_CTX_new() returns a newly initialised B<X509_STORE_CTX> structure. | ||
38 | |||
39 | X509_STORE_CTX_cleanup() internally cleans up an B<X509_STORE_CTX> structure. | ||
40 | The context can then be reused with an new call to X509_STORE_CTX_init(). | ||
41 | |||
42 | X509_STORE_CTX_free() completely frees up B<ctx>. After this call B<ctx> | ||
43 | is no longer valid. | ||
44 | |||
45 | X509_STORE_CTX_init() sets up B<ctx> for a subsequent verification operation. | ||
46 | The trusted certificate store is set to B<store>, the end entity certificate | ||
47 | to be verified is set to B<x509> and a set of additional certificates (which | ||
48 | will be untrusted but may be used to build the chain) in B<chain>. Any or | ||
49 | all of the B<store>, B<x509> and B<chain> parameters can be B<NULL>. | ||
50 | |||
51 | X509_STORE_CTX_trusted_stack() sets the set of trusted certificates of B<ctx> | ||
52 | to B<sk>. This is an alternative way of specifying trusted certificates | ||
53 | instead of using an B<X509_STORE>. | ||
54 | |||
55 | X509_STORE_CTX_set_cert() sets the certificate to be verified in B<ctx> to | ||
56 | B<x>. | ||
57 | |||
58 | X509_STORE_CTX_set_chain() sets the additional certificate chain used by B<ctx> | ||
59 | to B<sk>. | ||
60 | |||
61 | X509_STORE_CTX_set0_crls() sets a set of CRLs to use to aid certificate | ||
62 | verification to B<sk>. These CRLs will only be used if CRL verification is | ||
63 | enabled in the associated B<X509_VERIFY_PARAM> structure. This might be | ||
64 | used where additional "useful" CRLs are supplied as part of a protocol, | ||
65 | for example in a PKCS#7 structure. | ||
66 | |||
67 | X509_VERIFY_PARAM *X509_STORE_CTX_get0_param() retrieves an internal pointer | ||
68 | to the verification parameters associated with B<ctx>. | ||
69 | |||
70 | X509_STORE_CTX_set0_param() sets the internal verification parameter pointer | ||
71 | to B<param>. After this call B<param> should not be used. | ||
72 | |||
73 | X509_STORE_CTX_set_default() looks up and sets the default verification | ||
74 | method to B<name>. This uses the function X509_VERIFY_PARAM_lookup() to | ||
75 | find an appropriate set of parameters from B<name>. | ||
76 | |||
77 | =head1 NOTES | ||
78 | |||
79 | The certificates and CRLs in a store are used internally and should B<not> | ||
80 | be freed up until after the associated B<X509_STORE_CTX> is freed. Legacy | ||
81 | applications might implicitly use an B<X509_STORE_CTX> like this: | ||
82 | |||
83 | X509_STORE_CTX ctx; | ||
84 | X509_STORE_CTX_init(&ctx, store, cert, chain); | ||
85 | |||
86 | this is B<not> recommended in new applications they should instead do: | ||
87 | |||
88 | X509_STORE_CTX *ctx; | ||
89 | ctx = X509_STORE_CTX_new(); | ||
90 | if (ctx == NULL) | ||
91 | /* Bad error */ | ||
92 | X509_STORE_CTX_init(ctx, store, cert, chain); | ||
93 | |||
94 | =head1 BUGS | ||
95 | |||
96 | The certificates and CRLs in a context are used internally and should B<not> | ||
97 | be freed up until after the associated B<X509_STORE_CTX> is freed. Copies | ||
98 | should be made or reference counts increased instead. | ||
99 | |||
100 | =head1 RETURN VALUES | ||
101 | |||
102 | X509_STORE_CTX_new() returns an newly allocates context or B<NULL> is an | ||
103 | error occurred. | ||
104 | |||
105 | X509_STORE_CTX_init() returns 1 for success or 0 if an error occurred. | ||
106 | |||
107 | X509_STORE_CTX_get0_param() returns a pointer to an B<X509_VERIFY_PARAM> | ||
108 | structure or B<NULL> if an error occurred. | ||
109 | |||
110 | X509_STORE_CTX_cleanup(), X509_STORE_CTX_free(), X509_STORE_CTX_trusted_stack(), | ||
111 | X509_STORE_CTX_set_cert(), X509_STORE_CTX_set_chain(), | ||
112 | X509_STORE_CTX_set0_crls() and X509_STORE_CTX_set0_param() do not return | ||
113 | values. | ||
114 | |||
115 | X509_STORE_CTX_set_default() returns 1 for success or 0 if an error occurred. | ||
116 | |||
117 | =head1 SEE ALSO | ||
118 | |||
119 | L<X509_verify_cert(3)|X509_verify_cert(3)> | ||
120 | L<X509_VERIFY_PARAM_set_flags(3)|X509_VERIFY_PARAM_set_flags(3)> | ||
121 | |||
122 | =head1 HISTORY | ||
123 | |||
124 | X509_STORE_CTX_set0_crls() was first added to OpenSSL 1.0.0 | ||
125 | |||
126 | =cut | ||
diff --git a/src/lib/libcrypto/doc/X509_STORE_CTX_set_verify_cb.pod b/src/lib/libcrypto/doc/X509_STORE_CTX_set_verify_cb.pod deleted file mode 100644 index 7dfe430c4c..0000000000 --- a/src/lib/libcrypto/doc/X509_STORE_CTX_set_verify_cb.pod +++ /dev/null | |||
@@ -1,165 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | X509_STORE_CTX_set_verify_cb - set verification callback | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/x509_vfy.h> | ||
10 | |||
11 | void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx, | ||
12 | int (*verify_cb)(int ok, X509_STORE_CTX *ctx)); | ||
13 | |||
14 | =head1 DESCRIPTION | ||
15 | |||
16 | X509_STORE_CTX_set_verify_cb() sets the verification callback of B<ctx> to | ||
17 | B<verify_cb> overwriting any existing callback. | ||
18 | |||
19 | The verification callback can be used to customise the operation of certificate | ||
20 | verification, either by overriding error conditions or logging errors for | ||
21 | debugging purposes. | ||
22 | |||
23 | However a verification callback is B<not> essential and the default operation | ||
24 | is often sufficient. | ||
25 | |||
26 | The B<ok> parameter to the callback indicates the value the callback should | ||
27 | return to retain the default behaviour. If it is zero then and error condition | ||
28 | is indicated. If it is 1 then no error occurred. If the flag | ||
29 | B<X509_V_FLAG_NOTIFY_POLICY> is set then B<ok> is set to 2 to indicate the | ||
30 | policy checking is complete. | ||
31 | |||
32 | The B<ctx> parameter to the callback is the B<X509_STORE_CTX> structure that | ||
33 | is performing the verification operation. A callback can examine this | ||
34 | structure and receive additional information about the error, for example | ||
35 | by calling X509_STORE_CTX_get_current_cert(). Additional application data can | ||
36 | be passed to the callback via the B<ex_data> mechanism. | ||
37 | |||
38 | =head1 WARNING | ||
39 | |||
40 | In general a verification callback should B<NOT> unconditionally return 1 in | ||
41 | all circumstances because this will allow verification to succeed no matter | ||
42 | what the error. This effectively removes all security from the application | ||
43 | because B<any> certificate (including untrusted generated ones) will be | ||
44 | accepted. | ||
45 | |||
46 | =head1 NOTES | ||
47 | |||
48 | The verification callback can be set and inherited from the parent structure | ||
49 | performing the operation. In some cases (such as S/MIME verification) the | ||
50 | B<X509_STORE_CTX> structure is created and destroyed internally and the | ||
51 | only way to set a custom verification callback is by inheriting it from the | ||
52 | associated B<X509_STORE>. | ||
53 | |||
54 | =head1 RETURN VALUES | ||
55 | |||
56 | X509_STORE_CTX_set_verify_cb() does not return a value. | ||
57 | |||
58 | =head1 EXAMPLES | ||
59 | |||
60 | Default callback operation: | ||
61 | |||
62 | int | ||
63 | verify_callback(int ok, X509_STORE_CTX *ctx) | ||
64 | { | ||
65 | return ok; | ||
66 | } | ||
67 | |||
68 | Simple example, suppose a certificate in the chain is expired and we wish | ||
69 | to continue after this error: | ||
70 | |||
71 | int | ||
72 | verify_callback(int ok, X509_STORE_CTX *ctx) | ||
73 | { | ||
74 | /* Tolerate certificate expiration */ | ||
75 | if (X509_STORE_CTX_get_error(ctx) == X509_V_ERR_CERT_HAS_EXPIRED) | ||
76 | return 1; | ||
77 | /* Otherwise don't override */ | ||
78 | return ok; | ||
79 | } | ||
80 | |||
81 | More complex example, we don't wish to continue after B<any> certificate has | ||
82 | expired just one specific case: | ||
83 | |||
84 | int | ||
85 | verify_callback(int ok, X509_STORE_CTX *ctx) | ||
86 | { | ||
87 | int err = X509_STORE_CTX_get_error(ctx); | ||
88 | X509 *err_cert = X509_STORE_CTX_get_current_cert(ctx); | ||
89 | |||
90 | if (err == X509_V_ERR_CERT_HAS_EXPIRED) { | ||
91 | if (check_is_acceptable_expired_cert(err_cert) | ||
92 | return 1; | ||
93 | } | ||
94 | return ok; | ||
95 | } | ||
96 | |||
97 | Full featured logging callback. In this case the B<bio_err> is assumed to be | ||
98 | a global logging B<BIO>, an alternative would to store a BIO in B<ctx> using | ||
99 | B<ex_data>. | ||
100 | |||
101 | int | ||
102 | verify_callback(int ok, X509_STORE_CTX *ctx) | ||
103 | { | ||
104 | X509 *err_cert; | ||
105 | int err,depth; | ||
106 | |||
107 | err_cert = X509_STORE_CTX_get_current_cert(ctx); | ||
108 | err = X509_STORE_CTX_get_error(ctx); | ||
109 | depth = X509_STORE_CTX_get_error_depth(ctx); | ||
110 | |||
111 | BIO_printf(bio_err,"depth=%d ",depth); | ||
112 | if (err_cert) { | ||
113 | X509_NAME_print_ex(bio_err, | ||
114 | X509_get_subject_name(err_cert), 0, | ||
115 | XN_FLAG_ONELINE); | ||
116 | BIO_puts(bio_err, "\n"); | ||
117 | } else | ||
118 | BIO_puts(bio_err, "<no cert>\n"); | ||
119 | if (!ok) | ||
120 | BIO_printf(bio_err, "verify error:num=%d:%s\n", | ||
121 | err, X509_verify_cert_error_string(err)); | ||
122 | switch (err) { | ||
123 | case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: | ||
124 | BIO_puts(bio_err, "issuer= "); | ||
125 | X509_NAME_print_ex(bio_err, | ||
126 | X509_get_issuer_name(err_cert), 0, | ||
127 | XN_FLAG_ONELINE); | ||
128 | BIO_puts(bio_err, "\n"); | ||
129 | break; | ||
130 | case X509_V_ERR_CERT_NOT_YET_VALID: | ||
131 | case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: | ||
132 | BIO_printf(bio_err, "notBefore="); | ||
133 | ASN1_TIME_print(bio_err, | ||
134 | X509_get_notBefore(err_cert)); | ||
135 | BIO_printf(bio_err, "\n"); | ||
136 | break; | ||
137 | case X509_V_ERR_CERT_HAS_EXPIRED: | ||
138 | case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: | ||
139 | BIO_printf(bio_err, "notAfter="); | ||
140 | ASN1_TIME_print(bio_err, X509_get_notAfter(err_cert)); | ||
141 | BIO_printf(bio_err, "\n"); | ||
142 | break; | ||
143 | case X509_V_ERR_NO_EXPLICIT_POLICY: | ||
144 | policies_print(bio_err, ctx); | ||
145 | break; | ||
146 | } | ||
147 | if (err == X509_V_OK && ok == 2) | ||
148 | /* print out policies */ | ||
149 | |||
150 | BIO_printf(bio_err,"verify return:%d\n",ok); | ||
151 | return(ok); | ||
152 | } | ||
153 | |||
154 | =head1 SEE ALSO | ||
155 | |||
156 | L<X509_STORE_CTX_get_error(3)|X509_STORE_CTX_get_error(3)> | ||
157 | L<X509_STORE_set_verify_cb_func(3)|X509_STORE_set_verify_cb_func(3)> | ||
158 | L<X509_STORE_CTX_get_ex_new_index(3)|X509_STORE_CTX_get_ex_new_index(3)> | ||
159 | |||
160 | =head1 HISTORY | ||
161 | |||
162 | X509_STORE_CTX_set_verify_cb() is available in all versions of SSLeay and | ||
163 | OpenSSL. | ||
164 | |||
165 | =cut | ||
diff --git a/src/lib/libcrypto/doc/X509_STORE_set_verify_cb_func.pod b/src/lib/libcrypto/doc/X509_STORE_set_verify_cb_func.pod deleted file mode 100644 index 754512341c..0000000000 --- a/src/lib/libcrypto/doc/X509_STORE_set_verify_cb_func.pod +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | X509_STORE_set_verify_cb_func, X509_STORE_set_verify_cb - set verification | ||
6 | callback | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/x509_vfy.h> | ||
11 | |||
12 | void X509_STORE_set_verify_cb(X509_STORE *st, | ||
13 | int (*verify_cb)(int ok, X509_STORE_CTX *ctx)); | ||
14 | |||
15 | void X509_STORE_set_verify_cb_func(X509_STORE *st, | ||
16 | int (*verify_cb)(int ok, X509_STORE_CTX *ctx)); | ||
17 | |||
18 | =head1 DESCRIPTION | ||
19 | |||
20 | X509_STORE_set_verify_cb() sets the verification callback of B<ctx> to | ||
21 | B<verify_cb> overwriting any existing callback. | ||
22 | |||
23 | X509_STORE_set_verify_cb_func() also sets the verification callback but it | ||
24 | is implemented as a macro. | ||
25 | |||
26 | =head1 NOTES | ||
27 | |||
28 | The verification callback from an B<X509_STORE> is inherited by | ||
29 | the corresponding B<X509_STORE_CTX> structure when it is initialized. This can | ||
30 | be used to set the verification callback when the B<X509_STORE_CTX> is | ||
31 | otherwise inaccessible (for example during S/MIME verification). | ||
32 | |||
33 | =head1 BUGS | ||
34 | |||
35 | The macro version of this function was the only one available before | ||
36 | OpenSSL 1.0.0. | ||
37 | |||
38 | =head1 RETURN VALUES | ||
39 | |||
40 | X509_STORE_set_verify_cb() and X509_STORE_set_verify_cb_func() do not return | ||
41 | a value. | ||
42 | |||
43 | =head1 SEE ALSO | ||
44 | |||
45 | L<X509_STORE_CTX_set_verify_cb(3)|X509_STORE_CTX_set_verify_cb(3)> | ||
46 | |||
47 | =head1 HISTORY | ||
48 | |||
49 | X509_STORE_set_verify_cb_func() is available in all versions of SSLeay and | ||
50 | OpenSSL. | ||
51 | |||
52 | X509_STORE_set_verify_cb() was added to OpenSSL 1.0.0. | ||
53 | |||
54 | =cut | ||
diff --git a/src/lib/libcrypto/doc/X509_VERIFY_PARAM_set_flags.pod b/src/lib/libcrypto/doc/X509_VERIFY_PARAM_set_flags.pod deleted file mode 100644 index 6c88aec49e..0000000000 --- a/src/lib/libcrypto/doc/X509_VERIFY_PARAM_set_flags.pod +++ /dev/null | |||
@@ -1,172 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | X509_VERIFY_PARAM_set_flags, X509_VERIFY_PARAM_clear_flags, | ||
6 | X509_VERIFY_PARAM_get_flags, X509_VERIFY_PARAM_set_purpose, | ||
7 | X509_VERIFY_PARAM_set_trust, X509_VERIFY_PARAM_set_depth, | ||
8 | X509_VERIFY_PARAM_get_depth, X509_VERIFY_PARAM_set_time, | ||
9 | X509_VERIFY_PARAM_add0_policy, X509_VERIFY_PARAM_set1_policies - X509 | ||
10 | verification parameters | ||
11 | |||
12 | =head1 SYNOPSIS | ||
13 | |||
14 | #include <openssl/x509_vfy.h> | ||
15 | |||
16 | int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param, unsigned long flags); | ||
17 | int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param, | ||
18 | unsigned long flags); | ||
19 | unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param); | ||
20 | |||
21 | int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose); | ||
22 | int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust); | ||
23 | |||
24 | void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t); | ||
25 | |||
26 | int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, | ||
27 | ASN1_OBJECT *policy); | ||
28 | int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, | ||
29 | STACK_OF(ASN1_OBJECT) *policies); | ||
30 | |||
31 | void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth); | ||
32 | int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param); | ||
33 | |||
34 | =head1 DESCRIPTION | ||
35 | |||
36 | These functions manipulate the B<X509_VERIFY_PARAM> structure associated with | ||
37 | a certificate verification operation. | ||
38 | |||
39 | The X509_VERIFY_PARAM_set_flags() function sets the flags in B<param> by oring | ||
40 | it with B<flags>. See the B<VERIFICATION FLAGS> section for a complete | ||
41 | description of values the B<flags> parameter can take. | ||
42 | |||
43 | X509_VERIFY_PARAM_get_flags() returns the flags in B<param>. | ||
44 | |||
45 | X509_VERIFY_PARAM_clear_flags() clears the flags B<flags> in B<param>. | ||
46 | |||
47 | X509_VERIFY_PARAM_set_purpose() sets the verification purpose in B<param> | ||
48 | to B<purpose>. This determines the acceptable purpose of the certificate | ||
49 | chain, for example SSL client or SSL server. | ||
50 | |||
51 | X509_VERIFY_PARAM_set_trust() sets the trust setting in B<param> to | ||
52 | B<trust>. | ||
53 | |||
54 | X509_VERIFY_PARAM_set_time() sets the verification time in B<param> to | ||
55 | B<t>. Normally the current time is used. | ||
56 | |||
57 | X509_VERIFY_PARAM_add0_policy() enables policy checking (it is disabled | ||
58 | by default) and adds B<policy> to the acceptable policy set. | ||
59 | |||
60 | X509_VERIFY_PARAM_set1_policies() enables policy checking (it is disabled | ||
61 | by default) and sets the acceptable policy set to B<policies>. Any existing | ||
62 | policy set is cleared. The B<policies> parameter can be B<NULL> to clear | ||
63 | an existing policy set. | ||
64 | |||
65 | X509_VERIFY_PARAM_set_depth() sets the maximum verification depth to B<depth>. | ||
66 | That is the maximum number of untrusted CA certificates that can appear in a | ||
67 | chain. | ||
68 | |||
69 | =head1 RETURN VALUES | ||
70 | |||
71 | X509_VERIFY_PARAM_set_flags(), X509_VERIFY_PARAM_clear_flags(), | ||
72 | X509_VERIFY_PARAM_set_purpose(), X509_VERIFY_PARAM_set_trust(), | ||
73 | X509_VERIFY_PARAM_add0_policy() and X509_VERIFY_PARAM_set1_policies() return 1 | ||
74 | for success and 0 for failure. | ||
75 | |||
76 | X509_VERIFY_PARAM_get_flags() returns the current verification flags. | ||
77 | |||
78 | X509_VERIFY_PARAM_set_time() and X509_VERIFY_PARAM_set_depth() do not return | ||
79 | values. | ||
80 | |||
81 | X509_VERIFY_PARAM_get_depth() returns the current verification depth. | ||
82 | |||
83 | =head1 VERIFICATION FLAGS | ||
84 | |||
85 | The verification flags consists of zero or more of the following flags | ||
86 | ored together. | ||
87 | |||
88 | B<X509_V_FLAG_CRL_CHECK> enables CRL checking for the certificate chain leaf | ||
89 | certificate. An error occurs if a suitable CRL cannot be found. | ||
90 | |||
91 | B<X509_V_FLAG_CRL_CHECK_ALL> enables CRL checking for the entire certificate | ||
92 | chain. | ||
93 | |||
94 | B<X509_V_FLAG_IGNORE_CRITICAL> disabled critical extension checking. By default | ||
95 | any unhandled critical extensions in certificates or (if checked) CRLs results | ||
96 | in a fatal error. If this flag is set unhandled critical extensions are | ||
97 | ignored. B<WARNING> setting this option for anything other than debugging | ||
98 | purposes can be a security risk. Finer control over which extensions are | ||
99 | supported can be performed in the verification callback. | ||
100 | |||
101 | THe B<X509_V_FLAG_X509_STRICT> flag disables workarounds for some broken | ||
102 | certificates and makes the verification strictly apply B<X509> rules. | ||
103 | |||
104 | B<X509_V_FLAG_ALLOW_PROXY_CERTS> enables proxy certificate verification. | ||
105 | |||
106 | B<X509_V_FLAG_POLICY_CHECK> enables certificate policy checking, by default | ||
107 | no policy checking is performed. Additional information is sent to the | ||
108 | verification callback relating to policy checking. | ||
109 | |||
110 | B<X509_V_FLAG_EXPLICIT_POLICY>, B<X509_V_FLAG_INHIBIT_ANY> and | ||
111 | B<X509_V_FLAG_INHIBIT_MAP> set the B<require explicit policy>, B<inhibit any | ||
112 | policy> and B<inhibit policy mapping> flags respectively as defined in | ||
113 | B<RFC3280>. Policy checking is automatically enabled if any of these flags | ||
114 | are set. | ||
115 | |||
116 | If B<X509_V_FLAG_NOTIFY_POLICY> is set and the policy checking is successful | ||
117 | a special status code is set to the verification callback. This permits it | ||
118 | to examine the valid policy tree and perform additional checks or simply | ||
119 | log it for debugging purposes. | ||
120 | |||
121 | By default some additional features such as indirect CRLs and CRLs signed by | ||
122 | different keys are disabled. If B<X509_V_FLAG_EXTENDED_CRL_SUPPORT> is set | ||
123 | they are enabled. | ||
124 | |||
125 | If B<X509_V_FLAG_USE_DELTAS> ise set delta CRLs (if present) are used to | ||
126 | determine certificate status. If not set deltas are ignored. | ||
127 | |||
128 | B<X509_V_FLAG_CHECK_SS_SIGNATURE> enables checking of the root CA self signed | ||
129 | certificate signature. By default this check is disabled because it doesn't | ||
130 | add any additional security but in some cases applications might want to | ||
131 | check the signature anyway. A side effect of not checking the root CA | ||
132 | signature is that disabled or unsupported message digests on the root CA | ||
133 | are not treated as fatal errors. | ||
134 | |||
135 | The B<X509_V_FLAG_CB_ISSUER_CHECK> flag enables debugging of certificate | ||
136 | issuer checks. It is B<not> needed unless you are logging certificate | ||
137 | verification. If this flag is set then additional status codes will be sent | ||
138 | to the verification callback and it B<must> be prepared to handle such cases | ||
139 | without assuming they are hard errors. | ||
140 | |||
141 | =head1 NOTES | ||
142 | |||
143 | The above functions should be used to manipulate verification parameters | ||
144 | instead of legacy functions which work in specific structures such as | ||
145 | X509_STORE_CTX_set_flags(). | ||
146 | |||
147 | =head1 BUGS | ||
148 | |||
149 | Delta CRL checking is currently primitive. Only a single delta can be used and | ||
150 | (partly due to limitations of B<X509_STORE>) constructed CRLs are not | ||
151 | maintained. | ||
152 | |||
153 | If CRLs checking is enable CRLs are expected to be available in the | ||
154 | corresponding B<X509_STORE> structure. No attempt is made to download | ||
155 | CRLs from the CRL distribution points extension. | ||
156 | |||
157 | =head1 EXAMPLE | ||
158 | |||
159 | Enable CRL checking when performing certificate verification during SSL | ||
160 | connections associated with an B<SSL_CTX> structure B<ctx>: | ||
161 | |||
162 | X509_VERIFY_PARAM *param; | ||
163 | param = X509_VERIFY_PARAM_new(); | ||
164 | X509_VERIFY_PARAM_set_flags(param, X509_V_FLAG_CRL_CHECK); | ||
165 | SSL_CTX_set1_param(ctx, param); | ||
166 | X509_VERIFY_PARAM_free(param); | ||
167 | |||
168 | =head1 SEE ALSO | ||
169 | |||
170 | L<X509_verify_cert(3)|X509_verify_cert(3)> | ||
171 | |||
172 | =cut | ||
diff --git a/src/lib/libcrypto/doc/X509_new.pod b/src/lib/libcrypto/doc/X509_new.pod deleted file mode 100644 index a36808b825..0000000000 --- a/src/lib/libcrypto/doc/X509_new.pod +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | X509_new, X509_free - X509 certificate ASN1 allocation functions | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/x509.h> | ||
10 | |||
11 | X509 *X509_new(void); | ||
12 | void X509_free(X509 *a); | ||
13 | |||
14 | =head1 DESCRIPTION | ||
15 | |||
16 | The X509 ASN1 allocation routines, allocate and free an | ||
17 | X509 structure, which represents an X509 certificate. | ||
18 | |||
19 | X509_new() allocates and initializes a X509 structure. | ||
20 | |||
21 | X509_free() frees up the B<X509> structure B<a>. | ||
22 | If B<a> is a B<NULL> pointer, no action occurs. | ||
23 | |||
24 | =head1 RETURN VALUES | ||
25 | |||
26 | If the allocation fails, X509_new() returns B<NULL> and sets an error | ||
27 | code that can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
28 | Otherwise it returns a pointer to the newly allocated structure. | ||
29 | |||
30 | =head1 SEE ALSO | ||
31 | |||
32 | L<ERR_get_error(3)|ERR_get_error(3)>, L<d2i_X509(3)|d2i_X509(3)> | ||
33 | |||
34 | =head1 HISTORY | ||
35 | |||
36 | X509_new() and X509_free() are available in all versions of SSLeay and OpenSSL. | ||
37 | |||
38 | =cut | ||
diff --git a/src/lib/libcrypto/doc/X509_verify_cert.pod b/src/lib/libcrypto/doc/X509_verify_cert.pod deleted file mode 100644 index f05edd8333..0000000000 --- a/src/lib/libcrypto/doc/X509_verify_cert.pod +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | X509_verify_cert - discover and verify X509 certificate chain | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/x509.h> | ||
10 | |||
11 | int X509_verify_cert(X509_STORE_CTX *ctx); | ||
12 | |||
13 | =head1 DESCRIPTION | ||
14 | |||
15 | The X509_verify_cert() function attempts to discover and validate a | ||
16 | certificate chain based on parameters in B<ctx>. A complete description of | ||
17 | the process is contained in the L<verify(1)|verify(1)> manual page. | ||
18 | |||
19 | =head1 RETURN VALUES | ||
20 | |||
21 | If a complete chain can be built and validated this function returns 1, | ||
22 | otherwise it return zero, in exceptional circumstances it can also | ||
23 | return a negative code. | ||
24 | |||
25 | If the function fails additional error information can be obtained by | ||
26 | examining B<ctx> using, for example X509_STORE_CTX_get_error(). | ||
27 | |||
28 | =head1 NOTES | ||
29 | |||
30 | Applications rarely call this function directly but it is used by | ||
31 | OpenSSL internally for certificate validation, in both the S/MIME and | ||
32 | SSL/TLS code. | ||
33 | |||
34 | The negative return value from X509_verify_cert() can only occur if no | ||
35 | certificate is set in B<ctx> (due to a programming error) or if a retry | ||
36 | operation is requested during internal lookups (which never happens with | ||
37 | standard lookup methods). It is however recommended that application check | ||
38 | for <= 0 return value on error. | ||
39 | |||
40 | =head1 BUGS | ||
41 | |||
42 | This function uses the header B<x509.h> as opposed to most chain verification | ||
43 | functions which use B<x509_vfy.h>. | ||
44 | |||
45 | =head1 SEE ALSO | ||
46 | |||
47 | L<X509_STORE_CTX_get_error(3)|X509_STORE_CTX_get_error(3)> | ||
48 | |||
49 | =head1 HISTORY | ||
50 | |||
51 | X509_verify_cert() is available in all versions of SSLeay and OpenSSL. | ||
52 | |||
53 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_X509.pod b/src/lib/libcrypto/doc/d2i_X509.pod deleted file mode 100644 index fad4e8c35b..0000000000 --- a/src/lib/libcrypto/doc/d2i_X509.pod +++ /dev/null | |||
@@ -1,231 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | d2i_X509, i2d_X509, d2i_X509_bio, d2i_X509_fp, i2d_X509_bio, | ||
6 | i2d_X509_fp - X509 encode and decode functions | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/x509.h> | ||
11 | |||
12 | X509 *d2i_X509(X509 **px, const unsigned char **in, int len); | ||
13 | int i2d_X509(X509 *x, unsigned char **out); | ||
14 | |||
15 | X509 *d2i_X509_bio(BIO *bp, X509 **x); | ||
16 | X509 *d2i_X509_fp(FILE *fp, X509 **x); | ||
17 | |||
18 | int i2d_X509_bio(BIO *bp, X509 *x); | ||
19 | int i2d_X509_fp(FILE *fp, X509 *x); | ||
20 | |||
21 | =head1 DESCRIPTION | ||
22 | |||
23 | The X509 encode and decode routines encode and parse an | ||
24 | B<X509> structure, which represents an X509 certificate. | ||
25 | |||
26 | d2i_X509() attempts to decode B<len> bytes at B<*in>. If | ||
27 | successful a pointer to the B<X509> structure is returned. If an error | ||
28 | occurred then B<NULL> is returned. If B<px> is not B<NULL> then the | ||
29 | returned structure is written to B<*px>. If B<*px> is not B<NULL> | ||
30 | then it is assumed that B<*px> contains a valid B<X509> | ||
31 | structure and an attempt is made to reuse it. If the call is | ||
32 | successful B<*in> is incremented to the byte following the | ||
33 | parsed data. | ||
34 | |||
35 | i2d_X509() encodes the structure pointed to by B<x> into DER format. | ||
36 | If B<out> is not B<NULL> is writes the DER encoded data to the buffer | ||
37 | at B<*out>, and increments it to point after the data just written. | ||
38 | If the return value is negative an error occurred, otherwise it | ||
39 | returns the length of the encoded data. | ||
40 | |||
41 | For OpenSSL 0.9.7 and later if B<*out> is B<NULL> memory will be | ||
42 | allocated for a buffer and the encoded data written to it. In this | ||
43 | case B<*out> is not incremented and it points to the start of the | ||
44 | data just written. | ||
45 | |||
46 | d2i_X509_bio() is similar to d2i_X509() except it attempts | ||
47 | to parse data from BIO B<bp>. | ||
48 | |||
49 | d2i_X509_fp() is similar to d2i_X509() except it attempts | ||
50 | to parse data from FILE pointer B<fp>. | ||
51 | |||
52 | i2d_X509_bio() is similar to i2d_X509() except it writes | ||
53 | the encoding of the structure B<x> to BIO B<bp> and it | ||
54 | returns 1 for success and 0 for failure. | ||
55 | |||
56 | i2d_X509_fp() is similar to i2d_X509() except it writes | ||
57 | the encoding of the structure B<x> to BIO B<bp> and it | ||
58 | returns 1 for success and 0 for failure. | ||
59 | |||
60 | =head1 NOTES | ||
61 | |||
62 | The letters B<i> and B<d> in for example B<i2d_X509> stand for | ||
63 | "internal" (that is an internal C structure) and "DER". So that | ||
64 | B<i2d_X509> converts from internal to DER. | ||
65 | |||
66 | The functions can also understand B<BER> forms. | ||
67 | |||
68 | The actual X509 structure passed to i2d_X509() must be a valid | ||
69 | populated B<X509> structure it can B<not> simply be fed with an | ||
70 | empty structure such as that returned by X509_new(). | ||
71 | |||
72 | The encoded data is in binary form and may contain embedded zeroes. | ||
73 | Therefore any FILE pointers or BIOs should be opened in binary mode. | ||
74 | Functions such as B<strlen()> will B<not> return the correct length | ||
75 | of the encoded structure. | ||
76 | |||
77 | The ways that B<*in> and B<*out> are incremented after the operation | ||
78 | can trap the unwary. See the B<WARNINGS> section for some common | ||
79 | errors. | ||
80 | |||
81 | The reason for the auto increment behaviour is to reflect a typical | ||
82 | usage of ASN1 functions: after one structure is encoded or decoded | ||
83 | another will processed after it. | ||
84 | |||
85 | =head1 EXAMPLES | ||
86 | |||
87 | Allocate and encode the DER encoding of an X509 structure: | ||
88 | |||
89 | int len; | ||
90 | unsigned char *buf, *p; | ||
91 | |||
92 | len = i2d_X509(x, NULL); | ||
93 | |||
94 | buf = malloc(len); | ||
95 | |||
96 | if (buf == NULL) | ||
97 | /* error */ | ||
98 | |||
99 | p = buf; | ||
100 | |||
101 | i2d_X509(x, &p); | ||
102 | |||
103 | If you are using OpenSSL 0.9.7 or later then this can be | ||
104 | simplified to: | ||
105 | |||
106 | |||
107 | int len; | ||
108 | unsigned char *buf; | ||
109 | |||
110 | buf = NULL; | ||
111 | |||
112 | len = i2d_X509(x, &buf); | ||
113 | |||
114 | if (len < 0) | ||
115 | /* error */ | ||
116 | |||
117 | Attempt to decode a buffer: | ||
118 | |||
119 | X509 *x; | ||
120 | |||
121 | unsigned char *buf, *p; | ||
122 | |||
123 | int len; | ||
124 | |||
125 | /* Something to setup buf and len */ | ||
126 | |||
127 | p = buf; | ||
128 | |||
129 | x = d2i_X509(NULL, &p, len); | ||
130 | |||
131 | if (x == NULL) | ||
132 | /* Some error */ | ||
133 | |||
134 | Alternative technique: | ||
135 | |||
136 | X509 *x; | ||
137 | |||
138 | unsigned char *buf, *p; | ||
139 | |||
140 | int len; | ||
141 | |||
142 | /* Something to setup buf and len */ | ||
143 | |||
144 | p = buf; | ||
145 | |||
146 | x = NULL; | ||
147 | |||
148 | if(!d2i_X509(&x, &p, len)) | ||
149 | /* Some error */ | ||
150 | |||
151 | |||
152 | =head1 WARNINGS | ||
153 | |||
154 | The use of temporary variable is mandatory. A common | ||
155 | mistake is to attempt to use a buffer directly as follows: | ||
156 | |||
157 | int len; | ||
158 | unsigned char *buf; | ||
159 | |||
160 | len = i2d_X509(x, NULL); | ||
161 | |||
162 | buf = malloc(len); | ||
163 | |||
164 | if (buf == NULL) | ||
165 | /* error */ | ||
166 | |||
167 | i2d_X509(x, &buf); | ||
168 | |||
169 | /* Other stuff ... */ | ||
170 | |||
171 | free(buf); | ||
172 | |||
173 | This code will result in B<buf> apparently containing garbage because | ||
174 | it was incremented after the call to point after the data just written. | ||
175 | Also B<buf> will no longer contain the pointer allocated by B<malloc()> | ||
176 | and the subsequent call to B<free()> may well crash. | ||
177 | |||
178 | The auto allocation feature (setting buf to NULL) only works on OpenSSL | ||
179 | 0.9.7 and later. Attempts to use it on earlier versions will typically | ||
180 | cause a segmentation violation. | ||
181 | |||
182 | Another trap to avoid is misuse of the B<xp> argument to B<d2i_X509()>: | ||
183 | |||
184 | X509 *x; | ||
185 | |||
186 | if (!d2i_X509(&x, &p, len)) | ||
187 | /* Some error */ | ||
188 | |||
189 | This will probably crash somewhere in B<d2i_X509()>. The reason for this | ||
190 | is that the variable B<x> is uninitialized and an attempt will be made to | ||
191 | interpret its (invalid) value as an B<X509> structure, typically causing | ||
192 | a segmentation violation. If B<x> is set to NULL first then this will not | ||
193 | happen. | ||
194 | |||
195 | =head1 BUGS | ||
196 | |||
197 | In some versions of OpenSSL the "reuse" behaviour of d2i_X509() when | ||
198 | B<*px> is valid is broken and some parts of the reused structure may | ||
199 | persist if they are not present in the new one. As a result the use | ||
200 | of this "reuse" behaviour is strongly discouraged. | ||
201 | |||
202 | i2d_X509() will not return an error in many versions of OpenSSL, | ||
203 | if mandatory fields are not initialized due to a programming error | ||
204 | then the encoded structure may contain invalid data or omit the | ||
205 | fields entirely and will not be parsed by d2i_X509(). This may be | ||
206 | fixed in future so code should not assume that i2d_X509() will | ||
207 | always succeed. | ||
208 | |||
209 | =head1 RETURN VALUES | ||
210 | |||
211 | d2i_X509(), d2i_X509_bio() and d2i_X509_fp() return a valid B<X509> structure | ||
212 | or B<NULL> if an error occurs. The error code that can be obtained by | ||
213 | L<ERR_get_error(3)|ERR_get_error(3)>. | ||
214 | |||
215 | i2d_X509() returns the number of bytes successfully encoded or a negative | ||
216 | value if an error occurs. The error code can be obtained by | ||
217 | L<ERR_get_error(3)|ERR_get_error(3)>. | ||
218 | |||
219 | i2d_X509_bio() and i2d_X509_fp() return 1 for success and 0 if an error | ||
220 | occurs The error code can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
221 | |||
222 | =head1 SEE ALSO | ||
223 | |||
224 | L<ERR_get_error(3)|ERR_get_error(3)> | ||
225 | |||
226 | =head1 HISTORY | ||
227 | |||
228 | d2i_X509, i2d_X509, d2i_X509_bio, d2i_X509_fp, i2d_X509_bio and i2d_X509_fp | ||
229 | are available in all versions of SSLeay and OpenSSL. | ||
230 | |||
231 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_X509_ALGOR.pod b/src/lib/libcrypto/doc/d2i_X509_ALGOR.pod deleted file mode 100644 index 68011679fd..0000000000 --- a/src/lib/libcrypto/doc/d2i_X509_ALGOR.pod +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | d2i_X509_ALGOR, i2d_X509_ALGOR - AlgorithmIdentifier functions. | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/x509.h> | ||
10 | |||
11 | X509_ALGOR *d2i_X509_ALGOR(X509_ALGOR **a, unsigned char **pp, long length); | ||
12 | int i2d_X509_ALGOR(X509_ALGOR *a, unsigned char **pp); | ||
13 | |||
14 | =head1 DESCRIPTION | ||
15 | |||
16 | These functions decode and encode an B<X509_ALGOR> structure which is | ||
17 | equivalent to the B<AlgorithmIdentifier> structure. | ||
18 | |||
19 | Othewise these behave in a similar way to d2i_X509() and i2d_X509() | ||
20 | described in the L<d2i_X509(3)|d2i_X509(3)> manual page. | ||
21 | |||
22 | =head1 SEE ALSO | ||
23 | |||
24 | L<d2i_X509(3)|d2i_X509(3)> | ||
25 | |||
26 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_X509_CRL.pod b/src/lib/libcrypto/doc/d2i_X509_CRL.pod deleted file mode 100644 index 563e4de8e0..0000000000 --- a/src/lib/libcrypto/doc/d2i_X509_CRL.pod +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | d2i_X509_CRL, i2d_X509_CRL, d2i_X509_CRL_bio, d2i_X509_CRL_fp, | ||
6 | i2d_X509_CRL_bio, i2d_X509_CRL_fp - PKCS#10 certificate request functions. | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/x509.h> | ||
11 | |||
12 | X509_CRL *d2i_X509_CRL(X509_CRL **a, const unsigned char **pp, long length); | ||
13 | int i2d_X509_CRL(X509_CRL *a, unsigned char **pp); | ||
14 | |||
15 | X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **x); | ||
16 | X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **x); | ||
17 | |||
18 | int i2d_X509_CRL_bio(BIO *bp, X509_CRL *x); | ||
19 | int i2d_X509_CRL_fp(FILE *fp, X509_CRL *x); | ||
20 | |||
21 | =head1 DESCRIPTION | ||
22 | |||
23 | These functions decode and encode an X509 CRL (certificate revocation | ||
24 | list). | ||
25 | |||
26 | Othewise the functions behave in a similar way to d2i_X509() and i2d_X509() | ||
27 | described in the L<d2i_X509(3)|d2i_X509(3)> manual page. | ||
28 | |||
29 | =head1 SEE ALSO | ||
30 | |||
31 | L<d2i_X509(3)|d2i_X509(3)> | ||
32 | |||
33 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_X509_NAME.pod b/src/lib/libcrypto/doc/d2i_X509_NAME.pod deleted file mode 100644 index 2219885338..0000000000 --- a/src/lib/libcrypto/doc/d2i_X509_NAME.pod +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | d2i_X509_NAME, i2d_X509_NAME - X509_NAME encoding functions | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/x509.h> | ||
10 | |||
11 | X509_NAME *d2i_X509_NAME(X509_NAME **a, unsigned char **pp, long length); | ||
12 | int i2d_X509_NAME(X509_NAME *a, unsigned char **pp); | ||
13 | |||
14 | =head1 DESCRIPTION | ||
15 | |||
16 | These functions decode and encode an B<X509_NAME> structure which is the | ||
17 | same as the B<Name> type defined in RFC2459 (and elsewhere) and used | ||
18 | for example in certificate subject and issuer names. | ||
19 | |||
20 | Othewise the functions behave in a similar way to d2i_X509() and i2d_X509() | ||
21 | described in the L<d2i_X509(3)|d2i_X509(3)> manual page. | ||
22 | |||
23 | =head1 SEE ALSO | ||
24 | |||
25 | L<d2i_X509(3)|d2i_X509(3)> | ||
26 | |||
27 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_X509_REQ.pod b/src/lib/libcrypto/doc/d2i_X509_REQ.pod deleted file mode 100644 index baa8ae391e..0000000000 --- a/src/lib/libcrypto/doc/d2i_X509_REQ.pod +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | d2i_X509_REQ, i2d_X509_REQ, d2i_X509_REQ_bio, d2i_X509_REQ_fp, | ||
6 | i2d_X509_REQ_bio, i2d_X509_REQ_fp - PKCS#10 certificate request functions. | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/x509.h> | ||
11 | |||
12 | X509_REQ *d2i_X509_REQ(X509_REQ **a, const unsigned char **pp, long length); | ||
13 | int i2d_X509_REQ(X509_REQ *a, unsigned char **pp); | ||
14 | |||
15 | X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **x); | ||
16 | X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **x); | ||
17 | |||
18 | int i2d_X509_REQ_bio(BIO *bp, X509_REQ *x); | ||
19 | int i2d_X509_REQ_fp(FILE *fp, X509_REQ *x); | ||
20 | |||
21 | =head1 DESCRIPTION | ||
22 | |||
23 | These functions decode and encode a PKCS#10 certificate request. | ||
24 | |||
25 | Othewise these behave in a similar way to d2i_X509() and i2d_X509() | ||
26 | described in the L<d2i_X509(3)|d2i_X509(3)> manual page. | ||
27 | |||
28 | =head1 SEE ALSO | ||
29 | |||
30 | L<d2i_X509(3)|d2i_X509(3)> | ||
31 | |||
32 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_X509_SIG.pod b/src/lib/libcrypto/doc/d2i_X509_SIG.pod deleted file mode 100644 index 00d03f5ba1..0000000000 --- a/src/lib/libcrypto/doc/d2i_X509_SIG.pod +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | d2i_X509_SIG, i2d_X509_SIG - DigestInfo functions. | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/x509.h> | ||
10 | |||
11 | X509_SIG *d2i_X509_SIG(X509_SIG **a, unsigned char **pp, long length); | ||
12 | int i2d_X509_SIG(X509_SIG *a, unsigned char **pp); | ||
13 | |||
14 | =head1 DESCRIPTION | ||
15 | |||
16 | These functions decode and encode an X509_SIG structure which is | ||
17 | equivalent to the B<DigestInfo> structure defined in PKCS#1 and PKCS#7. | ||
18 | |||
19 | Othewise these behave in a similar way to d2i_X509() and i2d_X509() | ||
20 | described in the L<d2i_X509(3)|d2i_X509(3)> manual page. | ||
21 | |||
22 | =head1 SEE ALSO | ||
23 | |||
24 | L<d2i_X509(3)|d2i_X509(3)> | ||
25 | |||
26 | =cut | ||
diff --git a/src/lib/libcrypto/doc/x509.pod b/src/lib/libcrypto/doc/x509.pod deleted file mode 100644 index f9e58e0e41..0000000000 --- a/src/lib/libcrypto/doc/x509.pod +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | x509 - X.509 certificate handling | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/x509.h> | ||
10 | |||
11 | =head1 DESCRIPTION | ||
12 | |||
13 | A X.509 certificate is a structured grouping of information about | ||
14 | an individual, a device, or anything one can imagine. A X.509 CRL | ||
15 | (certificate revocation list) is a tool to help determine if a | ||
16 | certificate is still valid. The exact definition of those can be | ||
17 | found in the X.509 document from ITU-T, or in RFC3280 from PKIX. | ||
18 | In OpenSSL, the type X509 is used to express such a certificate, and | ||
19 | the type X509_CRL is used to express a CRL. | ||
20 | |||
21 | A related structure is a certificate request, defined in PKCS#10 from | ||
22 | RSA Security, Inc, also reflected in RFC2896. In OpenSSL, the type | ||
23 | X509_REQ is used to express such a certificate request. | ||
24 | |||
25 | To handle some complex parts of a certificate, there are the types | ||
26 | X509_NAME (to express a certificate name), X509_ATTRIBUTE (to express | ||
27 | a certificate attributes), X509_EXTENSION (to express a certificate | ||
28 | extension) and a few more. | ||
29 | |||
30 | Finally, there's the supertype X509_INFO, which can contain a CRL, a | ||
31 | certificate and a corresponding private key. | ||
32 | |||
33 | B<X509_>I<...>, B<d2i_X509_>I<...> and B<i2d_X509_>I<...> handle X.509 | ||
34 | certificates, with some exceptions, shown below. | ||
35 | |||
36 | B<X509_CRL_>I<...>, B<d2i_X509_CRL_>I<...> and B<i2d_X509_CRL_>I<...> | ||
37 | handle X.509 CRLs. | ||
38 | |||
39 | B<X509_REQ_>I<...>, B<d2i_X509_REQ_>I<...> and B<i2d_X509_REQ_>I<...> | ||
40 | handle PKCS#10 certificate requests. | ||
41 | |||
42 | B<X509_NAME_>I<...> handle certificate names. | ||
43 | |||
44 | B<X509_ATTRIBUTE_>I<...> handle certificate attributes. | ||
45 | |||
46 | B<X509_EXTENSION_>I<...> handle certificate extensions. | ||
47 | |||
48 | =head1 SEE ALSO | ||
49 | |||
50 | L<X509_NAME_ENTRY_get_object(3)|X509_NAME_ENTRY_get_object(3)>, | ||
51 | L<X509_NAME_add_entry_by_txt(3)|X509_NAME_add_entry_by_txt(3)>, | ||
52 | L<X509_NAME_add_entry_by_NID(3)|X509_NAME_add_entry_by_NID(3)>, | ||
53 | L<X509_NAME_print_ex(3)|X509_NAME_print_ex(3)>, | ||
54 | L<X509_NAME_new(3)|X509_NAME_new(3)>, | ||
55 | L<d2i_X509(3)|d2i_X509(3)>, | ||
56 | L<d2i_X509_ALGOR(3)|d2i_X509_ALGOR(3)>, | ||
57 | L<d2i_X509_CRL(3)|d2i_X509_CRL(3)>, | ||
58 | L<d2i_X509_NAME(3)|d2i_X509_NAME(3)>, | ||
59 | L<d2i_X509_REQ(3)|d2i_X509_REQ(3)>, | ||
60 | L<d2i_X509_SIG(3)|d2i_X509_SIG(3)>, | ||
61 | L<crypto(3)|crypto(3)>, | ||
62 | L<x509v3(3)|x509v3(3)> | ||
63 | |||
64 | =cut | ||