summaryrefslogtreecommitdiff
path: root/src/lib/libssl/src/doc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/src/doc')
-rw-r--r--src/lib/libssl/src/doc/apps/ec.pod190
-rw-r--r--src/lib/libssl/src/doc/apps/ecparam.pod179
-rw-r--r--src/lib/libssl/src/doc/apps/x509v3_config.pod456
-rw-r--r--src/lib/libssl/src/doc/crypto/ASN1_generate_nconf.pod262
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_BLINDING_new.pod109
-rw-r--r--src/lib/libssl/src/doc/crypto/ERR_set_mark.pod38
-rw-r--r--src/lib/libssl/src/doc/crypto/OPENSSL_Applink.pod21
-rw-r--r--src/lib/libssl/src/doc/crypto/OPENSSL_ia32cap.pod43
-rw-r--r--src/lib/libssl/src/doc/crypto/ecdsa.pod210
-rw-r--r--src/lib/libssl/src/doc/crypto/x509.pod64
10 files changed, 1572 insertions, 0 deletions
diff --git a/src/lib/libssl/src/doc/apps/ec.pod b/src/lib/libssl/src/doc/apps/ec.pod
new file mode 100644
index 0000000000..1d4a36dbf4
--- /dev/null
+++ b/src/lib/libssl/src/doc/apps/ec.pod
@@ -0,0 +1,190 @@
1=pod
2
3=head1 NAME
4
5ec - EC key processing
6
7=head1 SYNOPSIS
8
9B<openssl> B<ec>
10[B<-inform PEM|DER>]
11[B<-outform PEM|DER>]
12[B<-in filename>]
13[B<-passin arg>]
14[B<-out filename>]
15[B<-passout arg>]
16[B<-des>]
17[B<-des3>]
18[B<-idea>]
19[B<-text>]
20[B<-noout>]
21[B<-param_out>]
22[B<-pubin>]
23[B<-pubout>]
24[B<-conv_form arg>]
25[B<-param_enc arg>]
26[B<-engine id>]
27
28=head1 DESCRIPTION
29
30The B<ec> command processes EC keys. They can be converted between various
31forms and their components printed out. B<Note> OpenSSL uses the
32private key format specified in 'SEC 1: Elliptic Curve Cryptography'
33(http://www.secg.org/). To convert a OpenSSL EC private key into the
34PKCS#8 private key format use the B<pkcs8> command.
35
36=head1 COMMAND OPTIONS
37
38=over 4
39
40=item B<-inform DER|PEM>
41
42This specifies the input format. The B<DER> option with a private key uses
43an ASN.1 DER encoded SEC1 private key. When used with a public key it
44uses the SubjectPublicKeyInfo structur as specified in RFC 3280.
45The B<PEM> form is the default format: it consists of the B<DER> format base64
46encoded with additional header and footer lines. In the case of a private key
47PKCS#8 format is also accepted.
48
49=item B<-outform DER|PEM>
50
51This specifies the output format, the options have the same meaning as the
52B<-inform> option.
53
54=item B<-in filename>
55
56This specifies the input filename to read a key from or standard input if this
57option is not specified. If the key is encrypted a pass phrase will be
58prompted for.
59
60=item B<-passin arg>
61
62the input file password source. For more information about the format of B<arg>
63see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>.
64
65=item B<-out filename>
66
67This specifies the output filename to write a key to or standard output by
68is not specified. If any encryption options are set then a pass phrase will be
69prompted for. The output filename should B<not> be the same as the input
70filename.
71
72=item B<-passout arg>
73
74the output file password source. For more information about the format of B<arg>
75see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>.
76
77=item B<-des|-des3|-idea>
78
79These options encrypt the private key with the DES, triple DES, IDEA or
80any other cipher supported by OpenSSL before outputting it. A pass phrase is
81prompted for.
82If none of these options is specified the key is written in plain text. This
83means that using the B<ec> utility to read in an encrypted key with no
84encryption option can be used to remove the pass phrase from a key, or by
85setting the encryption options it can be use to add or change the pass phrase.
86These options can only be used with PEM format output files.
87
88=item B<-text>
89
90prints out the public, private key components and parameters.
91
92=item B<-noout>
93
94this option prevents output of the encoded version of the key.
95
96=item B<-modulus>
97
98this option prints out the value of the public key component of the key.
99
100=item B<-pubin>
101
102by default a private key is read from the input file: with this option a
103public key is read instead.
104
105=item B<-pubout>
106
107by default a private key is output. With this option a public
108key will be output instead. This option is automatically set if the input is
109a public key.
110
111=item B<-conv_form>
112
113This specifies how the points on the elliptic curve are converted
114into octet strings. Possible values are: B<compressed> (the default
115value), B<uncompressed> and B<hybrid>. For more information regarding
116the point conversion forms please read the X9.62 standard.
117B<Note> Due to patent issues the B<compressed> option is disabled
118by default for binary curves and can be enabled by defining
119the preprocessor macro B<OPENSSL_EC_BIN_PT_COMP> at compile time.
120
121=item B<-param_enc arg>
122
123This specifies how the elliptic curve parameters are encoded.
124Possible value are: B<named_curve>, i.e. the ec parameters are
125specified by a OID, or B<explicit> where the ec parameters are
126explicitly given (see RFC 3279 for the definition of the
127EC parameters structures). The default value is B<named_curve>.
128B<Note> the B<implicitlyCA> alternative ,as specified in RFC 3279,
129is currently not implemented in OpenSSL.
130
131=item B<-engine id>
132
133specifying an engine (by it's unique B<id> string) will cause B<req>
134to attempt to obtain a functional reference to the specified engine,
135thus initialising it if needed. The engine will then be set as the default
136for all available algorithms.
137
138=back
139
140=head1 NOTES
141
142The PEM private key format uses the header and footer lines:
143
144 -----BEGIN EC PRIVATE KEY-----
145 -----END EC PRIVATE KEY-----
146
147The PEM public key format uses the header and footer lines:
148
149 -----BEGIN PUBLIC KEY-----
150 -----END PUBLIC KEY-----
151
152=head1 EXAMPLES
153
154To encrypt a private key using triple DES:
155
156 openssl ec -in key.pem -des3 -out keyout.pem
157
158To convert a private key from PEM to DER format:
159
160 openssl ec -in key.pem -outform DER -out keyout.der
161
162To print out the components of a private key to standard output:
163
164 openssl ec -in key.pem -text -noout
165
166To just output the public part of a private key:
167
168 openssl ec -in key.pem -pubout -out pubkey.pem
169
170To change the parameters encoding to B<explicit>:
171
172 openssl ec -in key.pem -param_enc explicit -out keyout.pem
173
174To change the point conversion form to B<compressed>:
175
176 openssl ec -in key.pem -conv_form compressed -out keyout.pem
177
178=head1 SEE ALSO
179
180L<ecparam(1)|ecparam(1)>, L<dsa(1)|dsa(1)>, L<rsa(1)|rsa(1)>
181
182=head1 HISTORY
183
184The ec command was first introduced in OpenSSL 0.9.8.
185
186=head1 AUTHOR
187
188Nils Larsch for the OpenSSL project (http://www.openssl.org).
189
190=cut
diff --git a/src/lib/libssl/src/doc/apps/ecparam.pod b/src/lib/libssl/src/doc/apps/ecparam.pod
new file mode 100644
index 0000000000..1a12105da7
--- /dev/null
+++ b/src/lib/libssl/src/doc/apps/ecparam.pod
@@ -0,0 +1,179 @@
1=pod
2
3=head1 NAME
4
5ecparam - EC parameter manipulation and generation
6
7=head1 SYNOPSIS
8
9B<openssl ecparam>
10[B<-inform DER|PEM>]
11[B<-outform DER|PEM>]
12[B<-in filename>]
13[B<-out filename>]
14[B<-noout>]
15[B<-text>]
16[B<-C>]
17[B<-check>]
18[B<-name arg>]
19[B<-list_curve>]
20[B<-conv_form arg>]
21[B<-param_enc arg>]
22[B<-no_seed>]
23[B<-rand file(s)>]
24[B<-genkey>]
25[B<-engine id>]
26
27=head1 DESCRIPTION
28
29This command is used to manipulate or generate EC parameter files.
30
31=head1 OPTIONS
32
33=over 4
34
35=item B<-inform DER|PEM>
36
37This specifies the input format. The B<DER> option uses an ASN.1 DER encoded
38form compatible with RFC 3279 EcpkParameters. The PEM form is the default
39format: it consists of the B<DER> format base64 encoded with additional
40header and footer lines.
41
42=item B<-outform DER|PEM>
43
44This specifies the output format, the options have the same meaning as the
45B<-inform> option.
46
47=item B<-in filename>
48
49This specifies the input filename to read parameters from or standard input if
50this option is not specified.
51
52=item B<-out filename>
53
54This specifies the output filename parameters to. Standard output is used
55if this option is not present. The output filename should B<not> be the same
56as the input filename.
57
58=item B<-noout>
59
60This option inhibits the output of the encoded version of the parameters.
61
62=item B<-text>
63
64This option prints out the EC parameters in human readable form.
65
66=item B<-C>
67
68This option converts the EC parameters into C code. The parameters can then
69be loaded by calling the B<get_ec_group_XXX()> function.
70
71=item B<-check>
72
73Validate the elliptic curve parameters.
74
75=item B<-name arg>
76
77Use the EC parameters with the specified 'short' name. Use B<-list_curves>
78to get a list of all currently implemented EC parameters.
79
80=item B<-list_curves>
81
82If this options is specified B<ecparam> will print out a list of all
83currently implemented EC parameters names and exit.
84
85=item B<-conv_form>
86
87This specifies how the points on the elliptic curve are converted
88into octet strings. Possible values are: B<compressed> (the default
89value), B<uncompressed> and B<hybrid>. For more information regarding
90the point conversion forms please read the X9.62 standard.
91B<Note> Due to patent issues the B<compressed> option is disabled
92by default for binary curves and can be enabled by defining
93the preprocessor macro B<OPENSSL_EC_BIN_PT_COMP> at compile time.
94
95=item B<-param_enc arg>
96
97This specifies how the elliptic curve parameters are encoded.
98Possible value are: B<named_curve>, i.e. the ec parameters are
99specified by a OID, or B<explicit> where the ec parameters are
100explicitly given (see RFC 3279 for the definition of the
101EC parameters structures). The default value is B<named_curve>.
102B<Note> the B<implicitlyCA> alternative ,as specified in RFC 3279,
103is currently not implemented in OpenSSL.
104
105=item B<-no_seed>
106
107This option inhibits that the 'seed' for the parameter generation
108is included in the ECParameters structure (see RFC 3279).
109
110=item B<-genkey>
111
112This option will generate a EC private key using the specified parameters.
113
114=item B<-rand file(s)>
115
116a file or files containing random data used to seed the random number
117generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>).
118Multiple files can be specified separated by a OS-dependent character.
119The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
120all others.
121
122=item B<-engine id>
123
124specifying an engine (by it's unique B<id> string) will cause B<req>
125to attempt to obtain a functional reference to the specified engine,
126thus initialising it if needed. The engine will then be set as the default
127for all available algorithms.
128
129=back
130
131=head1 NOTES
132
133PEM format EC parameters use the header and footer lines:
134
135 -----BEGIN EC PARAMETERS-----
136 -----END EC PARAMETERS-----
137
138OpenSSL is currently not able to generate new groups and therefore
139B<ecparam> can only create EC parameters from known (named) curves.
140
141=head1 EXAMPLES
142
143To create EC parameters with the group 'prime192v1':
144
145 openssl ecparam -out ec_param.pem -name prime192v1
146
147To create EC parameters with explicit parameters:
148
149 openssl ecparam -out ec_param.pem -name prime192v1 -param_enc explicit
150
151To validate given EC parameters:
152
153 openssl ecparam -in ec_param.pem -check
154
155To create EC parameters and a private key:
156
157 openssl ecparam -out ec_key.pem -name prime192v1 -genkey
158
159To change the point encoding to 'compressed':
160
161 openssl ecparam -in ec_in.pem -out ec_out.pem -conv_form compressed
162
163To print out the EC parameters to standard output:
164
165 openssl ecparam -in ec_param.pem -noout -text
166
167=head1 SEE ALSO
168
169L<ec(1)|ec(1)>, L<dsaparam(1)|dsaparam(1)>
170
171=head1 HISTORY
172
173The ecparam command was first introduced in OpenSSL 0.9.8.
174
175=head1 AUTHOR
176
177Nils Larsch for the OpenSSL project (http://www.openssl.org)
178
179=cut
diff --git a/src/lib/libssl/src/doc/apps/x509v3_config.pod b/src/lib/libssl/src/doc/apps/x509v3_config.pod
new file mode 100644
index 0000000000..38c46e85c4
--- /dev/null
+++ b/src/lib/libssl/src/doc/apps/x509v3_config.pod
@@ -0,0 +1,456 @@
1=pod
2
3=for comment openssl_manual_section:5
4
5=head1 NAME
6
7x509v3_config - X509 V3 certificate extension configuration format
8
9=head1 DESCRIPTION
10
11Several of the OpenSSL utilities can add extensions to a certificate or
12certificate request based on the contents of a configuration file.
13
14Typically the application will contain an option to point to an extension
15section. Each line of the extension section takes the form:
16
17 extension_name=[critical,] extension_options
18
19If B<critical> is present then the extension will be critical.
20
21The format of B<extension_options> depends on the value of B<extension_name>.
22
23There are four main types of extension: I<string> extensions, I<multi-valued>
24extensions, I<raw> and I<arbitrary> extensions.
25
26String extensions simply have a string which contains either the value itself
27or how it is obtained.
28
29For example:
30
31 nsComment="This is a Comment"
32
33Multi-valued extensions have a short form and a long form. The short form
34is a list of names and values:
35
36 basicConstraints=critical,CA:true,pathlen:1
37
38The long form allows the values to be placed in a separate section:
39
40 basicConstraints=critical,@bs_section
41
42 [bs_section]
43
44 CA=true
45 pathlen=1
46
47Both forms are equivalent.
48
49The syntax of raw extensions is governed by the extension code: it can
50for example contain data in multiple sections. The correct syntax to
51use is defined by the extension code itself: check out the certificate
52policies extension for an example.
53
54If an extension type is unsupported then the I<arbitrary> extension syntax
55must be used, see the L<ARBITRART EXTENSIONS|/"ARBITRARY EXTENSIONS"> section for more details.
56
57=head1 STANDARD EXTENSIONS
58
59The following sections describe each supported extension in detail.
60
61=head2 Basic Constraints.
62
63This is a multi valued extension which indicates whether a certificate is
64a CA certificate. The first (mandatory) name is B<CA> followed by B<TRUE> or
65B<FALSE>. If B<CA> is B<TRUE> then an optional B<pathlen> name followed by an
66non-negative value can be included.
67
68For example:
69
70 basicConstraints=CA:TRUE
71
72 basicConstraints=CA:FALSE
73
74 basicConstraints=critical,CA:TRUE, pathlen:0
75
76A CA certificate B<must> include the basicConstraints value with the CA field
77set to TRUE. An end user certificate must either set CA to FALSE or exclude the
78extension entirely. Some software may require the inclusion of basicConstraints
79with CA set to FALSE for end entity certificates.
80
81The pathlen parameter indicates the maximum number of CAs that can appear
82below this one in a chain. So if you have a CA with a pathlen of zero it can
83only be used to sign end user certificates and not further CAs.
84
85
86=head2 Key Usage.
87
88Key usage is a multi valued extension consisting of a list of names of the
89permitted key usages.
90
91The supporte names are: digitalSignature, nonRepudiation, keyEncipherment,
92dataEncipherment, keyAgreement, keyCertSign, cRLSign, encipherOnly
93and decipherOnly.
94
95Examples:
96
97 keyUsage=digitalSignature, nonRepudiation
98
99 keyUsage=critical, keyCertSign
100
101
102=head2 Extended Key Usage.
103
104This extensions consists of a list of usages indicating purposes for which
105the certificate public key can be used for,
106
107These can either be object short names of the dotted numerical form of OIDs.
108While any OID can be used only certain values make sense. In particular the
109following PKIX, NS and MS values are meaningful:
110
111 Value Meaning
112 ----- -------
113 serverAuth SSL/TLS Web Server Authentication.
114 clientAuth SSL/TLS Web Client Authentication.
115 codeSigning Code signing.
116 emailProtection E-mail Protection (S/MIME).
117 timeStamping Trusted Timestamping
118 msCodeInd Microsoft Individual Code Signing (authenticode)
119 msCodeCom Microsoft Commercial Code Signing (authenticode)
120 msCTLSign Microsoft Trust List Signing
121 msSGC Microsoft Server Gated Crypto
122 msEFS Microsoft Encrypted File System
123 nsSGC Netscape Server Gated Crypto
124
125Examples:
126
127 extendedKeyUsage=critical,codeSigning,1.2.3.4
128 extendedKeyUsage=nsSGC,msSGC
129
130
131=head2 Subject Key Identifier.
132
133This is really a string extension and can take two possible values. Either
134the word B<hash> which will automatically follow the guidelines in RFC3280
135or a hex string giving the extension value to include. The use of the hex
136string is strongly discouraged.
137
138Example:
139
140 subjectKeyIdentifier=hash
141
142
143=head2 Authority Key Identifier.
144
145The authority key identifier extension permits two options. keyid and issuer:
146both can take the optional value "always".
147
148If the keyid option is present an attempt is made to copy the subject key
149identifier from the parent certificate. If the value "always" is present
150then an error is returned if the option fails.
151
152The issuer option copies the issuer and serial number from the issuer
153certificate. This will only be done if the keyid option fails or
154is not included unless the "always" flag will always include the value.
155
156Example:
157
158 authorityKeyIdentifier=keyid,issuer
159
160
161=head2 Subject Alternative Name.
162
163The subject alternative name extension allows various literal values to be
164included in the configuration file. These include B<email> (an email address)
165B<URI> a uniform resource indicator, B<DNS> (a DNS domain name), B<RID> (a
166registered ID: OBJECT IDENTIFIER), B<IP> (an IP address), B<dirName>
167(a distinguished name) and otherName.
168
169The email option include a special 'copy' value. This will automatically
170include and email addresses contained in the certificate subject name in
171the extension.
172
173The IP address used in the B<IP> options can be in either IPv4 or IPv6 format.
174
175The value of B<dirName> should point to a section containing the distinguished
176name to use as a set of name value pairs. Multi values AVAs can be formed by
177preceeding the name with a B<+> character.
178
179otherName can include arbitrary data associated with an OID: the value
180should be the OID followed by a semicolon and the content in standard
181ASN1_generate_nconf() format.
182
183Examples:
184
185 subjectAltName=email:copy,email:my@other.address,URI:http://my.url.here/
186 subjectAltName=IP:192.168.7.1
187 subjectAltName=IP:13::17
188 subjectAltName=email:my@other.address,RID:1.2.3.4
189 subjectAltName=otherName:1.2.3.4;UTF8:some other identifier
190
191 subjectAltName=dirName:dir_sect
192
193 [dir_sect]
194 C=UK
195 O=My Organization
196 OU=My Unit
197 CN=My Name
198
199
200=head2 Issuer Alternative Name.
201
202The issuer alternative name option supports all the literal options of
203subject alternative name. It does B<not> support the email:copy option because
204that would not make sense. It does support an additional issuer:copy option
205that will copy all the subject alternative name values from the issuer
206certificate (if possible).
207
208Example:
209
210 issuserAltName = issuer:copy
211
212
213=head2 Authority Info Access.
214
215The authority information access extension gives details about how to access
216certain information relating to the CA. Its syntax is accessOID;location
217where I<location> has the same syntax as subject alternative name (except
218that email:copy is not supported). accessOID can be any valid OID but only
219certain values are meaningful, for example OCSP and caIssuers.
220
221Example:
222
223 authorityInfoAccess = OCSP;URI:http://ocsp.my.host/
224 authorityInfoAccess = caIssuers;URI:http://my.ca/ca.html
225
226
227=head2 CRL distribution points.
228
229This is a multi-valued extension that supports all the literal options of
230subject alternative name. Of the few software packages that currently interpret
231this extension most only interpret the URI option.
232
233Currently each option will set a new DistributionPoint with the fullName
234field set to the given value.
235
236Other fields like cRLissuer and reasons cannot currently be set or displayed:
237at this time no examples were available that used these fields.
238
239Examples:
240
241 crlDistributionPoints=URI:http://myhost.com/myca.crl
242 crlDistributionPoints=URI:http://my.com/my.crl,URI:http://oth.com/my.crl
243
244=head2 Certificate Policies.
245
246This is a I<raw> extension. All the fields of this extension can be set by
247using the appropriate syntax.
248
249If you follow the PKIX recommendations and just using one OID then you just
250include the value of that OID. Multiple OIDs can be set separated by commas,
251for example:
252
253 certificatePolicies= 1.2.4.5, 1.1.3.4
254
255If you wish to include qualifiers then the policy OID and qualifiers need to
256be specified in a separate section: this is done by using the @section syntax
257instead of a literal OID value.
258
259The section referred to must include the policy OID using the name
260policyIdentifier, cPSuri qualifiers can be included using the syntax:
261
262 CPS.nnn=value
263
264userNotice qualifiers can be set using the syntax:
265
266 userNotice.nnn=@notice
267
268The value of the userNotice qualifier is specified in the relevant section.
269This section can include explicitText, organization and noticeNumbers
270options. explicitText and organization are text strings, noticeNumbers is a
271comma separated list of numbers. The organization and noticeNumbers options
272(if included) must BOTH be present. If you use the userNotice option with IE5
273then you need the 'ia5org' option at the top level to modify the encoding:
274otherwise it will not be interpreted properly.
275
276Example:
277
278 certificatePolicies=ia5org,1.2.3.4,1.5.6.7.8,@polsect
279
280 [polsect]
281
282 policyIdentifier = 1.3.5.8
283 CPS.1="http://my.host.name/"
284 CPS.2="http://my.your.name/"
285 userNotice.1=@notice
286
287 [notice]
288
289 explicitText="Explicit Text Here"
290 organization="Organisation Name"
291 noticeNumbers=1,2,3,4
292
293The B<ia5org> option changes the type of the I<organization> field. In RFC2459
294it can only be of type DisplayText. In RFC3280 IA5Strring is also permissible.
295Some software (for example some versions of MSIE) may require ia5org.
296
297=head2 Policy Constraints
298
299This is a multi-valued extension which consisting of the names
300B<requireExplicitPolicy> or B<inhibitPolicyMapping> and a non negative intger
301value. At least one component must be present.
302
303Example:
304
305 policyConstraints = requireExplicitPolicy:3
306
307
308=head2 Inhibit Any Policy
309
310This is a string extension whose value must be a non negative integer.
311
312Example:
313
314 inhibitAnyPolicy = 2
315
316
317=head2 Name Constraints
318
319The name constraints extension is a multi-valued extension. The name should
320begin with the word B<permitted> or B<excluded> followed by a B<;>. The rest of
321the name and the value follows the syntax of subjectAltName except email:copy
322is not supported and the B<IP> form should consist of an IP addresses and
323subnet mask separated by a B</>.
324
325Examples:
326
327 nameConstraints=permitted;IP:192.168.0.0/255.255.0.0
328
329 nameConstraints=permitted;email:.somedomain.com
330
331 nameConstraints=excluded;email:.com
332
333=head1 DEPRECATED EXTENSIONS
334
335The following extensions are non standard, Netscape specific and largely
336obsolete. Their use in new applications is discouraged.
337
338=head2 Netscape String extensions.
339
340Netscape Comment (B<nsComment>) is a string extension containing a comment
341which will be displayed when the certificate is viewed in some browsers.
342
343Example:
344
345 nsComment = "Some Random Comment"
346
347Other supported extensions in this category are: B<nsBaseUrl>,
348B<nsRevocationUrl>, B<nsCaRevocationUrl>, B<nsRenewalUrl>, B<nsCaPolicyUrl>
349and B<nsSslServerName>.
350
351
352=head2 Netscape Certificate Type
353
354This is a multi-valued extensions which consists of a list of flags to be
355included. It was used to indicate the purposes for which a certificate could
356be used. The basicConstraints, keyUsage and extended key usage extensions are
357now used instead.
358
359Acceptable values for nsCertType are: B<client>, B<server>, B<email>,
360B<objsign>, B<reserved>, B<sslCA>, B<emailCA>, B<objCA>.
361
362
363=head1 ARBITRARY EXTENSIONS
364
365If an extension is not supported by the OpenSSL code then it must be encoded
366using the arbitrary extension format. It is also possible to use the arbitrary
367format for supported extensions. Extreme care should be taken to ensure that
368the data is formatted correctly for the given extension type.
369
370There are two ways to encode arbitrary extensions.
371
372The first way is to use the word ASN1 followed by the extension content
373using the same syntax as ASN1_generate_nconf(). For example:
374
375 1.2.3.4=critical,ASN1:UTF8String:Some random data
376
377 1.2.3.4=ASN1:SEQUENCE:seq_sect
378
379 [seq_sect]
380
381 field1 = UTF8:field1
382 field2 = UTF8:field2
383
384It is also possible to use the word DER to include the raw encoded data in any
385extension.
386
387 1.2.3.4=critical,DER:01:02:03:04
388 1.2.3.4=DER:01020304
389
390The value following DER is a hex dump of the DER encoding of the extension
391Any extension can be placed in this form to override the default behaviour.
392For example:
393
394 basicConstraints=critical,DER:00:01:02:03
395
396=head1 WARNING
397
398There is no guarantee that a specific implementation will process a given
399extension. It may therefore be sometimes possible to use certificates for
400purposes prohibited by their extensions because a specific application does
401not recognize or honour the values of the relevant extensions.
402
403The DER and ASN1 options should be used with caution. It is possible to create
404totally invalid extensions if they are not used carefully.
405
406
407=head1 NOTES
408
409If an extension is multi-value and a field value must contain a comma the long
410form must be used otherwise the comma would be misinterpreted as a field
411separator. For example:
412
413 subjectAltName=URI:ldap://somehost.com/CN=foo,OU=bar
414
415will produce an error but the equivalent form:
416
417 subjectAltName=@subject_alt_section
418
419 [subject_alt_section]
420 subjectAltName=URI:ldap://somehost.com/CN=foo,OU=bar
421
422is valid.
423
424Due to the behaviour of the OpenSSL B<conf> library the same field name
425can only occur once in a section. This means that:
426
427 subjectAltName=@alt_section
428
429 [alt_section]
430
431 email=steve@here
432 email=steve@there
433
434will only recognize the last value. This can be worked around by using the form:
435
436 [alt_section]
437
438 email.1=steve@here
439 email.2=steve@there
440
441=head1 HISTORY
442
443The X509v3 extension code was first added to OpenSSL 0.9.2.
444
445Policy mappings, inhibit any policy and name constraints support was added in
446OpenSSL 0.9.8
447
448The B<directoryName> and B<otherName> option as well as the B<ASN1> option
449for arbitrary extensions was added in OpenSSL 0.9.8
450
451=head1 SEE ALSO
452
453L<req(1)|req(1)>, L<ca(1)|ca(1)>, L<x509(1)|x509(1)>
454
455
456=cut
diff --git a/src/lib/libssl/src/doc/crypto/ASN1_generate_nconf.pod b/src/lib/libssl/src/doc/crypto/ASN1_generate_nconf.pod
new file mode 100644
index 0000000000..1157cff510
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/ASN1_generate_nconf.pod
@@ -0,0 +1,262 @@
1=pod
2
3=head1 NAME
4
5ASN1_generate_nconf, ASN1_generate_v3 - ASN1 generation functions
6
7=head1 SYNOPSIS
8
9 ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf);
10 ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf);
11
12=head1 DESCRIPTION
13
14These functions generate the ASN1 encoding of a string
15in an B<ASN1_TYPE> structure.
16
17B<str> contains the string to encode B<nconf> or B<cnf> contains
18the optional configuration information where additional strings
19will be read from. B<nconf> will typically come from a config
20file wherease B<cnf> is obtained from an B<X509V3_CTX> structure
21which will typically be used by X509 v3 certificate extension
22functions. B<cnf> or B<nconf> can be set to B<NULL> if no additional
23configuration will be used.
24
25=head1 GENERATION STRING FORMAT
26
27The actual data encoded is determined by the string B<str> and
28the configuration information. The general format of the string
29is:
30
31=over 2
32
33=item B<[modifier,]type[:value]>
34
35=back
36
37That is zero or more comma separated modifiers followed by a type
38followed by an optional colon and a value. The formats of B<type>,
39B<value> and B<modifier> are explained below.
40
41=head2 SUPPORTED TYPES
42
43The supported types are listed below. Unless otherwise specified
44only the B<ASCII> format is permissible.
45
46=over 2
47
48=item B<BOOLEAN>, B<BOOL>
49
50This encodes a boolean type. The B<value> string is mandatory and
51should be B<TRUE> or B<FALSE>. Additionally B<TRUE>, B<true>, B<Y>,
52B<y>, B<YES>, B<yes>, B<FALSE>, B<false>, B<N>, B<n>, B<NO> and B<no>
53are acceptable.
54
55=item B<NULL>
56
57Encode the B<NULL> type, the B<value> string must not be present.
58
59=item B<INTEGER>, B<INT>
60
61Encodes an ASN1 B<INTEGER> type. The B<value> string represents
62the value of the integer, it can be preceeded by a minus sign and
63is normally interpreted as a decimal value unless the prefix B<0x>
64is included.
65
66=item B<ENUMERATED>, B<ENUM>
67
68Encodes the ASN1 B<ENUMERATED> type, it is otherwise identical to
69B<INTEGER>.
70
71=item B<OBJECT>, B<OID>
72
73Encodes an ASN1 B<OBJECT IDENTIFIER>, the B<value> string can be
74a short name, a long name or numerical format.
75
76=item B<UTCTIME>, B<UTC>
77
78Encodes an ASN1 B<UTCTime> structure, the value should be in
79the format B<YYMMDDHHMMSSZ>.
80
81=item B<GENERALIZEDTIME>, B<GENTIME>
82
83Encodes an ASN1 B<GeneralizedTime> structure, the value should be in
84the format B<YYYYMMDDHHMMSSZ>.
85
86=item B<OCTETSTRING>, B<OCT>
87
88Encodes an ASN1 B<OCTET STRING>. B<value> represents the contents
89of this structure, the format strings B<ASCII> and B<HEX> can be
90used to specify the format of B<value>.
91
92=item B<BITSTRING>, B<BITSTR>
93
94Encodes an ASN1 B<BIT STRING>. B<value> represents the contents
95of this structure, the format strings B<ASCII>, B<HEX> and B<BITLIST>
96can be used to specify the format of B<value>.
97
98If the format is anything other than B<BITLIST> the number of unused
99bits is set to zero.
100
101=item B<UNIVERSALSTRING>, B<UNIV>, B<IA5>, B<IA5STRING>, B<UTF8>,
102B<UTF8String>, B<BMP>, B<BMPSTRING>, B<VISIBLESTRING>,
103B<VISIBLE>, B<PRINTABLESTRING>, B<PRINTABLE>, B<T61>,
104B<T61STRING>, B<TELETEXSTRING>, B<GeneralString>
105
106These encode the corresponding string types. B<value> represents the
107contents of this structure. The format can be B<ASCII> or B<UTF8>.
108
109=item B<SEQUENCE>, B<SEQ>, B<SET>
110
111Formats the result as an ASN1 B<SEQUENCE> or B<SET> type. B<value>
112should be a section name which will contain the contents. The
113field names in the section are ignored and the values are in the
114generated string format. If B<value> is absent then an empty SEQUENCE
115will be encoded.
116
117=back
118
119=head2 MODIFIERS
120
121Modifiers affect the following structure, they can be used to
122add EXPLICIT or IMPLICIT tagging, add wrappers or to change
123the string format of the final type and value. The supported
124formats are documented below.
125
126=over 2
127
128=item B<EXPLICIT>, B<EXP>
129
130Add an explicit tag to the following structure. This string
131should be followed by a colon and the tag value to use as a
132decimal value.
133
134By following the number with B<U>, B<A>, B<P> or B<C> UNIVERSAL,
135APPLICATION, PRIVATE or CONTEXT SPECIFIC tagging can be used,
136the default is CONTEXT SPECIFIC.
137
138=item B<IMPLICIT>, B<IMP>
139
140This is the same as B<EXPLICIT> except IMPLICIT tagging is used
141instead.
142
143=item B<OCTWRAP>, B<SEQWRAP>, B<SETWRAP>, B<BITWRAP>
144
145The following structure is surrounded by an OCTET STRING, a SEQUENCE,
146a SET or a BIT STRING respectively. For a BIT STRING the number of unused
147bits is set to zero.
148
149=item B<FORMAT>
150
151This specifies the format of the ultimate value. It should be followed
152by a colon and one of the strings B<ASCII>, B<UTF8>, B<HEX> or B<BITLIST>.
153
154If no format specifier is included then B<ASCII> is used. If B<UTF8> is
155specified then the value string must be a valid B<UTF8> string. For B<HEX> the
156output must be a set of hex digits. B<BITLIST> (which is only valid for a BIT
157STRING) is a comma separated list of the indices of the set bits, all other
158bits are zero.
159
160=back
161
162=head1 EXAMPLES
163
164A simple IA5String:
165
166 IA5STRING:Hello World
167
168An IA5String explicitly tagged:
169
170 EXPLICIT:0,IA5STRING:Hello World
171
172An IA5String explicitly tagged using APPLICATION tagging:
173
174 EXPLICIT:0A,IA5STRING:Hello World
175
176A BITSTRING with bits 1 and 5 set and all others zero:
177
178 FORMAT=BITLIST,BITSTRING:1,5
179
180A more complex example using a config file to produce a
181SEQUENCE consiting of a BOOL an OID and a UTF8String:
182
183 asn1 = SEQUENCE:seq_section
184
185 [seq_section]
186
187 field1 = BOOLEAN:TRUE
188 field2 = OID:commonName
189 field3 = UTF8:Third field
190
191This example produces an RSAPrivateKey structure, this is the
192key contained in the file client.pem in all OpenSSL distributions
193(note: the field names such as 'coeff' are ignored and are present just
194for clarity):
195
196 asn1=SEQUENCE:private_key
197 [private_key]
198 version=INTEGER:0
199
200 n=INTEGER:0xBB6FE79432CC6EA2D8F970675A5A87BFBE1AFF0BE63E879F2AFFB93644\
201 D4D2C6D000430DEC66ABF47829E74B8C5108623A1C0EE8BE217B3AD8D36D5EB4FCA1D9
202
203 e=INTEGER:0x010001
204
205 d=INTEGER:0x6F05EAD2F27FFAEC84BEC360C4B928FD5F3A9865D0FCAAD291E2A52F4A\
206 F810DC6373278C006A0ABBA27DC8C63BF97F7E666E27C5284D7D3B1FFFE16B7A87B51D
207
208 p=INTEGER:0xF3929B9435608F8A22C208D86795271D54EBDFB09DDEF539AB083DA912\
209 D4BD57
210
211 q=INTEGER:0xC50016F89DFF2561347ED1186A46E150E28BF2D0F539A1594BBD7FE467\
212 46EC4F
213
214 exp1=INTEGER:0x9E7D4326C924AFC1DEA40B45650134966D6F9DFA3A7F9D698CD4ABEA\
215 9C0A39B9
216
217 exp2=INTEGER:0xBA84003BB95355AFB7C50DF140C60513D0BA51D637272E355E397779\
218 E7B2458F
219
220 coeff=INTEGER:0x30B9E4F2AFA5AC679F920FC83F1F2DF1BAF1779CF989447FABC2F5\
221 628657053A
222
223This example is the corresponding public key in a SubjectPublicKeyInfo
224structure:
225
226 # Start with a SEQUENCE
227 asn1=SEQUENCE:pubkeyinfo
228
229 # pubkeyinfo contains an algorithm identifier and the public key wrapped
230 # in a BIT STRING
231 [pubkeyinfo]
232 algorithm=SEQUENCE:rsa_alg
233 pubkey=BITWRAP,SEQUENCE:rsapubkey
234
235 # algorithm ID for RSA is just an OID and a NULL
236 [rsa_alg]
237 algorithm=OID:rsaEncryption
238 parameter=NULL
239
240 # Actual public key: modulus and exponent
241 [rsapubkey]
242 n=INTEGER:0xBB6FE79432CC6EA2D8F970675A5A87BFBE1AFF0BE63E879F2AFFB93644\
243 D4D2C6D000430DEC66ABF47829E74B8C5108623A1C0EE8BE217B3AD8D36D5EB4FCA1D9
244
245 e=INTEGER:0x010001
246
247=head1 RETURN VALUES
248
249ASN1_generate_nconf() and ASN1_generate_v3() return the encoded
250data as an B<ASN1_TYPE> structure or B<NULL> if an error occurred.
251
252The error codes that can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
253
254=head1 SEE ALSO
255
256L<ERR_get_error(3)|ERR_get_error(3)>
257
258=head1 HISTORY
259
260ASN1_generate_nconf() and ASN1_generate_v3() were added to OpenSSL 0.9.8
261
262=cut
diff --git a/src/lib/libssl/src/doc/crypto/BN_BLINDING_new.pod b/src/lib/libssl/src/doc/crypto/BN_BLINDING_new.pod
new file mode 100644
index 0000000000..7b087f7288
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BN_BLINDING_new.pod
@@ -0,0 +1,109 @@
1=pod
2
3=head1 NAME
4
5BN_BLINDING_new, BN_BLINDING_free, BN_BLINDING_update, BN_BLINDING_convert,
6BN_BLINDING_invert, BN_BLINDING_convert_ex, BN_BLINDING_invert_ex,
7BN_BLINDING_get_thread_id, BN_BLINDING_set_thread_id, BN_BLINDING_get_flags,
8BN_BLINDING_set_flags, BN_BLINDING_create_param - blinding related BIGNUM
9functions.
10
11=head1 SYNOPSIS
12
13 #include <openssl/bn.h>
14
15 BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai,
16 BIGNUM *mod);
17 void BN_BLINDING_free(BN_BLINDING *b);
18 int BN_BLINDING_update(BN_BLINDING *b,BN_CTX *ctx);
19 int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
20 int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
21 int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b,
22 BN_CTX *ctx);
23 int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b,
24 BN_CTX *ctx);
25 unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *);
26 void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long);
27 unsigned long BN_BLINDING_get_flags(const BN_BLINDING *);
28 void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long);
29 BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
30 const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
31 int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
32 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx),
33 BN_MONT_CTX *m_ctx);
34
35=head1 DESCRIPTION
36
37BN_BLINDING_new() allocates a new B<BN_BLINDING> structure and copies
38the B<A> and B<Ai> values into the newly created B<BN_BLINDING> object.
39
40BN_BLINDING_free() frees the B<BN_BLINDING> structure.
41
42BN_BLINDING_update() updates the B<BN_BLINDING> parameters by squaring
43the B<A> and B<Ai> or, after specific number of uses and if the
44necessary parameters are set, by re-creating the blinding parameters.
45
46BN_BLINDING_convert_ex() multiplies B<n> with the blinding factor B<A>.
47If B<r> is not NULL a copy the inverse blinding factor B<Ai> will be
48returned in B<r> (this is useful if a B<RSA> object is shared amoung
49several threads). BN_BLINDING_invert_ex() multiplies B<n> with the
50inverse blinding factor B<Ai>. If B<r> is not NULL it will be used as
51the inverse blinding.
52
53BN_BLINDING_convert() and BN_BLINDING_invert() are wrapper
54functions for BN_BLINDING_convert_ex() and BN_BLINDING_invert_ex()
55with B<r> set to NULL.
56
57BN_BLINDING_set_thread_id() and BN_BLINDING_get_thread_id()
58set and get the "thread id" value of the B<BN_BLINDING> structure,
59a field provided to users of B<BN_BLINDING> structure to help them
60provide proper locking if needed for multi-threaded use. The
61"thread id" of a newly allocated B<BN_BLINDING> structure is zero.
62
63BN_BLINDING_get_flags() returns the BN_BLINDING flags. Currently
64there are two supported flags: B<BN_BLINDING_NO_UPDATE> and
65B<BN_BLINDING_NO_RECREATE>. B<BN_BLINDING_NO_UPDATE> inhibits the
66automatic update of the B<BN_BLINDING> parameters after each use
67and B<BN_BLINDING_NO_RECREATE> inhibits the automatic re-creation
68of the B<BN_BLINDING> parameters after a fixed number of uses (currently
6932). In newly allocated B<BN_BLINDING> objects no flags are set.
70BN_BLINDING_set_flags() sets the B<BN_BLINDING> parameters flags.
71
72BN_BLINDING_create_param() creates new B<BN_BLINDING> parameters
73using the exponent B<e> and the modulus B<m>. B<bn_mod_exp> and
74B<m_ctx> can be used to pass special functions for exponentiation
75(normally BN_mod_exp_mont() and B<BN_MONT_CTX>).
76
77=head1 RETURN VALUES
78
79BN_BLINDING_new() returns the newly allocated B<BN_BLINDING> structure
80or NULL in case of an error.
81
82BN_BLINDING_update(), BN_BLINDING_convert(), BN_BLINDING_invert(),
83BN_BLINDING_convert_ex() and BN_BLINDING_invert_ex() return 1 on
84success and 0 if an error occured.
85
86BN_BLINDING_get_thread_id() returns the thread id (a B<unsigned long>
87value) or 0 if not set.
88
89BN_BLINDING_get_flags() returns the currently set B<BN_BLINDING> flags
90(a B<unsigned long> value).
91
92BN_BLINDING_create_param() returns the newly created B<BN_BLINDING>
93parameters or NULL on error.
94
95=head1 SEE ALSO
96
97L<bn(3)|bn(3)>
98
99=head1 HISTORY
100
101BN_BLINDING_convert_ex, BN_BLINDIND_invert_ex, BN_BLINDING_get_thread_id,
102BN_BLINDING_set_thread_id, BN_BLINDING_set_flags, BN_BLINDING_get_flags
103and BN_BLINDING_create_param were first introduced in OpenSSL 0.9.8
104
105=head1 AUTHOR
106
107Nils Larsch for the OpenSSL project (http://www.openssl.org).
108
109=cut
diff --git a/src/lib/libssl/src/doc/crypto/ERR_set_mark.pod b/src/lib/libssl/src/doc/crypto/ERR_set_mark.pod
new file mode 100644
index 0000000000..d3ca4f2e77
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/ERR_set_mark.pod
@@ -0,0 +1,38 @@
1=pod
2
3=head1 NAME
4
5ERR_set_mark, ERR_pop_to_mark - set marks and pop errors until mark
6
7=head1 SYNOPSIS
8
9 #include <openssl/err.h>
10
11 int ERR_set_mark(void);
12
13 int ERR_pop_to_mark(void);
14
15=head1 DESCRIPTION
16
17ERR_set_mark() sets a mark on the current topmost error record if there
18is one.
19
20ERR_pop_to_mark() will pop the top of the error stack until a mark is found.
21The mark is then removed. If there is no mark, the whole stack is removed.
22
23=head1 RETURN VALUES
24
25ERR_set_mark() returns 0 if the error stack is empty, otherwise 1.
26
27ERR_pop_to_mark() returns 0 if there was no mark in the error stack, which
28implies that the stack became empty, otherwise 1.
29
30=head1 SEE ALSO
31
32L<err(3)|err(3)>
33
34=head1 HISTORY
35
36ERR_set_mark() and ERR_pop_to_mark() were added in OpenSSL 0.9.8.
37
38=cut
diff --git a/src/lib/libssl/src/doc/crypto/OPENSSL_Applink.pod b/src/lib/libssl/src/doc/crypto/OPENSSL_Applink.pod
new file mode 100644
index 0000000000..e54de12cc8
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/OPENSSL_Applink.pod
@@ -0,0 +1,21 @@
1=pod
2
3=head1 NAME
4
5OPENSSL_Applink - glue between OpenSSL BIO and Win32 compiler run-time
6
7=head1 SYNOPSIS
8
9 __declspec(dllexport) void **OPENSSL_Applink();
10
11=head1 DESCRIPTION
12
13OPENSSL_Applink is application-side interface which provides a glue
14between OpenSSL BIO layer and Win32 compiler run-time environment.
15Even though it appears at application side, it's essentially OpenSSL
16private interface. For this reason application developers are not
17expected to implement it, but to compile provided module with
18compiler of their choice and link it into the target application.
19The referred module is available as <openssl>/ms/applink.c.
20
21=cut
diff --git a/src/lib/libssl/src/doc/crypto/OPENSSL_ia32cap.pod b/src/lib/libssl/src/doc/crypto/OPENSSL_ia32cap.pod
new file mode 100644
index 0000000000..2e659d34a5
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/OPENSSL_ia32cap.pod
@@ -0,0 +1,43 @@
1=pod
2
3=head1 NAME
4
5OPENSSL_ia32cap - finding the IA-32 processor capabilities
6
7=head1 SYNOPSIS
8
9 unsigned long *OPENSSL_ia32cap_loc(void);
10 #define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc()))
11
12=head1 DESCRIPTION
13
14Value returned by OPENSSL_ia32cap_loc() is address of a variable
15containing IA-32 processor capabilities bit vector as it appears in EDX
16register after executing CPUID instruction with EAX=1 input value (see
17Intel Application Note #241618). Naturally it's meaningful on IA-32[E]
18platforms only. The variable is normally set up automatically upon
19toolkit initialization, but can be manipulated afterwards to modify
20crypto library behaviour. For the moment of this writing six bits are
21significant, namely:
22
231. bit #28 denoting Hyperthreading, which is used to distiguish
24 cores with shared cache;
252. bit #26 denoting SSE2 support;
263. bit #25 denoting SSE support;
274. bit #23 denoting MMX support;
285. bit #20, reserved by Intel, is used to choose between RC4 code
29 pathes;
306. bit #4 denoting presence of Time-Stamp Counter.
31
32For example, clearing bit #26 at run-time disables high-performance
33SSE2 code present in the crypto library. You might have to do this if
34target OpenSSL application is executed on SSE2 capable CPU, but under
35control of OS which does not support SSE2 extentions. Even though you
36can manipulate the value programmatically, you most likely will find it
37more appropriate to set up an environment variable with the same name
38prior starting target application, e.g. on Intel P4 processor 'env
39OPENSSL_ia32cap=0x12900010 apps/openssl', to achieve same effect
40without modifying the application source code. Alternatively you can
41reconfigure the toolkit with no-sse2 option and recompile.
42
43=cut
diff --git a/src/lib/libssl/src/doc/crypto/ecdsa.pod b/src/lib/libssl/src/doc/crypto/ecdsa.pod
new file mode 100644
index 0000000000..49b10f2249
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/ecdsa.pod
@@ -0,0 +1,210 @@
1=pod
2
3=head1 NAME
4
5ecdsa - Elliptic Curve Digital Signature Algorithm
6
7=head1 SYNOPSIS
8
9 #include <openssl/ecdsa.h>
10
11 ECDSA_SIG* ECDSA_SIG_new(void);
12 void ECDSA_SIG_free(ECDSA_SIG *sig);
13 int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp);
14 ECDSA_SIG* d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp,
15 long len);
16
17 ECDSA_SIG* ECDSA_do_sign(const unsigned char *dgst, int dgst_len,
18 EC_KEY *eckey);
19 ECDSA_SIG* ECDSA_do_sign_ex(const unsigned char *dgst, int dgstlen,
20 const BIGNUM *kinv, const BIGNUM *rp,
21 EC_KEY *eckey);
22 int ECDSA_do_verify(const unsigned char *dgst, int dgst_len,
23 const ECDSA_SIG *sig, EC_KEY* eckey);
24 int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx,
25 BIGNUM **kinv, BIGNUM **rp);
26 int ECDSA_sign(int type, const unsigned char *dgst,
27 int dgstlen, unsigned char *sig,
28 unsigned int *siglen, EC_KEY *eckey);
29 int ECDSA_sign_ex(int type, const unsigned char *dgst,
30 int dgstlen, unsigned char *sig,
31 unsigned int *siglen, const BIGNUM *kinv,
32 const BIGNUM *rp, EC_KEY *eckey);
33 int ECDSA_verify(int type, const unsigned char *dgst,
34 int dgstlen, const unsigned char *sig,
35 int siglen, EC_KEY *eckey);
36 int ECDSA_size(const EC_KEY *eckey);
37
38 const ECDSA_METHOD* ECDSA_OpenSSL(void);
39 void ECDSA_set_default_method(const ECDSA_METHOD *meth);
40 const ECDSA_METHOD* ECDSA_get_default_method(void);
41 int ECDSA_set_method(EC_KEY *eckey,const ECDSA_METHOD *meth);
42
43 int ECDSA_get_ex_new_index(long argl, void *argp,
44 CRYPTO_EX_new *new_func,
45 CRYPTO_EX_dup *dup_func,
46 CRYPTO_EX_free *free_func);
47 int ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg);
48 void* ECDSA_get_ex_data(EC_KEY *d, int idx);
49
50=head1 DESCRIPTION
51
52The B<ECDSA_SIG> structure consists of two BIGNUMs for the
53r and s value of a ECDSA signature (see X9.62 or FIPS 186-2).
54
55 struct
56 {
57 BIGNUM *r;
58 BIGNUM *s;
59 } ECDSA_SIG;
60
61ECDSA_SIG_new() allocates a new B<ECDSA_SIG> structure (note: this
62function also allocates the BIGNUMs) and initialize it.
63
64ECDSA_SIG_free() frees the B<ECDSA_SIG> structure B<sig>.
65
66i2d_ECDSA_SIG() creates the DER encoding of the ECDSA signature
67B<sig> and writes the encoded signature to B<*pp> (note: if B<pp>
68is NULL B<i2d_ECDSA_SIG> returns the expected length in bytes of
69the DER encoded signature). B<i2d_ECDSA_SIG> returns the length
70of the DER encoded signature (or 0 on error).
71
72d2i_ECDSA_SIG() decodes a DER encoded ECDSA signature and returns
73the decoded signature in a newly allocated B<ECDSA_SIG> structure.
74B<*sig> points to the buffer containing the DER encoded signature
75of size B<len>.
76
77ECDSA_size() returns the maximum length of a DER encoded
78ECDSA signature created with the private EC key B<eckey>.
79
80ECDSA_sign_setup() may be used to precompute parts of the
81signing operation. B<eckey> is the private EC key and B<ctx>
82is a pointer to B<BN_CTX> structure (or NULL). The precomputed
83values or returned in B<kinv> and B<rp> and can be used in a
84later call to B<ECDSA_sign_ex> or B<ECDSA_do_sign_ex>.
85
86ECDSA_sign() is wrapper function for ECDSA_sign_ex with B<kinv>
87and B<rp> set to NULL.
88
89ECDSA_sign_ex() computes a digital signature of the B<dgstlen> bytes
90hash value B<dgst> using the private EC key B<eckey> and the optional
91pre-computed values B<kinv> and B<rp>. The DER encoded signatures is
92stored in B<sig> and it's length is returned in B<sig_len>. Note: B<sig>
93must point to B<ECDSA_size> bytes of memory. The parameter B<type>
94is ignored.
95
96ECDSA_verify() verifies that the signature in B<sig> of size
97B<siglen> is a valid ECDSA signature of the hash value
98value B<dgst> of size B<dgstlen> using the public key B<eckey>.
99The parameter B<type> is ignored.
100
101ECDSA_do_sign() is wrapper function for ECDSA_do_sign_ex with B<kinv>
102and B<rp> set to NULL.
103
104ECDSA_do_sign_ex() computes a digital signature of the B<dgst_len>
105bytes hash value B<dgst> using the private key B<eckey> and the
106optional pre-computed values B<kinv> and B<rp>. The signature is
107returned in a newly allocated B<ECDSA_SIG> structure (or NULL on error).
108
109ECDSA_do_verify() verifies that the signature B<sig> is a valid
110ECDSA signature of the hash value B<dgst> of size B<dgst_len>
111using the public key B<eckey>.
112
113=head1 RETURN VALUES
114
115ECDSA_size() returns the maximum length signature or 0 on error.
116
117ECDSA_sign_setup() and ECDSA_sign() return 1 if successful or -1
118on error.
119
120ECDSA_verify() and ECDSA_do_verify() return 1 for a valid
121signature, 0 for an invalid signature and -1 on error.
122The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
123
124=head1 EXAMPLES
125
126Creating a ECDSA signature of given SHA-1 hash value using the
127named curve secp192k1.
128
129First step: create a EC_KEY object (note: this part is B<not> ECDSA
130specific)
131
132 int ret;
133 ECDSA_SIG *sig;
134 EC_KEY *eckey = EC_KEY_new();
135 if (eckey == NULL)
136 {
137 /* error */
138 }
139 key->group = EC_GROUP_new_by_nid(NID_secp192k1);
140 if (key->group == NULL)
141 {
142 /* error */
143 }
144 if (!EC_KEY_generate_key(eckey))
145 {
146 /* error */
147 }
148
149Second step: compute the ECDSA signature of a SHA-1 hash value
150using B<ECDSA_do_sign>
151
152 sig = ECDSA_do_sign(digest, 20, eckey);
153 if (sig == NULL)
154 {
155 /* error */
156 }
157
158or using B<ECDSA_sign>
159
160 unsigned char *buffer, *pp;
161 int buf_len;
162 buf_len = ECDSA_size(eckey);
163 buffer = OPENSSL_malloc(buf_len);
164 pp = buffer;
165 if (!ECDSA_sign(0, dgst, dgstlen, pp, &buf_len, eckey);
166 {
167 /* error */
168 }
169
170Third step: verify the created ECDSA signature using B<ECDSA_do_verify>
171
172 ret = ECDSA_do_verify(digest, 20, sig, eckey);
173
174or using B<ECDSA_verify>
175
176 ret = ECDSA_verify(0, digest, 20, buffer, buf_len, eckey);
177
178and finally evaluate the return value:
179
180 if (ret == -1)
181 {
182 /* error */
183 }
184 else if (ret == 0)
185 {
186 /* incorrect signature */
187 }
188 else /* ret == 1 */
189 {
190 /* signature ok */
191 }
192
193=head1 CONFORMING TO
194
195ANSI X9.62, US Federal Information Processing Standard FIPS 186-2
196(Digital Signature Standard, DSS)
197
198=head1 SEE ALSO
199
200L<dsa(3)|dsa(3)>, L<rsa(3)|rsa(3)>
201
202=head1 HISTORY
203
204The ecdsa implementation was first introduced in OpenSSL 0.9.8
205
206=head1 AUTHOR
207
208Nils Larsch for the OpenSSL project (http://www.openssl.org).
209
210=cut
diff --git a/src/lib/libssl/src/doc/crypto/x509.pod b/src/lib/libssl/src/doc/crypto/x509.pod
new file mode 100644
index 0000000000..f9e58e0e41
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/x509.pod
@@ -0,0 +1,64 @@
1=pod
2
3=head1 NAME
4
5x509 - X.509 certificate handling
6
7=head1 SYNOPSIS
8
9 #include <openssl/x509.h>
10
11=head1 DESCRIPTION
12
13A X.509 certificate is a structured grouping of information about
14an individual, a device, or anything one can imagine. A X.509 CRL
15(certificate revocation list) is a tool to help determine if a
16certificate is still valid. The exact definition of those can be
17found in the X.509 document from ITU-T, or in RFC3280 from PKIX.
18In OpenSSL, the type X509 is used to express such a certificate, and
19the type X509_CRL is used to express a CRL.
20
21A related structure is a certificate request, defined in PKCS#10 from
22RSA Security, Inc, also reflected in RFC2896. In OpenSSL, the type
23X509_REQ is used to express such a certificate request.
24
25To handle some complex parts of a certificate, there are the types
26X509_NAME (to express a certificate name), X509_ATTRIBUTE (to express
27a certificate attributes), X509_EXTENSION (to express a certificate
28extension) and a few more.
29
30Finally, there's the supertype X509_INFO, which can contain a CRL, a
31certificate and a corresponding private key.
32
33B<X509_>I<...>, B<d2i_X509_>I<...> and B<i2d_X509_>I<...> handle X.509
34certificates, with some exceptions, shown below.
35
36B<X509_CRL_>I<...>, B<d2i_X509_CRL_>I<...> and B<i2d_X509_CRL_>I<...>
37handle X.509 CRLs.
38
39B<X509_REQ_>I<...>, B<d2i_X509_REQ_>I<...> and B<i2d_X509_REQ_>I<...>
40handle PKCS#10 certificate requests.
41
42B<X509_NAME_>I<...> handle certificate names.
43
44B<X509_ATTRIBUTE_>I<...> handle certificate attributes.
45
46B<X509_EXTENSION_>I<...> handle certificate extensions.
47
48=head1 SEE ALSO
49
50L<X509_NAME_ENTRY_get_object(3)|X509_NAME_ENTRY_get_object(3)>,
51L<X509_NAME_add_entry_by_txt(3)|X509_NAME_add_entry_by_txt(3)>,
52L<X509_NAME_add_entry_by_NID(3)|X509_NAME_add_entry_by_NID(3)>,
53L<X509_NAME_print_ex(3)|X509_NAME_print_ex(3)>,
54L<X509_NAME_new(3)|X509_NAME_new(3)>,
55L<d2i_X509(3)|d2i_X509(3)>,
56L<d2i_X509_ALGOR(3)|d2i_X509_ALGOR(3)>,
57L<d2i_X509_CRL(3)|d2i_X509_CRL(3)>,
58L<d2i_X509_NAME(3)|d2i_X509_NAME(3)>,
59L<d2i_X509_REQ(3)|d2i_X509_REQ(3)>,
60L<d2i_X509_SIG(3)|d2i_X509_SIG(3)>,
61L<crypto(3)|crypto(3)>,
62L<x509v3(3)|x509v3(3)>
63
64=cut