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/asn1parse.pod14
-rw-r--r--src/lib/libssl/src/doc/apps/ca.pod12
-rw-r--r--src/lib/libssl/src/doc/apps/ciphers.pod58
-rw-r--r--src/lib/libssl/src/doc/apps/dgst.pod47
-rw-r--r--src/lib/libssl/src/doc/apps/dhparam.pod2
-rw-r--r--src/lib/libssl/src/doc/apps/dsa.pod2
-rw-r--r--src/lib/libssl/src/doc/apps/dsaparam.pod2
-rw-r--r--src/lib/libssl/src/doc/apps/enc.pod70
-rw-r--r--src/lib/libssl/src/doc/apps/gendsa.pod2
-rw-r--r--src/lib/libssl/src/doc/apps/genrsa.pod2
-rw-r--r--src/lib/libssl/src/doc/apps/ocsp.pod6
-rw-r--r--src/lib/libssl/src/doc/apps/openssl.pod93
-rw-r--r--src/lib/libssl/src/doc/apps/pkcs12.pod85
-rw-r--r--src/lib/libssl/src/doc/apps/pkcs7.pod2
-rw-r--r--src/lib/libssl/src/doc/apps/pkcs8.pod2
-rw-r--r--src/lib/libssl/src/doc/apps/req.pod91
-rw-r--r--src/lib/libssl/src/doc/apps/rsa.pod2
-rw-r--r--src/lib/libssl/src/doc/apps/s_client.pod27
-rw-r--r--src/lib/libssl/src/doc/apps/s_server.pod15
-rw-r--r--src/lib/libssl/src/doc/apps/smime.pod118
-rw-r--r--src/lib/libssl/src/doc/apps/speed.pod2
-rw-r--r--src/lib/libssl/src/doc/apps/spkac.pod2
-rw-r--r--src/lib/libssl/src/doc/apps/verify.pod100
-rw-r--r--src/lib/libssl/src/doc/apps/x509.pod30
-rw-r--r--src/lib/libssl/src/doc/crypto/ASN1_OBJECT_new.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/ASN1_STRING_length.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/ASN1_STRING_new.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_f_buffer.pod9
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_f_md.pod6
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_f_ssl.pod9
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_s_file.pod4
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_s_mem.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_should_retry.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/CRYPTO_set_ex_data.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/DSA_get_ex_new_index.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod23
-rw-r--r--src/lib/libssl/src/doc/crypto/EVP_PKEY_verifyrecover.pod103
-rw-r--r--src/lib/libssl/src/doc/crypto/EVP_SignInit.pod9
-rw-r--r--src/lib/libssl/src/doc/crypto/EVP_VerifyInit.pod9
-rw-r--r--src/lib/libssl/src/doc/crypto/OBJ_nid2obj.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/PKCS12_parse.pod31
-rw-r--r--src/lib/libssl/src/doc/crypto/PKCS7_decrypt.pod4
-rw-r--r--src/lib/libssl/src/doc/crypto/PKCS7_encrypt.pod61
-rw-r--r--src/lib/libssl/src/doc/crypto/PKCS7_sign.pod115
-rw-r--r--src/lib/libssl/src/doc/crypto/PKCS7_verify.pod6
-rw-r--r--src/lib/libssl/src/doc/crypto/SMIME_read_PKCS7.pod4
-rw-r--r--src/lib/libssl/src/doc/crypto/SMIME_write_PKCS7.pod24
-rw-r--r--src/lib/libssl/src/doc/crypto/X509_NAME_ENTRY_get_object.pod16
-rw-r--r--src/lib/libssl/src/doc/crypto/X509_NAME_add_entry_by_txt.pod12
-rw-r--r--src/lib/libssl/src/doc/crypto/X509_NAME_get_index_by_NID.pod14
-rw-r--r--src/lib/libssl/src/doc/crypto/X509_new.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/bn_internal.pod30
-rw-r--r--src/lib/libssl/src/doc/crypto/d2i_RSAPublicKey.pod8
-rw-r--r--src/lib/libssl/src/doc/crypto/d2i_X509.pod12
-rw-r--r--src/lib/libssl/src/doc/crypto/d2i_X509_CRL.pod4
-rw-r--r--src/lib/libssl/src/doc/crypto/d2i_X509_REQ.pod4
-rw-r--r--src/lib/libssl/src/doc/crypto/evp.pod22
-rw-r--r--src/lib/libssl/src/doc/crypto/hmac.pod22
-rw-r--r--src/lib/libssl/src/doc/crypto/lhash.pod244
-rw-r--r--src/lib/libssl/src/doc/crypto/pem.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/threads.pod91
-rw-r--r--src/lib/libssl/src/doc/crypto/ui_compat.pod2
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CIPHER_get_name.pod2
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_new.pod2
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_set_mode.pod10
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_set_options.pod123
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_set_ssl_version.pod6
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_library_init.pod17
-rw-r--r--src/lib/libssl/src/doc/ssl/ssl.pod50
-rw-r--r--src/lib/libssl/src/doc/ssleay.txt26
-rw-r--r--src/lib/libssl/src/doc/standards.txt4
71 files changed, 1438 insertions, 506 deletions
diff --git a/src/lib/libssl/src/doc/apps/asn1parse.pod b/src/lib/libssl/src/doc/apps/asn1parse.pod
index 542d969066..f7bb926211 100644
--- a/src/lib/libssl/src/doc/apps/asn1parse.pod
+++ b/src/lib/libssl/src/doc/apps/asn1parse.pod
@@ -72,11 +72,11 @@ option can be used multiple times to "drill down" into a nested structure.
72=item B<-genstr string>, B<-genconf file> 72=item B<-genstr string>, B<-genconf file>
73 73
74generate encoded data based on B<string>, B<file> or both using 74generate encoded data based on B<string>, B<file> or both using
75ASN1_generate_nconf() format. If B<file> only is present then the string 75L<ASN1_generate_nconf(3)|ASN1_generate_nconf(3)> format. If B<file> only is
76is obtained from the default section using the name B<asn1>. The encoded 76present then the string is obtained from the default section using the name
77data is passed through the ASN1 parser and printed out as though it came 77B<asn1>. The encoded data is passed through the ASN1 parser and printed out as
78from a file, the contents can thus be examined and written to a file 78though it came from a file, the contents can thus be examined and written to a
79using the B<out> option. 79file using the B<out> option.
80 80
81=back 81=back
82 82
@@ -168,4 +168,8 @@ Example config file:
168There should be options to change the format of output lines. The output of some 168There should be options to change the format of output lines. The output of some
169ASN.1 types is not well handled (if at all). 169ASN.1 types is not well handled (if at all).
170 170
171=head1 SEE ALSO
172
173L<ASN1_generate_nconf(3)|ASN1_generate_nconf(3)>
174
171=cut 175=cut
diff --git a/src/lib/libssl/src/doc/apps/ca.pod b/src/lib/libssl/src/doc/apps/ca.pod
index 5618c2dc9d..9ff0cc3612 100644
--- a/src/lib/libssl/src/doc/apps/ca.pod
+++ b/src/lib/libssl/src/doc/apps/ca.pod
@@ -205,7 +205,9 @@ the section of the configuration file containing certificate extensions
205to be added when a certificate is issued (defaults to B<x509_extensions> 205to be added when a certificate is issued (defaults to B<x509_extensions>
206unless the B<-extfile> option is used). If no extension section is 206unless the B<-extfile> option is used). If no extension section is
207present then, a V1 certificate is created. If the extension section 207present then, a V1 certificate is created. If the extension section
208is present (even if it is empty), then a V3 certificate is created. 208is present (even if it is empty), then a V3 certificate is created. See the:w
209L<x509v3_config(5)|x509v3_config(5)> manual page for details of the
210extension section format.
209 211
210=item B<-extfile file> 212=item B<-extfile file>
211 213
@@ -215,7 +217,7 @@ used).
215 217
216=item B<-engine id> 218=item B<-engine id>
217 219
218specifying an engine (by it's unique B<id> string) will cause B<req> 220specifying an engine (by its unique B<id> string) will cause B<ca>
219to attempt to obtain a functional reference to the specified engine, 221to attempt to obtain a functional reference to the specified engine,
220thus initialising it if needed. The engine will then be set as the default 222thus initialising it if needed. The engine will then be set as the default
221for all available algorithms. 223for all available algorithms.
@@ -299,7 +301,9 @@ include. If no CRL extension section is present then a V1 CRL is
299created, if the CRL extension section is present (even if it is 301created, if the CRL extension section is present (even if it is
300empty) then a V2 CRL is created. The CRL extensions specified are 302empty) then a V2 CRL is created. The CRL extensions specified are
301CRL extensions and B<not> CRL entry extensions. It should be noted 303CRL extensions and B<not> CRL entry extensions. It should be noted
302that some software (for example Netscape) can't handle V2 CRLs. 304that some software (for example Netscape) can't handle V2 CRLs. See
305L<x509v3_config(5)|x509v3_config(5)> manual page for details of the
306extension section format.
303 307
304=back 308=back
305 309
@@ -666,6 +670,6 @@ then even if a certificate is issued with CA:TRUE it will not be valid.
666=head1 SEE ALSO 670=head1 SEE ALSO
667 671
668L<req(1)|req(1)>, L<spkac(1)|spkac(1)>, L<x509(1)|x509(1)>, L<CA.pl(1)|CA.pl(1)>, 672L<req(1)|req(1)>, L<spkac(1)|spkac(1)>, L<x509(1)|x509(1)>, L<CA.pl(1)|CA.pl(1)>,
669L<config(5)|config(5)> 673L<config(5)|config(5)>, L<x509v3_config(5)|x509v3_config(5)>
670 674
671=cut 675=cut
diff --git a/src/lib/libssl/src/doc/apps/ciphers.pod b/src/lib/libssl/src/doc/apps/ciphers.pod
index 694e433ef3..f44aa00a2f 100644
--- a/src/lib/libssl/src/doc/apps/ciphers.pod
+++ b/src/lib/libssl/src/doc/apps/ciphers.pod
@@ -8,6 +8,7 @@ ciphers - SSL cipher display and cipher list tool.
8 8
9B<openssl> B<ciphers> 9B<openssl> B<ciphers>
10[B<-v>] 10[B<-v>]
11[B<-V>]
11[B<-ssl2>] 12[B<-ssl2>]
12[B<-ssl3>] 13[B<-ssl3>]
13[B<-tls1>] 14[B<-tls1>]
@@ -15,7 +16,7 @@ B<openssl> B<ciphers>
15 16
16=head1 DESCRIPTION 17=head1 DESCRIPTION
17 18
18The B<cipherlist> command converts OpenSSL cipher lists into ordered 19The B<ciphers> command converts textual OpenSSL cipher lists into ordered
19SSL cipher preference lists. It can be used as a test tool to determine 20SSL cipher preference lists. It can be used as a test tool to determine
20the appropriate cipherlist. 21the appropriate cipherlist.
21 22
@@ -25,7 +26,7 @@ the appropriate cipherlist.
25 26
26=item B<-v> 27=item B<-v>
27 28
28verbose option. List ciphers with a complete description of 29Verbose option. List ciphers with a complete description of
29protocol version (SSLv2 or SSLv3; the latter includes TLS), key exchange, 30protocol version (SSLv2 or SSLv3; the latter includes TLS), key exchange,
30authentication, encryption and mac algorithms used along with any key size 31authentication, encryption and mac algorithms used along with any key size
31restrictions and whether the algorithm is classed as an "export" cipher. 32restrictions and whether the algorithm is classed as an "export" cipher.
@@ -33,6 +34,10 @@ Note that without the B<-v> option, ciphers may seem to appear twice
33in a cipher list; this is when similar ciphers are available for 34in a cipher list; this is when similar ciphers are available for
34SSL v2 and for SSL v3/TLS v1. 35SSL v2 and for SSL v3/TLS v1.
35 36
37=item B<-V>
38
39Like B<-V>, but include cipher suite codes in output (hex format).
40
36=item B<-ssl3> 41=item B<-ssl3>
37 42
38only include SSL v3 ciphers. 43only include SSL v3 ciphers.
@@ -104,8 +109,8 @@ The following is a list of all permitted cipher strings and their meanings.
104 109
105=item B<DEFAULT> 110=item B<DEFAULT>
106 111
107the default cipher list. This is determined at compile time and is normally 112the default cipher list. This is determined at compile time and, as of OpenSSL
108B<AES:ALL:!aNULL:!eNULL:+RC4:@STRENGTH>. This must be the first cipher string 1131.0.0, is normally B<ALL:!aNULL:!eNULL>. This must be the first cipher string
109specified. 114specified.
110 115
111=item B<COMPLEMENTOFDEFAULT> 116=item B<COMPLEMENTOFDEFAULT>
@@ -116,7 +121,8 @@ not included by B<ALL> (use B<COMPLEMENTOFALL> if necessary).
116 121
117=item B<ALL> 122=item B<ALL>
118 123
119all ciphers suites except the B<eNULL> ciphers which must be explicitly enabled. 124all cipher suites except the B<eNULL> ciphers which must be explicitly enabled;
125as of OpenSSL, the B<ALL> cipher suites are reasonably ordered by default
120 126
121=item B<COMPLEMENTOFALL> 127=item B<COMPLEMENTOFALL>
122 128
@@ -245,6 +251,33 @@ cipher suites using MD5.
245 251
246cipher suites using SHA1. 252cipher suites using SHA1.
247 253
254=item B<aGOST>
255
256cipher suites using GOST R 34.10 (either 2001 or 94) for authenticaction
257(needs an engine supporting GOST algorithms).
258
259=item B<aGOST01>
260
261cipher suites using GOST R 34.10-2001 authentication.
262
263=item B<aGOST94>
264
265cipher suites using GOST R 34.10-94 authentication (note that R 34.10-94
266standard has been expired so use GOST R 34.10-2001)
267
268=item B<kGOST>
269
270cipher suites, using VKO 34.10 key exchange, specified in the RFC 4357.
271
272=item B<GOST94>
273
274cipher suites, using HMAC based on GOST R 34.11-94.
275
276=item B<GOST89MAC>
277
278cipher suites using GOST 28147-89 MAC B<instead of> HMAC.
279
280
248=back 281=back
249 282
250=head1 CIPHER SUITE NAMES 283=head1 CIPHER SUITE NAMES
@@ -370,6 +403,16 @@ e.g. DES-CBC3-SHA. In these cases, RSA authentication is used.
370 403
371 TLS_DH_anon_WITH_SEED_CBC_SHA ADH-SEED-SHA 404 TLS_DH_anon_WITH_SEED_CBC_SHA ADH-SEED-SHA
372 405
406=head2 GOST ciphersuites from draft-chudov-cryptopro-cptls, extending TLS v1.0
407
408Note: these ciphers require an engine which including GOST cryptographic
409algorithms, such as the B<ccgost> engine, included in the OpenSSL distribution.
410
411 TLS_GOSTR341094_WITH_28147_CNT_IMIT GOST94-GOST89-GOST89
412 TLS_GOSTR341001_WITH_28147_CNT_IMIT GOST2001-GOST89-GOST89
413 TLS_GOSTR341094_WITH_NULL_GOSTR3411 GOST94-NULL-GOST94
414 TLS_GOSTR341001_WITH_NULL_GOSTR3411 GOST2001-NULL-GOST94
415
373=head2 Additional Export 1024 and other cipher suites 416=head2 Additional Export 1024 and other cipher suites
374 417
375Note: these ciphers can also be used in SSL v3. 418Note: these ciphers can also be used in SSL v3.
@@ -428,7 +471,8 @@ L<s_client(1)|s_client(1)>, L<s_server(1)|s_server(1)>, L<ssl(3)|ssl(3)>
428 471
429=head1 HISTORY 472=head1 HISTORY
430 473
431The B<COMPLENTOFALL> and B<COMPLEMENTOFDEFAULT> selection options were 474The B<COMPLENTOFALL> and B<COMPLEMENTOFDEFAULT> selection options
432added in version 0.9.7. 475for cipherlist strings were added in OpenSSL 0.9.7.
476The B<-V> option for the B<ciphers> command was added in OpenSSL 1.0.0.
433 477
434=cut 478=cut
diff --git a/src/lib/libssl/src/doc/apps/dgst.pod b/src/lib/libssl/src/doc/apps/dgst.pod
index 908cd2a6d6..b035edf08e 100644
--- a/src/lib/libssl/src/doc/apps/dgst.pod
+++ b/src/lib/libssl/src/doc/apps/dgst.pod
@@ -14,6 +14,7 @@ B<openssl> B<dgst>
14[B<-binary>] 14[B<-binary>]
15[B<-out filename>] 15[B<-out filename>]
16[B<-sign filename>] 16[B<-sign filename>]
17[B<-keyform arg>]
17[B<-passin arg>] 18[B<-passin arg>]
18[B<-verify filename>] 19[B<-verify filename>]
19[B<-prverify filename>] 20[B<-prverify filename>]
@@ -61,6 +62,23 @@ filename to output to, or standard output by default.
61 62
62digitally sign the digest using the private key in "filename". 63digitally sign the digest using the private key in "filename".
63 64
65=item B<-keyform arg>
66
67Specifies the key format to sign digest with. Only PEM and ENGINE
68formats are supported by the B<dgst> command.
69
70=item B<-engine id>
71
72Use engine B<id> for operations (including private key storage).
73This engine is not used as source for digest algorithms, unless it is
74also specified in the configuration file.
75
76=item B<-sigopt nm:v>
77
78Pass options to the signature algorithm during sign or verify operations.
79Names and values of these options are algorithm-specific.
80
81
64=item B<-passin arg> 82=item B<-passin arg>
65 83
66the private key password source. For more information about the format of B<arg> 84the private key password source. For more information about the format of B<arg>
@@ -83,6 +101,35 @@ the actual signature to verify.
83 101
84create a hashed MAC using "key". 102create a hashed MAC using "key".
85 103
104=item B<-mac alg>
105
106create MAC (keyed Message Authentication Code). The most popular MAC
107algorithm is HMAC (hash-based MAC), but there are other MAC algorithms
108which are not based on hash, for instance B<gost-mac> algorithm,
109supported by B<ccgost> engine. MAC keys and other options should be set
110via B<-macopt> parameter.
111
112=item B<-macopt nm:v>
113
114Passes options to MAC algorithm, specified by B<-mac> key.
115Following options are supported by both by B<HMAC> and B<gost-mac>:
116
117=over 8
118
119=item B<key:string>
120
121Specifies MAC key as alphnumeric string (use if key contain printable
122characters only). String length must conform to any restrictions of
123the MAC algorithm for example exactly 32 chars for gost-mac.
124
125=item B<hexkey:string>
126
127Specifies MAC key in hexadecimal form (two hex digits per byte).
128Key length must conform to any restrictions of the MAC algorithm
129for example exactly 32 chars for gost-mac.
130
131=back
132
86=item B<-rand file(s)> 133=item B<-rand file(s)>
87 134
88a file or files containing random data used to seed the random number 135a file or files containing random data used to seed the random number
diff --git a/src/lib/libssl/src/doc/apps/dhparam.pod b/src/lib/libssl/src/doc/apps/dhparam.pod
index c31db95a47..9edb4ff4e1 100644
--- a/src/lib/libssl/src/doc/apps/dhparam.pod
+++ b/src/lib/libssl/src/doc/apps/dhparam.pod
@@ -99,7 +99,7 @@ be loaded by calling the B<get_dh>I<numbits>B<()> function.
99 99
100=item B<-engine id> 100=item B<-engine id>
101 101
102specifying an engine (by it's unique B<id> string) will cause B<req> 102specifying an engine (by its unique B<id> string) will cause B<dhparam>
103to attempt to obtain a functional reference to the specified engine, 103to attempt to obtain a functional reference to the specified engine,
104thus initialising it if needed. The engine will then be set as the default 104thus initialising it if needed. The engine will then be set as the default
105for all available algorithms. 105for all available algorithms.
diff --git a/src/lib/libssl/src/doc/apps/dsa.pod b/src/lib/libssl/src/doc/apps/dsa.pod
index ed06b8806d..ddbc9327fa 100644
--- a/src/lib/libssl/src/doc/apps/dsa.pod
+++ b/src/lib/libssl/src/doc/apps/dsa.pod
@@ -109,7 +109,7 @@ a public key.
109 109
110=item B<-engine id> 110=item B<-engine id>
111 111
112specifying an engine (by it's unique B<id> string) will cause B<req> 112specifying an engine (by its unique B<id> string) will cause B<dsa>
113to attempt to obtain a functional reference to the specified engine, 113to attempt to obtain a functional reference to the specified engine,
114thus initialising it if needed. The engine will then be set as the default 114thus initialising it if needed. The engine will then be set as the default
115for all available algorithms. 115for all available algorithms.
diff --git a/src/lib/libssl/src/doc/apps/dsaparam.pod b/src/lib/libssl/src/doc/apps/dsaparam.pod
index b9b1b93b42..ba5ec4d72c 100644
--- a/src/lib/libssl/src/doc/apps/dsaparam.pod
+++ b/src/lib/libssl/src/doc/apps/dsaparam.pod
@@ -85,7 +85,7 @@ the input file (if any) is ignored.
85 85
86=item B<-engine id> 86=item B<-engine id>
87 87
88specifying an engine (by it's unique B<id> string) will cause B<req> 88specifying an engine (by its unique B<id> string) will cause B<dsaparam>
89to attempt to obtain a functional reference to the specified engine, 89to attempt to obtain a functional reference to the specified engine,
90thus initialising it if needed. The engine will then be set as the default 90thus initialising it if needed. The engine will then be set as the default
91for all available algorithms. 91for all available algorithms.
diff --git a/src/lib/libssl/src/doc/apps/enc.pod b/src/lib/libssl/src/doc/apps/enc.pod
index 4391c93360..3dee4ed992 100644
--- a/src/lib/libssl/src/doc/apps/enc.pod
+++ b/src/lib/libssl/src/doc/apps/enc.pod
@@ -12,17 +12,24 @@ B<openssl enc -ciphername>
12[B<-pass arg>] 12[B<-pass arg>]
13[B<-e>] 13[B<-e>]
14[B<-d>] 14[B<-d>]
15[B<-a>] 15[B<-a/-base64>]
16[B<-A>] 16[B<-A>]
17[B<-k password>] 17[B<-k password>]
18[B<-kfile filename>] 18[B<-kfile filename>]
19[B<-K key>] 19[B<-K key>]
20[B<-iv IV>] 20[B<-iv IV>]
21[B<-S salt>]
22[B<-salt>]
23[B<-nosalt>]
24[B<-z>]
25[B<-md>]
21[B<-p>] 26[B<-p>]
22[B<-P>] 27[B<-P>]
23[B<-bufsize number>] 28[B<-bufsize number>]
24[B<-nopad>] 29[B<-nopad>]
25[B<-debug>] 30[B<-debug>]
31[B<-none>]
32[B<-engine id>]
26 33
27=head1 DESCRIPTION 34=head1 DESCRIPTION
28 35
@@ -50,15 +57,13 @@ see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>.
50 57
51=item B<-salt> 58=item B<-salt>
52 59
53use a salt in the key derivation routines. This option should B<ALWAYS> 60use a salt in the key derivation routines. This is the default.
54be used unless compatibility with previous versions of OpenSSL or SSLeay
55is required. This option is only present on OpenSSL versions 0.9.5 or
56above.
57 61
58=item B<-nosalt> 62=item B<-nosalt>
59 63
60don't use a salt in the key derivation routines. This is the default for 64don't use a salt in the key derivation routines. This option B<SHOULD NOT> be
61compatibility with previous versions of OpenSSL and SSLeay. 65used except for test purposes or compatibility with ancient versions of OpenSSL
66and SSLeay.
62 67
63=item B<-e> 68=item B<-e>
64 69
@@ -74,6 +79,10 @@ base64 process the data. This means that if encryption is taking place
74the data is base64 encoded after encryption. If decryption is set then 79the data is base64 encoded after encryption. If decryption is set then
75the input data is base64 decoded before being decrypted. 80the input data is base64 decoded before being decrypted.
76 81
82=item B<-base64>
83
84same as B<-a>
85
77=item B<-A> 86=item B<-A>
78 87
79if the B<-a> option is set then base64 process the data on one line. 88if the B<-a> option is set then base64 process the data on one line.
@@ -89,10 +98,18 @@ read the password to derive the key from the first line of B<filename>.
89This is for compatibility with previous versions of OpenSSL. Superseded by 98This is for compatibility with previous versions of OpenSSL. Superseded by
90the B<-pass> argument. 99the B<-pass> argument.
91 100
101=item B<-nosalt>
102
103do not use a salt
104
105=item B<-salt>
106
107use salt (randomly generated or provide with B<-S> option) when
108encrypting (this is the default).
109
92=item B<-S salt> 110=item B<-S salt>
93 111
94the actual salt to use: this must be represented as a string comprised only 112the actual salt to use: this must be represented as a string of hex digits.
95of hex digits.
96 113
97=item B<-K key> 114=item B<-K key>
98 115
@@ -131,12 +148,34 @@ disable standard block padding
131 148
132debug the BIOs used for I/O. 149debug the BIOs used for I/O.
133 150
151=item B<-z>
152
153Compress or decompress clear text using zlib before encryption or after
154decryption. This option exists only if OpenSSL with compiled with zlib
155or zlib-dynamic option.
156
157=item B<-none>
158
159Use NULL cipher (no encryption or decryption of input).
160
134=back 161=back
135 162
136=head1 NOTES 163=head1 NOTES
137 164
138The program can be called either as B<openssl ciphername> or 165The program can be called either as B<openssl ciphername> or
139B<openssl enc -ciphername>. 166B<openssl enc -ciphername>. But the first form doesn't work with
167engine-provided ciphers, because this form is processed before the
168configuration file is read and any ENGINEs loaded.
169
170Engines which provide entirely new encryption algorithms (such as ccgost
171engine which provides gost89 algorithm) should be configured in the
172configuration file. Engines, specified in the command line using -engine
173options can only be used for hadrware-assisted implementations of
174ciphers, which are supported by OpenSSL core or other engine, specified
175in the configuration file.
176
177When enc command lists supported ciphers, ciphers provided by engines,
178specified in the configuration files are listed too.
140 179
141A password will be prompted for to derive the key and IV if necessary. 180A password will be prompted for to derive the key and IV if necessary.
142 181
@@ -169,6 +208,14 @@ Blowfish and RC5 algorithms use a 128 bit key.
169 208
170=head1 SUPPORTED CIPHERS 209=head1 SUPPORTED CIPHERS
171 210
211Note that some of these ciphers can be disabled at compile time
212and some are available only if an appropriate engine is configured
213in the configuration file. The output of the B<enc> command run with
214unsupported options (for example B<openssl enc -help>) includes a
215list of ciphers, supported by your versesion of OpenSSL, including
216ones provided by configured engines.
217
218
172 base64 Base 64 219 base64 Base 64
173 220
174 bf-cbc Blowfish in CBC mode 221 bf-cbc Blowfish in CBC mode
@@ -203,6 +250,9 @@ Blowfish and RC5 algorithms use a 128 bit key.
203 250
204 desx DESX algorithm. 251 desx DESX algorithm.
205 252
253 gost89 GOST 28147-89 in CFB mode (provided by ccgost engine)
254 gost89-cnt `GOST 28147-89 in CNT mode (provided by ccgost engine)
255
206 idea-cbc IDEA algorithm in CBC mode 256 idea-cbc IDEA algorithm in CBC mode
207 idea same as idea-cbc 257 idea same as idea-cbc
208 idea-cfb IDEA in CFB mode 258 idea-cfb IDEA in CFB mode
diff --git a/src/lib/libssl/src/doc/apps/gendsa.pod b/src/lib/libssl/src/doc/apps/gendsa.pod
index 2c56cc7888..8c7f114ca0 100644
--- a/src/lib/libssl/src/doc/apps/gendsa.pod
+++ b/src/lib/libssl/src/doc/apps/gendsa.pod
@@ -40,7 +40,7 @@ all others.
40 40
41=item B<-engine id> 41=item B<-engine id>
42 42
43specifying an engine (by it's unique B<id> string) will cause B<req> 43specifying an engine (by its unique B<id> string) will cause B<gendsa>
44to attempt to obtain a functional reference to the specified engine, 44to attempt to obtain a functional reference to the specified engine,
45thus initialising it if needed. The engine will then be set as the default 45thus initialising it if needed. The engine will then be set as the default
46for all available algorithms. 46for all available algorithms.
diff --git a/src/lib/libssl/src/doc/apps/genrsa.pod b/src/lib/libssl/src/doc/apps/genrsa.pod
index 25af4d1475..7dcac2a779 100644
--- a/src/lib/libssl/src/doc/apps/genrsa.pod
+++ b/src/lib/libssl/src/doc/apps/genrsa.pod
@@ -57,7 +57,7 @@ all others.
57 57
58=item B<-engine id> 58=item B<-engine id>
59 59
60specifying an engine (by it's unique B<id> string) will cause B<req> 60specifying an engine (by its unique B<id> string) will cause B<genrsa>
61to attempt to obtain a functional reference to the specified engine, 61to attempt to obtain a functional reference to the specified engine,
62thus initialising it if needed. The engine will then be set as the default 62thus initialising it if needed. The engine will then be set as the default
63for all available algorithms. 63for all available algorithms.
diff --git a/src/lib/libssl/src/doc/apps/ocsp.pod b/src/lib/libssl/src/doc/apps/ocsp.pod
index b58ddc1788..af2e12e418 100644
--- a/src/lib/libssl/src/doc/apps/ocsp.pod
+++ b/src/lib/libssl/src/doc/apps/ocsp.pod
@@ -51,6 +51,7 @@ B<openssl> B<ocsp>
51[B<-ndays n>] 51[B<-ndays n>]
52[B<-resp_key_id>] 52[B<-resp_key_id>]
53[B<-nrequest n>] 53[B<-nrequest n>]
54[B<-md5|-sha1|...>]
54 55
55=head1 DESCRIPTION 56=head1 DESCRIPTION
56 57
@@ -206,6 +207,11 @@ information is immediately available. In this case the age of the B<notBefore> f
206is checked to see it is not older than B<age> seconds old. By default this additional 207is checked to see it is not older than B<age> seconds old. By default this additional
207check is not performed. 208check is not performed.
208 209
210=item B<-md5|-sha1|-sha256|-ripemod160|...>
211
212this option sets digest algorithm to use for certificate identification
213in the OCSP request. By default SHA-1 is used.
214
209=back 215=back
210 216
211=head1 OCSP SERVER OPTIONS 217=head1 OCSP SERVER OPTIONS
diff --git a/src/lib/libssl/src/doc/apps/openssl.pod b/src/lib/libssl/src/doc/apps/openssl.pod
index 964cdf0f02..738142e9ff 100644
--- a/src/lib/libssl/src/doc/apps/openssl.pod
+++ b/src/lib/libssl/src/doc/apps/openssl.pod
@@ -12,7 +12,7 @@ I<command>
12[ I<command_opts> ] 12[ I<command_opts> ]
13[ I<command_args> ] 13[ I<command_args> ]
14 14
15B<openssl> [ B<list-standard-commands> | B<list-message-digest-commands> | B<list-cipher-commands> ] 15B<openssl> [ B<list-standard-commands> | B<list-message-digest-commands> | B<list-cipher-commands> | B<list-cipher-algorithms> | B<list-message-digest-algorithms> | B<list-public-key-algorithms>]
16 16
17B<openssl> B<no->I<XXX> [ I<arbitrary options> ] 17B<openssl> B<no->I<XXX> [ I<arbitrary options> ]
18 18
@@ -26,12 +26,14 @@ The B<openssl> program is a command line tool for using the various
26cryptography functions of OpenSSL's B<crypto> library from the shell. 26cryptography functions of OpenSSL's B<crypto> library from the shell.
27It can be used for 27It can be used for
28 28
29 o Creation of RSA, DH and DSA key parameters 29 o Creation and management of private keys, public keys and parameters
30 o Public key cryptographic operations
30 o Creation of X.509 certificates, CSRs and CRLs 31 o Creation of X.509 certificates, CSRs and CRLs
31 o Calculation of Message Digests 32 o Calculation of Message Digests
32 o Encryption and Decryption with Ciphers 33 o Encryption and Decryption with Ciphers
33 o SSL/TLS Client and Server Tests 34 o SSL/TLS Client and Server Tests
34 o Handling of S/MIME signed or encrypted mail 35 o Handling of S/MIME signed or encrypted mail
36 o Time Stamp requests, generation and verification
35 37
36=head1 COMMAND SUMMARY 38=head1 COMMAND SUMMARY
37 39
@@ -44,6 +46,14 @@ and B<list-cipher-commands> output a list (one entry per line) of the names
44of all standard commands, message digest commands, or cipher commands, 46of all standard commands, message digest commands, or cipher commands,
45respectively, that are available in the present B<openssl> utility. 47respectively, that are available in the present B<openssl> utility.
46 48
49The pseudo-commands B<list-cipher-algorithms> and
50B<list-message-digest-algorithms> list all cipher and message digest names, one entry per line. Aliases are listed as:
51
52 from => to
53
54The pseudo-command B<list-public-key-algorithms> lists all supported public
55key algorithms.
56
47The pseudo-command B<no->I<XXX> tests whether a command of the 57The pseudo-command B<no->I<XXX> tests whether a command of the
48specified name is available. If no command named I<XXX> exists, it 58specified name is available. If no command named I<XXX> exists, it
49returns 0 (success) and prints B<no->I<XXX>; otherwise it returns 1 59returns 0 (success) and prints B<no->I<XXX>; otherwise it returns 1
@@ -71,6 +81,10 @@ Certificate Authority (CA) Management.
71 81
72Cipher Suite Description Determination. 82Cipher Suite Description Determination.
73 83
84=item L<B<cms>|cms(1)>
85
86CMS (Cryptographic Message Syntax) utility
87
74=item L<B<crl>|crl(1)> 88=item L<B<crl>|crl(1)>
75 89
76Certificate Revocation List (CRL) Management. 90Certificate Revocation List (CRL) Management.
@@ -88,25 +102,40 @@ Message Digest Calculation.
88Diffie-Hellman Parameter Management. 102Diffie-Hellman Parameter Management.
89Obsoleted by L<B<dhparam>|dhparam(1)>. 103Obsoleted by L<B<dhparam>|dhparam(1)>.
90 104
105=item L<B<dhparam>|dhparam(1)>
106
107Generation and Management of Diffie-Hellman Parameters. Superseded by
108L<B<genpkey>|genpkey(1)> and L<B<pkeyparam>|pkeyparam(1)>
109
110
91=item L<B<dsa>|dsa(1)> 111=item L<B<dsa>|dsa(1)>
92 112
93DSA Data Management. 113DSA Data Management.
94 114
95=item L<B<dsaparam>|dsaparam(1)> 115=item L<B<dsaparam>|dsaparam(1)>
96 116
97DSA Parameter Generation. 117DSA Parameter Generation and Management. Superseded by
118L<B<genpkey>|genpkey(1)> and L<B<pkeyparam>|pkeyparam(1)>
119
120=item L<B<ec>|ec(1)>
121
122EC (Elliptic curve) key processing
123
124=item L<B<ecparam>|ecparam(1)>
125
126EC parameter manipulation and generation
98 127
99=item L<B<enc>|enc(1)> 128=item L<B<enc>|enc(1)>
100 129
101Encoding with Ciphers. 130Encoding with Ciphers.
102 131
103=item L<B<errstr>|errstr(1)> 132=item L<B<engine>|engine(1)>
104 133
105Error Number to Error String Conversion. 134Engine (loadble module) information and manipulation.
106 135
107=item L<B<dhparam>|dhparam(1)> 136=item L<B<errstr>|errstr(1)>
108 137
109Generation and Management of Diffie-Hellman Parameters. 138Error Number to Error String Conversion.
110 139
111=item B<gendh> 140=item B<gendh>
112 141
@@ -115,11 +144,20 @@ Obsoleted by L<B<dhparam>|dhparam(1)>.
115 144
116=item L<B<gendsa>|gendsa(1)> 145=item L<B<gendsa>|gendsa(1)>
117 146
118Generation of DSA Parameters. 147Generation of DSA Private Key from Parameters. Superseded by
148L<B<genpkey>|genpkey(1)> and L<B<pkey>|pkey(1)>
149
150=item L<B<genpkey>|genpkey(1)>
151
152Generation of Private Key or Parameters.
119 153
120=item L<B<genrsa>|genrsa(1)> 154=item L<B<genrsa>|genrsa(1)>
121 155
122Generation of RSA Parameters. 156Generation of RSA Private Key. Superceded by L<B<genpkey>|genpkey(1)>.
157
158=item L<B<nseq>|nseq(1)>
159
160Create or examine a netscape certificate sequence
123 161
124=item L<B<ocsp>|ocsp(1)> 162=item L<B<ocsp>|ocsp(1)>
125 163
@@ -137,21 +175,35 @@ PKCS#12 Data Management.
137 175
138PKCS#7 Data Management. 176PKCS#7 Data Management.
139 177
178=item L<B<pkey>|pkey(1)>
179
180Public and private key management.
181
182=item L<B<pkeyparam>|pkeyparam(1)>
183
184Public key algorithm parameter management.
185
186=item L<B<pkeyutl>|pkeyutl(1)>
187
188Public key algorithm cryptographic operation utility.
189
140=item L<B<rand>|rand(1)> 190=item L<B<rand>|rand(1)>
141 191
142Generate pseudo-random bytes. 192Generate pseudo-random bytes.
143 193
144=item L<B<req>|req(1)> 194=item L<B<req>|req(1)>
145 195
146X.509 Certificate Signing Request (CSR) Management. 196PKCS#10 X.509 Certificate Signing Request (CSR) Management.
147 197
148=item L<B<rsa>|rsa(1)> 198=item L<B<rsa>|rsa(1)>
149 199
150RSA Data Management. 200RSA key management.
201
151 202
152=item L<B<rsautl>|rsautl(1)> 203=item L<B<rsautl>|rsautl(1)>
153 204
154RSA utility for signing, verification, encryption, and decryption. 205RSA utility for signing, verification, encryption, and decryption. Superseded
206by L<B<pkeyutl>|pkeyutl(1)>
155 207
156=item L<B<s_client>|s_client(1)> 208=item L<B<s_client>|s_client(1)>
157 209
@@ -185,6 +237,14 @@ S/MIME mail processing.
185 237
186Algorithm Speed Measurement. 238Algorithm Speed Measurement.
187 239
240=item L<B<spkac>|spkac(1)>
241
242SPKAC printing and generating utility
243
244=item L<B<ts>|ts(1)>
245
246Time Stamping Authority tool (client/server)
247
188=item L<B<verify>|verify(1)> 248=item L<B<verify>|verify(1)>
189 249
190X.509 Certificate Verification. 250X.509 Certificate Verification.
@@ -227,6 +287,8 @@ SHA Digest
227 287
228SHA-1 Digest 288SHA-1 Digest
229 289
290=back
291
230=item B<sha224> 292=item B<sha224>
231 293
232SHA-224 Digest 294SHA-224 Digest
@@ -243,8 +305,6 @@ SHA-384 Digest
243 305
244SHA-512 Digest 306SHA-512 Digest
245 307
246=back
247
248=head2 ENCODING AND CIPHER COMMANDS 308=head2 ENCODING AND CIPHER COMMANDS
249 309
250=over 10 310=over 10
@@ -339,7 +399,7 @@ read the password from standard input.
339L<asn1parse(1)|asn1parse(1)>, L<ca(1)|ca(1)>, L<config(5)|config(5)>, 399L<asn1parse(1)|asn1parse(1)>, L<ca(1)|ca(1)>, L<config(5)|config(5)>,
340L<crl(1)|crl(1)>, L<crl2pkcs7(1)|crl2pkcs7(1)>, L<dgst(1)|dgst(1)>, 400L<crl(1)|crl(1)>, L<crl2pkcs7(1)|crl2pkcs7(1)>, L<dgst(1)|dgst(1)>,
341L<dhparam(1)|dhparam(1)>, L<dsa(1)|dsa(1)>, L<dsaparam(1)|dsaparam(1)>, 401L<dhparam(1)|dhparam(1)>, L<dsa(1)|dsa(1)>, L<dsaparam(1)|dsaparam(1)>,
342L<enc(1)|enc(1)>, L<gendsa(1)|gendsa(1)>, 402L<enc(1)|enc(1)>, L<gendsa(1)|gendsa(1)>, L<genpkey(1)|genpkey(1)>,
343L<genrsa(1)|genrsa(1)>, L<nseq(1)|nseq(1)>, L<openssl(1)|openssl(1)>, 403L<genrsa(1)|genrsa(1)>, L<nseq(1)|nseq(1)>, L<openssl(1)|openssl(1)>,
344L<passwd(1)|passwd(1)>, 404L<passwd(1)|passwd(1)>,
345L<pkcs12(1)|pkcs12(1)>, L<pkcs7(1)|pkcs7(1)>, L<pkcs8(1)|pkcs8(1)>, 405L<pkcs12(1)|pkcs12(1)>, L<pkcs7(1)|pkcs7(1)>, L<pkcs8(1)|pkcs8(1)>,
@@ -348,12 +408,13 @@ L<rsautl(1)|rsautl(1)>, L<s_client(1)|s_client(1)>,
348L<s_server(1)|s_server(1)>, L<s_time(1)|s_time(1)>, 408L<s_server(1)|s_server(1)>, L<s_time(1)|s_time(1)>,
349L<smime(1)|smime(1)>, L<spkac(1)|spkac(1)>, 409L<smime(1)|smime(1)>, L<spkac(1)|spkac(1)>,
350L<verify(1)|verify(1)>, L<version(1)|version(1)>, L<x509(1)|x509(1)>, 410L<verify(1)|verify(1)>, L<version(1)|version(1)>, L<x509(1)|x509(1)>,
351L<crypto(3)|crypto(3)>, L<ssl(3)|ssl(3)> 411L<crypto(3)|crypto(3)>, L<ssl(3)|ssl(3)>, L<x509v3_config(5)|x509v3_config(5)>
352 412
353=head1 HISTORY 413=head1 HISTORY
354 414
355The openssl(1) document appeared in OpenSSL 0.9.2. 415The openssl(1) document appeared in OpenSSL 0.9.2.
356The B<list->I<XXX>B<-commands> pseudo-commands were added in OpenSSL 0.9.3; 416The B<list->I<XXX>B<-commands> pseudo-commands were added in OpenSSL 0.9.3;
417The B<list->I<XXX>B<-algorithms> pseudo-commands were added in OpenSSL 1.0.0;
357the B<no->I<XXX> pseudo-commands were added in OpenSSL 0.9.5a. 418the B<no->I<XXX> pseudo-commands were added in OpenSSL 0.9.5a.
358For notes on the availability of other commands, see their individual 419For notes on the availability of other commands, see their individual
359manual pages. 420manual pages.
diff --git a/src/lib/libssl/src/doc/apps/pkcs12.pod b/src/lib/libssl/src/doc/apps/pkcs12.pod
index 7d84146293..f69a5c5a4c 100644
--- a/src/lib/libssl/src/doc/apps/pkcs12.pod
+++ b/src/lib/libssl/src/doc/apps/pkcs12.pod
@@ -23,22 +23,23 @@ B<openssl> B<pkcs12>
23[B<-cacerts>] 23[B<-cacerts>]
24[B<-nokeys>] 24[B<-nokeys>]
25[B<-info>] 25[B<-info>]
26[B<-des>] 26[B<-des | -des3 | -idea | -aes128 | -aes192 | -aes256 | -camellia128 | -camellia192 | -camellia256 | -nodes>]
27[B<-des3>]
28[B<-idea>]
29[B<-nodes>]
30[B<-noiter>] 27[B<-noiter>]
31[B<-maciter>] 28[B<-maciter | -nomaciter | -nomac>]
32[B<-twopass>] 29[B<-twopass>]
33[B<-descert>] 30[B<-descert>]
34[B<-certpbe>] 31[B<-certpbe cipher>]
35[B<-keypbe>] 32[B<-keypbe cipher>]
33[B<-macalg digest>]
36[B<-keyex>] 34[B<-keyex>]
37[B<-keysig>] 35[B<-keysig>]
38[B<-password arg>] 36[B<-password arg>]
39[B<-passin arg>] 37[B<-passin arg>]
40[B<-passout arg>] 38[B<-passout arg>]
41[B<-rand file(s)>] 39[B<-rand file(s)>]
40[B<-CAfile file>]
41[B<-CApath dir>]
42[B<-CSP name>]
42 43
43=head1 DESCRIPTION 44=head1 DESCRIPTION
44 45
@@ -49,7 +50,7 @@ programs including Netscape, MSIE and MS Outlook.
49=head1 COMMAND OPTIONS 50=head1 COMMAND OPTIONS
50 51
51There are a lot of options the meaning of some depends of whether a PKCS#12 file 52There are a lot of options the meaning of some depends of whether a PKCS#12 file
52is being created or parsed. By default a PKCS#12 file is parsed a PKCS#12 53is being created or parsed. By default a PKCS#12 file is parsed. A PKCS#12
53file can be created by using the B<-export> option (see below). 54file can be created by using the B<-export> option (see below).
54 55
55=head1 PARSING OPTIONS 56=head1 PARSING OPTIONS
@@ -63,25 +64,25 @@ by default.
63 64
64=item B<-out filename> 65=item B<-out filename>
65 66
66The filename to write certificates and private keys to, standard output by default. 67The filename to write certificates and private keys to, standard output by
67They are all written in PEM format. 68default. They are all written in PEM format.
68 69
69=item B<-pass arg>, B<-passin arg> 70=item B<-pass arg>, B<-passin arg>
70 71
71the PKCS#12 file (i.e. input file) password source. For more information about the 72the PKCS#12 file (i.e. input file) password source. For more information about
72format of B<arg> see the B<PASS PHRASE ARGUMENTS> section in 73the format of B<arg> see the B<PASS PHRASE ARGUMENTS> section in
73L<openssl(1)|openssl(1)>. 74L<openssl(1)|openssl(1)>.
74 75
75=item B<-passout arg> 76=item B<-passout arg>
76 77
77pass phrase source to encrypt any outputed private keys with. For more information 78pass phrase source to encrypt any outputed private keys with. For more
78about the format of B<arg> see the B<PASS PHRASE ARGUMENTS> section in 79information about the format of B<arg> see the B<PASS PHRASE ARGUMENTS> section
79L<openssl(1)|openssl(1)>. 80in L<openssl(1)|openssl(1)>.
80 81
81=item B<-noout> 82=item B<-noout>
82 83
83this option inhibits output of the keys and certificates to the output file version 84this option inhibits output of the keys and certificates to the output file
84of the PKCS#12 file. 85version of the PKCS#12 file.
85 86
86=item B<-clcerts> 87=item B<-clcerts>
87 88
@@ -116,6 +117,14 @@ use triple DES to encrypt private keys before outputting, this is the default.
116 117
117use IDEA to encrypt private keys before outputting. 118use IDEA to encrypt private keys before outputting.
118 119
120=item B<-aes128>, B<-aes192>, B<-aes256>
121
122use AES to encrypt private keys before outputting.
123
124=item B<-camellia128>, B<-camellia192>, B<-camellia256>
125
126use Camellia to encrypt private keys before outputting.
127
119=item B<-nodes> 128=item B<-nodes>
120 129
121don't encrypt the private keys at all. 130don't encrypt the private keys at all.
@@ -148,10 +157,10 @@ by default.
148 157
149=item B<-in filename> 158=item B<-in filename>
150 159
151The filename to read certificates and private keys from, standard input by default. 160The filename to read certificates and private keys from, standard input by
152They must all be in PEM format. The order doesn't matter but one private key and 161default. They must all be in PEM format. The order doesn't matter but one
153its corresponding certificate should be present. If additional certificates are 162private key and its corresponding certificate should be present. If additional
154present they will also be included in the PKCS#12 file. 163certificates are present they will also be included in the PKCS#12 file.
155 164
156=item B<-inkey filename> 165=item B<-inkey filename>
157 166
@@ -160,8 +169,8 @@ in the input file.
160 169
161=item B<-name friendlyname> 170=item B<-name friendlyname>
162 171
163This specifies the "friendly name" for the certificate and private key. This name 172This specifies the "friendly name" for the certificate and private key. This
164is typically displayed in list boxes by software importing the file. 173name is typically displayed in list boxes by software importing the file.
165 174
166=item B<-certfile filename> 175=item B<-certfile filename>
167 176
@@ -201,9 +210,11 @@ key is encrypted using triple DES and the certificate using 40 bit RC2.
201=item B<-keypbe alg>, B<-certpbe alg> 210=item B<-keypbe alg>, B<-certpbe alg>
202 211
203these options allow the algorithm used to encrypt the private key and 212these options allow the algorithm used to encrypt the private key and
204certificates to be selected. Although any PKCS#5 v1.5 or PKCS#12 algorithms 213certificates to be selected. Any PKCS#5 v1.5 or PKCS#12 PBE algorithm name
205can be selected it is advisable only to use PKCS#12 algorithms. See the list 214can be used (see B<NOTES> section for more information). If a a cipher name
206in the B<NOTES> section for more information. 215(as output by the B<list-cipher-algorithms> command is specified then it
216is used with PKCS#5 v2.0. For interoperability reasons it is advisable to only
217use PKCS#12 algorithms.
207 218
208=item B<-keyex|-keysig> 219=item B<-keyex|-keysig>
209 220
@@ -216,6 +227,10 @@ S/MIME signing, authenticode (ActiveX control signing) and SSL client
216authentication, however due to a bug only MSIE 5.0 and later support 227authentication, however due to a bug only MSIE 5.0 and later support
217the use of signing only keys for SSL client authentication. 228the use of signing only keys for SSL client authentication.
218 229
230=item B<-macalg digest>
231
232specify the MAC digest algorithm. If not included them SHA1 will be used.
233
219=item B<-nomaciter>, B<-noiter> 234=item B<-nomaciter>, B<-noiter>
220 235
221these options affect the iteration counts on the MAC and key algorithms. 236these options affect the iteration counts on the MAC and key algorithms.
@@ -239,6 +254,10 @@ option.
239This option is included for compatibility with previous versions, it used 254This option is included for compatibility with previous versions, it used
240to be needed to use MAC iterations counts but they are now used by default. 255to be needed to use MAC iterations counts but they are now used by default.
241 256
257=item B<-nomac>
258
259don't attempt to provide the MAC integrity.
260
242=item B<-rand file(s)> 261=item B<-rand file(s)>
243 262
244a file or files containing random data used to seed the random number 263a file or files containing random data used to seed the random number
@@ -247,6 +266,20 @@ Multiple files can be specified separated by a OS-dependent character.
247The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for 266The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
248all others. 267all others.
249 268
269=item B<-CAfile file>
270
271CA storage as a file.
272
273=item B<-CApath dir>
274
275CA storage as a directory. This directory must be a standard certificate
276directory: that is a hash of each subject name (using B<x509 -hash>) should be
277linked to each certificate.
278
279=item B<-CSP name>
280
281write B<name> as a Microsoft CSP name.
282
250=back 283=back
251 284
252=head1 NOTES 285=head1 NOTES
diff --git a/src/lib/libssl/src/doc/apps/pkcs7.pod b/src/lib/libssl/src/doc/apps/pkcs7.pod
index a0a636328b..acfb8100f0 100644
--- a/src/lib/libssl/src/doc/apps/pkcs7.pod
+++ b/src/lib/libssl/src/doc/apps/pkcs7.pod
@@ -62,7 +62,7 @@ is B<-print_certs> is set).
62 62
63=item B<-engine id> 63=item B<-engine id>
64 64
65specifying an engine (by it's unique B<id> string) will cause B<req> 65specifying an engine (by its unique B<id> string) will cause B<pkcs7>
66to attempt to obtain a functional reference to the specified engine, 66to attempt to obtain a functional reference to the specified engine,
67thus initialising it if needed. The engine will then be set as the default 67thus initialising it if needed. The engine will then be set as the default
68for all available algorithms. 68for all available algorithms.
diff --git a/src/lib/libssl/src/doc/apps/pkcs8.pod b/src/lib/libssl/src/doc/apps/pkcs8.pod
index 68ecd65b10..84abee78f3 100644
--- a/src/lib/libssl/src/doc/apps/pkcs8.pod
+++ b/src/lib/libssl/src/doc/apps/pkcs8.pod
@@ -125,7 +125,7 @@ list of possible algorithms is included below.
125 125
126=item B<-engine id> 126=item B<-engine id>
127 127
128specifying an engine (by it's unique B<id> string) will cause B<req> 128specifying an engine (by its unique B<id> string) will cause B<pkcs8>
129to attempt to obtain a functional reference to the specified engine, 129to attempt to obtain a functional reference to the specified engine,
130thus initialising it if needed. The engine will then be set as the default 130thus initialising it if needed. The engine will then be set as the default
131for all available algorithms. 131for all available algorithms.
diff --git a/src/lib/libssl/src/doc/apps/req.pod b/src/lib/libssl/src/doc/apps/req.pod
index 82b565c9d4..ff48bbdf28 100644
--- a/src/lib/libssl/src/doc/apps/req.pod
+++ b/src/lib/libssl/src/doc/apps/req.pod
@@ -22,12 +22,13 @@ B<openssl> B<req>
22[B<-new>] 22[B<-new>]
23[B<-rand file(s)>] 23[B<-rand file(s)>]
24[B<-newkey rsa:bits>] 24[B<-newkey rsa:bits>]
25[B<-newkey dsa:file>] 25[B<-newkey alg:file>]
26[B<-nodes>] 26[B<-nodes>]
27[B<-key filename>] 27[B<-key filename>]
28[B<-keyform PEM|DER>] 28[B<-keyform PEM|DER>]
29[B<-keyout filename>] 29[B<-keyout filename>]
30[B<-[md5|sha1|md2|mdc2]>] 30[B<-keygen_engine id>]
31[B<-[digest]>]
31[B<-config filename>] 32[B<-config filename>]
32[B<-subj arg>] 33[B<-subj arg>]
33[B<-multivalue-rdn>] 34[B<-multivalue-rdn>]
@@ -35,11 +36,15 @@ B<openssl> B<req>
35[B<-days n>] 36[B<-days n>]
36[B<-set_serial n>] 37[B<-set_serial n>]
37[B<-asn1-kludge>] 38[B<-asn1-kludge>]
39[B<-no-asn1-kludge>]
38[B<-newhdr>] 40[B<-newhdr>]
39[B<-extensions section>] 41[B<-extensions section>]
40[B<-reqexts section>] 42[B<-reqexts section>]
41[B<-utf8>] 43[B<-utf8>]
42[B<-nameopt>] 44[B<-nameopt>]
45[B<-reqopt>]
46[B<-subject>]
47[B<-subj arg>]
43[B<-batch>] 48[B<-batch>]
44[B<-verbose>] 49[B<-verbose>]
45[B<-engine id>] 50[B<-engine id>]
@@ -91,6 +96,11 @@ see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>.
91 96
92prints out the certificate request in text form. 97prints out the certificate request in text form.
93 98
99=item B<-subject>
100
101prints out the request subject (or certificate subject if B<-x509> is
102specified)
103
94=item B<-pubkey> 104=item B<-pubkey>
95 105
96outputs the public key. 106outputs the public key.
@@ -118,6 +128,13 @@ in the configuration file and any requested extensions.
118If the B<-key> option is not used it will generate a new RSA private 128If the B<-key> option is not used it will generate a new RSA private
119key using information specified in the configuration file. 129key using information specified in the configuration file.
120 130
131=item B<-subj arg>
132
133Replaces subject field of input request with specified data and outputs
134modified request. The arg must be formatted as
135I</type0=value0/type1=value1/type2=...>,
136characters may be escaped by \ (backslash), no spaces are skipped.
137
121=item B<-rand file(s)> 138=item B<-rand file(s)>
122 139
123a file or files containing random data used to seed the random number 140a file or files containing random data used to seed the random number
@@ -129,10 +146,35 @@ all others.
129=item B<-newkey arg> 146=item B<-newkey arg>
130 147
131this option creates a new certificate request and a new private 148this option creates a new certificate request and a new private
132key. The argument takes one of two forms. B<rsa:nbits>, where 149key. The argument takes one of several forms. B<rsa:nbits>, where
133B<nbits> is the number of bits, generates an RSA key B<nbits> 150B<nbits> is the number of bits, generates an RSA key B<nbits>
134in size. B<dsa:filename> generates a DSA key using the parameters 151in size. If B<nbits> is omitted, i.e. B<-newkey rsa> specified,
135in the file B<filename>. 152the default key size, specified in the configuration file is used.
153
154All other algorithms support the B<-newkey alg:file> form, where file may be
155an algorithm parameter file, created by the B<genpkey -genparam> command
156or and X.509 certificate for a key with approriate algorithm.
157
158B<param:file> generates a key using the parameter file or certificate B<file>,
159the algorithm is determined by the parameters. B<algname:file> use algorithm
160B<algname> and parameter file B<file>: the two algorithms must match or an
161error occurs. B<algname> just uses algorithm B<algname>, and parameters,
162if neccessary should be specified via B<-pkeyopt> parameter.
163
164B<dsa:filename> generates a DSA key using the parameters
165in the file B<filename>. B<ec:filename> generates EC key (usable both with
166ECDSA or ECDH algorithms), B<gost2001:filename> generates GOST R
16734.10-2001 key (requires B<ccgost> engine configured in the configuration
168file). If just B<gost2001> is specified a parameter set should be
169specified by B<-pkeyopt paramset:X>
170
171
172=item B<-pkeyopt opt:value>
173
174set the public key algorithm option B<opt> to B<value>. The precise set of
175options supported depends on the public key algorithm used and its
176implementation. See B<KEY GENERATION OPTIONS> in the B<genpkey> manual page
177for more details.
136 178
137=item B<-key filename> 179=item B<-key filename>
138 180
@@ -155,11 +197,15 @@ configuration file is used.
155if this option is specified then if a private key is created it 197if this option is specified then if a private key is created it
156will not be encrypted. 198will not be encrypted.
157 199
158=item B<-[md5|sha1|md2|mdc2]> 200=item B<-[digest]>
201
202this specifies the message digest to sign the request with (such as
203B<-md5>, B<-sha1>). This overrides the digest algorithm specified in
204the configuration file.
159 205
160this specifies the message digest to sign the request with. This 206Some public key algorithms may override this choice. For instance, DSA
161overrides the digest algorithm specified in the configuration file. 207signatures always use SHA1, GOST R 34.10 signatures always use
162This option is ignored for DSA requests: they always use SHA1. 208GOST R 34.11-94 (B<-md_gost94>).
163 209
164=item B<-config filename> 210=item B<-config filename>
165 211
@@ -227,6 +273,15 @@ B<option> argument can be a single option or multiple options separated by
227commas. Alternatively the B<-nameopt> switch may be used more than once to 273commas. Alternatively the B<-nameopt> switch may be used more than once to
228set multiple options. See the L<x509(1)|x509(1)> manual page for details. 274set multiple options. See the L<x509(1)|x509(1)> manual page for details.
229 275
276=item B<-reqopt>
277
278customise the output format used with B<-text>. The B<option> argument can be
279a single option or multiple options separated by commas.
280
281See discission of the B<-certopt> parameter in the L<B<x509>|x509(1)>
282command.
283
284
230=item B<-asn1-kludge> 285=item B<-asn1-kludge>
231 286
232by default the B<req> command outputs certificate requests containing 287by default the B<req> command outputs certificate requests containing
@@ -242,6 +297,10 @@ B<SET OF> whereas the correct form does.
242 297
243It should be noted that very few CAs still require the use of this option. 298It should be noted that very few CAs still require the use of this option.
244 299
300=item B<-no-asn1-kludge>
301
302Reverses effect of B<-asn1-kludge>
303
245=item B<-newhdr> 304=item B<-newhdr>
246 305
247Adds the word B<NEW> to the PEM file header and footer lines on the outputed 306Adds the word B<NEW> to the PEM file header and footer lines on the outputed
@@ -257,11 +316,16 @@ print extra details about the operations being performed.
257 316
258=item B<-engine id> 317=item B<-engine id>
259 318
260specifying an engine (by it's unique B<id> string) will cause B<req> 319specifying an engine (by its unique B<id> string) will cause B<req>
261to attempt to obtain a functional reference to the specified engine, 320to attempt to obtain a functional reference to the specified engine,
262thus initialising it if needed. The engine will then be set as the default 321thus initialising it if needed. The engine will then be set as the default
263for all available algorithms. 322for all available algorithms.
264 323
324=item B<-keygen_engine id>
325
326specifies an engine (by its unique B<id> string) which would be used
327for key generation operations.
328
265=back 329=back
266 330
267=head1 CONFIGURATION FILE FORMAT 331=head1 CONFIGURATION FILE FORMAT
@@ -344,7 +408,9 @@ problems with BMPStrings and UTF8Strings: in particular Netscape.
344 408
345this specifies the configuration file section containing a list of 409this specifies the configuration file section containing a list of
346extensions to add to the certificate request. It can be overridden 410extensions to add to the certificate request. It can be overridden
347by the B<-reqexts> command line switch. 411by the B<-reqexts> command line switch. See the
412L<x509v3_config(5)|x509v3_config(5)> manual page for details of the
413extension section format.
348 414
349=item B<x509_extensions> 415=item B<x509_extensions>
350 416
@@ -606,6 +672,7 @@ address in subjectAltName should be input by the user.
606=head1 SEE ALSO 672=head1 SEE ALSO
607 673
608L<x509(1)|x509(1)>, L<ca(1)|ca(1)>, L<genrsa(1)|genrsa(1)>, 674L<x509(1)|x509(1)>, L<ca(1)|ca(1)>, L<genrsa(1)|genrsa(1)>,
609L<gendsa(1)|gendsa(1)>, L<config(5)|config(5)> 675L<gendsa(1)|gendsa(1)>, L<config(5)|config(5)>,
676L<x509v3_config(5)|x509v3_config(5)>
610 677
611=cut 678=cut
diff --git a/src/lib/libssl/src/doc/apps/rsa.pod b/src/lib/libssl/src/doc/apps/rsa.pod
index 4d7640995e..69b2bef82c 100644
--- a/src/lib/libssl/src/doc/apps/rsa.pod
+++ b/src/lib/libssl/src/doc/apps/rsa.pod
@@ -120,7 +120,7 @@ the input is a public key.
120 120
121=item B<-engine id> 121=item B<-engine id>
122 122
123specifying an engine (by it's unique B<id> string) will cause B<req> 123specifying an engine (by its unique B<id> string) will cause B<rsa>
124to attempt to obtain a functional reference to the specified engine, 124to attempt to obtain a functional reference to the specified engine,
125thus initialising it if needed. The engine will then be set as the default 125thus initialising it if needed. The engine will then be set as the default
126for all available algorithms. 126for all available algorithms.
diff --git a/src/lib/libssl/src/doc/apps/s_client.pod b/src/lib/libssl/src/doc/apps/s_client.pod
index c44d357cf7..4ebf7b5854 100644
--- a/src/lib/libssl/src/doc/apps/s_client.pod
+++ b/src/lib/libssl/src/doc/apps/s_client.pod
@@ -101,6 +101,11 @@ also used when building the client certificate chain.
101A file containing trusted certificates to use during server authentication 101A file containing trusted certificates to use during server authentication
102and to use when attempting to build the client certificate chain. 102and to use when attempting to build the client certificate chain.
103 103
104=item B<-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig>
105
106Set various certificate chain valiadition option. See the
107L<B<verify>|verify(1)> manual page for details.
108
104=item B<-reconnect> 109=item B<-reconnect>
105 110
106reconnects to the same server 5 times using the same session ID, this can 111reconnects to the same server 5 times using the same session ID, this can
@@ -161,6 +166,16 @@ input.
161inhibit printing of session and certificate information. This implicitly 166inhibit printing of session and certificate information. This implicitly
162turns on B<-ign_eof> as well. 167turns on B<-ign_eof> as well.
163 168
169=item B<-psk_identity identity>
170
171Use the PSK identity B<identity> when using a PSK cipher suite.
172
173=item B<-psk key>
174
175Use the PSK key B<key> when using a PSK cipher suite. The key is
176given as a hexadecimal number without leading 0x, for example -psk
1771a2b3c4d.
178
164=item B<-ssl2>, B<-ssl3>, B<-tls1>, B<-no_ssl2>, B<-no_ssl3>, B<-no_tls1> 179=item B<-ssl2>, B<-ssl3>, B<-tls1>, B<-no_ssl2>, B<-no_ssl3>, B<-no_tls1>
165 180
166these options disable the use of certain SSL or TLS protocols. By default 181these options disable the use of certain SSL or TLS protocols. By default
@@ -192,14 +207,11 @@ supported keywords are "smtp", "pop3", "imap", and "ftp".
192 207
193=item B<-tlsextdebug> 208=item B<-tlsextdebug>
194 209
195print out a hex dump of any TLS extensions received from the server. Note: this 210print out a hex dump of any TLS extensions received from the server.
196option is only available if extension support is explicitly enabled at compile
197time
198 211
199=item B<-no_ticket> 212=item B<-no_ticket>
200 213
201disable RFC4507bis session ticket support. Note: this option is only available 214disable RFC4507bis session ticket support.
202if extension support is explicitly enabled at compile time
203 215
204=item B<-sess_out filename> 216=item B<-sess_out filename>
205 217
@@ -212,7 +224,7 @@ connection from this session.
212 224
213=item B<-engine id> 225=item B<-engine id>
214 226
215specifying an engine (by it's unique B<id> string) will cause B<s_client> 227specifying an engine (by its unique B<id> string) will cause B<s_client>
216to attempt to obtain a functional reference to the specified engine, 228to attempt to obtain a functional reference to the specified engine,
217thus initialising it if needed. The engine will then be set as the default 229thus initialising it if needed. The engine will then be set as the default
218for all available algorithms. 230for all available algorithms.
@@ -274,9 +286,6 @@ Since the SSLv23 client hello cannot include compression methods or extensions
274these will only be supported if its use is disabled, for example by using the 286these will only be supported if its use is disabled, for example by using the
275B<-no_sslv2> option. 287B<-no_sslv2> option.
276 288
277TLS extensions are only supported in OpenSSL 0.9.8 if they are explictly
278enabled at compile time using for example the B<enable-tlsext> switch.
279
280=head1 BUGS 289=head1 BUGS
281 290
282Because this program has a lot of options and also because some of 291Because this program has a lot of options and also because some of
diff --git a/src/lib/libssl/src/doc/apps/s_server.pod b/src/lib/libssl/src/doc/apps/s_server.pod
index fdcc170e28..3e503e17e1 100644
--- a/src/lib/libssl/src/doc/apps/s_server.pod
+++ b/src/lib/libssl/src/doc/apps/s_server.pod
@@ -191,6 +191,16 @@ this option translated a line feed from the terminal into CR+LF.
191 191
192inhibit printing of session and certificate information. 192inhibit printing of session and certificate information.
193 193
194=item B<-psk_hint hint>
195
196Use the PSK identity hint B<hint> when using a PSK cipher suite.
197
198=item B<-psk key>
199
200Use the PSK key B<key> when using a PSK cipher suite. The key is
201given as a hexadecimal number without leading 0x, for example -psk
2021a2b3c4d.
203
194=item B<-ssl2>, B<-ssl3>, B<-tls1>, B<-no_ssl2>, B<-no_ssl3>, B<-no_tls1> 204=item B<-ssl2>, B<-ssl3>, B<-tls1>, B<-no_ssl2>, B<-no_ssl3>, B<-no_tls1>
195 205
196these options disable the use of certain SSL or TLS protocols. By default 206these options disable the use of certain SSL or TLS protocols. By default
@@ -246,7 +256,7 @@ are part of the HTTP response line and headers must end with CRLF).
246 256
247=item B<-engine id> 257=item B<-engine id>
248 258
249specifying an engine (by it's unique B<id> string) will cause B<s_server> 259specifying an engine (by its unique B<id> string) will cause B<s_server>
250to attempt to obtain a functional reference to the specified engine, 260to attempt to obtain a functional reference to the specified engine,
251thus initialising it if needed. The engine will then be set as the default 261thus initialising it if needed. The engine will then be set as the default
252for all available algorithms. 262for all available algorithms.
@@ -325,9 +335,6 @@ mean any CA is acceptable. This is useful for debugging purposes.
325 335
326The session parameters can printed out using the B<sess_id> program. 336The session parameters can printed out using the B<sess_id> program.
327 337
328TLS extensions are only supported in OpenSSL 0.9.8 if they are explictly
329enabled at compile time using for example the B<enable-tlsext> switch.
330
331=head1 BUGS 338=head1 BUGS
332 339
333Because this program has a lot of options and also because some of 340Because this program has a lot of options and also because some of
diff --git a/src/lib/libssl/src/doc/apps/smime.pod b/src/lib/libssl/src/doc/apps/smime.pod
index caf2d2689e..42c0733bcb 100644
--- a/src/lib/libssl/src/doc/apps/smime.pod
+++ b/src/lib/libssl/src/doc/apps/smime.pod
@@ -10,19 +10,10 @@ B<openssl> B<smime>
10[B<-encrypt>] 10[B<-encrypt>]
11[B<-decrypt>] 11[B<-decrypt>]
12[B<-sign>] 12[B<-sign>]
13[B<-resign>]
13[B<-verify>] 14[B<-verify>]
14[B<-pk7out>] 15[B<-pk7out>]
15[B<-des>] 16[B<-[cipher]>]
16[B<-des3>]
17[B<-rc2-40>]
18[B<-rc2-64>]
19[B<-rc2-128>]
20[B<-aes128>]
21[B<-aes192>]
22[B<-aes256>]
23[B<-camellia128>]
24[B<-camellia192>]
25[B<-camellia256>]
26[B<-in file>] 17[B<-in file>]
27[B<-certfile file>] 18[B<-certfile file>]
28[B<-signer file>] 19[B<-signer file>]
@@ -37,7 +28,11 @@ B<openssl> B<smime>
37[B<-from ad>] 28[B<-from ad>]
38[B<-subject s>] 29[B<-subject s>]
39[B<-text>] 30[B<-text>]
31[B<-indef>]
32[B<-noindef>]
33[B<-stream>]
40[B<-rand file(s)>] 34[B<-rand file(s)>]
35[B<-md digest>]
41[cert.pem]... 36[cert.pem]...
42 37
43=head1 DESCRIPTION 38=head1 DESCRIPTION
@@ -47,7 +42,7 @@ verify S/MIME messages.
47 42
48=head1 COMMAND OPTIONS 43=head1 COMMAND OPTIONS
49 44
50There are five operation options that set the type of operation to be performed. 45There are six operation options that set the type of operation to be performed.
51The meaning of the other options varies according to the operation type. 46The meaning of the other options varies according to the operation type.
52 47
53=over 4 48=over 4
@@ -78,6 +73,10 @@ the signed data. Both clear text and opaque signing is supported.
78 73
79takes an input message and writes out a PEM encoded PKCS#7 structure. 74takes an input message and writes out a PEM encoded PKCS#7 structure.
80 75
76=item B<-resign>
77
78resign a message: take an existing message and one or more new signers.
79
81=item B<-in filename> 80=item B<-in filename>
82 81
83the input message to be encrypted or signed or the MIME message to 82the input message to be encrypted or signed or the MIME message to
@@ -106,6 +105,21 @@ instead. This currently only affects the output format of the PKCS#7
106structure, if no PKCS#7 structure is being output (for example with 105structure, if no PKCS#7 structure is being output (for example with
107B<-verify> or B<-decrypt>) this option has no effect. 106B<-verify> or B<-decrypt>) this option has no effect.
108 107
108=item B<-stream -indef -noindef>
109
110the B<-stream> and B<-indef> options are equivalent and enable streaming I/O
111for encoding operations. This permits single pass processing of data without
112the need to hold the entire contents in memory, potentially supporting very
113large files. Streaming is automatically set for S/MIME signing with detached
114data if the output format is B<SMIME> it is currently off by default for all
115other operations.
116
117=item B<-noindef>
118
119disable streaming I/O where it would produce and indefinite length constructed
120encoding. This option currently has no effect. In future streaming will be
121enabled by default on all relevant operations and this option will disable it.
122
109=item B<-content filename> 123=item B<-content filename>
110 124
111This specifies a file containing the detached content, this is only 125This specifies a file containing the detached content, this is only
@@ -132,11 +146,20 @@ B<-verify>. This directory must be a standard certificate directory: that
132is a hash of each subject name (using B<x509 -hash>) should be linked 146is a hash of each subject name (using B<x509 -hash>) should be linked
133to each certificate. 147to each certificate.
134 148
135=item B<-des -des3 -rc2-40 -rc2-64 -rc2-128 -aes128 -aes192 -aes256 -camellia128 -camellia192 -camellia256> 149=item B<-md digest>
136 150
137the encryption algorithm to use. DES (56 bits), triple DES (168 bits), 151digest algorithm to use when signing or resigning. If not present then the
13840, 64 or 128 bit RC2, 128, 192 or 256 bit AES, or 128, 192 or 256 bit Camellia respectively. If not 152default digest algorithm for the signing key will be used (usually SHA1).
139specified 40 bit RC2 is used. Only used with B<-encrypt>. 153
154=item B<-[cipher]>
155
156the encryption algorithm to use. For example DES (56 bits) - B<-des>,
157triple DES (168 bits) - B<-des3>,
158EVP_get_cipherbyname() function) can also be used preceded by a dash, for
159example B<-aes_128_cbc>. See L<B<enc>|enc(1)> for list of ciphers
160supported by your version of OpenSSL.
161
162If not specified 40 bit RC2 is used. Only used with B<-encrypt>.
140 163
141=item B<-nointern> 164=item B<-nointern>
142 165
@@ -193,9 +216,10 @@ the signers certificates. The certificates should be in PEM format.
193 216
194=item B<-signer file> 217=item B<-signer file>
195 218
196the signers certificate when signing a message. If a message is 219a signing certificate when signing or resigning a message, this option can be
197being verified then the signers certificates will be written to this 220used multiple times if more than one signer is required. If a message is being
198file if the verification was successful. 221verified then the signers certificates will be written to this file if the
222verification was successful.
199 223
200=item B<-recip file> 224=item B<-recip file>
201 225
@@ -207,7 +231,8 @@ must match one of the recipients of the message or an error occurs.
207the private key to use when signing or decrypting. This must match the 231the private key to use when signing or decrypting. This must match the
208corresponding certificate. If this option is not specified then the 232corresponding certificate. If this option is not specified then the
209private key must be included in the certificate file specified with 233private key must be included in the certificate file specified with
210the B<-recip> or B<-signer> file. 234the B<-recip> or B<-signer> file. When signing this option can be used
235multiple times to specify successive keys.
211 236
212=item B<-passin arg> 237=item B<-passin arg>
213 238
@@ -234,6 +259,11 @@ portion of a message so they may be included manually. If signing
234then many S/MIME mail clients check the signers certificate's email 259then many S/MIME mail clients check the signers certificate's email
235address matches that specified in the From: address. 260address matches that specified in the From: address.
236 261
262=item B<-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig>
263
264Set various options of certificate chain verification. See
265L<B<verify>|verify(1)> manual page for details.
266
237=back 267=back
238 268
239=head1 NOTES 269=head1 NOTES
@@ -261,6 +291,19 @@ The options B<-encrypt> and B<-decrypt> reflect common usage in S/MIME
261clients. Strictly speaking these process PKCS#7 enveloped data: PKCS#7 291clients. Strictly speaking these process PKCS#7 enveloped data: PKCS#7
262encrypted data is used for other purposes. 292encrypted data is used for other purposes.
263 293
294The B<-resign> option uses an existing message digest when adding a new
295signer. This means that attributes must be present in at least one existing
296signer using the same message digest or this operation will fail.
297
298The B<-stream> and B<-indef> options enable experimental streaming I/O support.
299As a result the encoding is BER using indefinite length constructed encoding
300and no longer DER. Streaming is supported for the B<-encrypt> operation and the
301B<-sign> operation if the content is not detached.
302
303Streaming is always used for the B<-sign> operation with detached data but
304since the content is no longer part of the PKCS#7 structure the encoding
305remains DER.
306
264=head1 EXIT CODES 307=head1 EXIT CODES
265 308
266=over 4 309=over 4
@@ -300,7 +343,7 @@ Create a cleartext signed message:
300 openssl smime -sign -in message.txt -text -out mail.msg \ 343 openssl smime -sign -in message.txt -text -out mail.msg \
301 -signer mycert.pem 344 -signer mycert.pem
302 345
303Create and opaque signed message 346Create an opaque signed message
304 347
305 openssl smime -sign -in message.txt -text -out mail.msg -nodetach \ 348 openssl smime -sign -in message.txt -text -out mail.msg -nodetach \
306 -signer mycert.pem 349 -signer mycert.pem
@@ -311,6 +354,11 @@ read the private key from another file:
311 openssl smime -sign -in in.txt -text -out mail.msg \ 354 openssl smime -sign -in in.txt -text -out mail.msg \
312 -signer mycert.pem -inkey mykey.pem -certfile mycerts.pem 355 -signer mycert.pem -inkey mykey.pem -certfile mycerts.pem
313 356
357Create a signed message with two signers:
358
359 openssl smime -sign -in message.txt -text -out mail.msg \
360 -signer mycert.pem -signer othercert.pem
361
314Send a signed message under Unix directly to sendmail, including headers: 362Send a signed message under Unix directly to sendmail, including headers:
315 363
316 openssl smime -sign -in in.txt -text -signer mycert.pem \ 364 openssl smime -sign -in in.txt -text -signer mycert.pem \
@@ -334,8 +382,8 @@ Sign and encrypt mail:
334 -from steve@openssl.org -to someone@somewhere \ 382 -from steve@openssl.org -to someone@somewhere \
335 -subject "Signed and Encrypted message" -des3 user.pem 383 -subject "Signed and Encrypted message" -des3 user.pem
336 384
337Note: the encryption command does not include the B<-text> option because the message 385Note: the encryption command does not include the B<-text> option because the
338being encrypted already has MIME headers. 386message being encrypted already has MIME headers.
339 387
340Decrypt mail: 388Decrypt mail:
341 389
@@ -361,16 +409,22 @@ Create an encrypted message using 128 bit Camellia:
361 409
362 openssl smime -encrypt -in plain.txt -camellia128 -out mail.msg cert.pem 410 openssl smime -encrypt -in plain.txt -camellia128 -out mail.msg cert.pem
363 411
412Add a signer to an existing message:
413
414 openssl smime -resign -in mail.msg -signer newsign.pem -out mail2.msg
415
364=head1 BUGS 416=head1 BUGS
365 417
366The MIME parser isn't very clever: it seems to handle most messages that I've thrown 418The MIME parser isn't very clever: it seems to handle most messages that I've
367at it but it may choke on others. 419thrown at it but it may choke on others.
368 420
369The code currently will only write out the signer's certificate to a file: if the 421The code currently will only write out the signer's certificate to a file: if
370signer has a separate encryption certificate this must be manually extracted. There 422the signer has a separate encryption certificate this must be manually
371should be some heuristic that determines the correct encryption certificate. 423extracted. There should be some heuristic that determines the correct
424encryption certificate.
372 425
373Ideally a database should be maintained of a certificates for each email address. 426Ideally a database should be maintained of a certificates for each email
427address.
374 428
375The code doesn't currently take note of the permitted symmetric encryption 429The code doesn't currently take note of the permitted symmetric encryption
376algorithms as supplied in the SMIMECapabilities signed attribute. this means the 430algorithms as supplied in the SMIMECapabilities signed attribute. this means the
@@ -382,4 +436,10 @@ No revocation checking is done on the signer's certificate.
382The current code can only handle S/MIME v2 messages, the more complex S/MIME v3 436The current code can only handle S/MIME v2 messages, the more complex S/MIME v3
383structures may cause parsing errors. 437structures may cause parsing errors.
384 438
439=head1 HISTORY
440
441The use of multiple B<-signer> options and the B<-resign> command were first
442added in OpenSSL 1.0.0
443
444
385=cut 445=cut
diff --git a/src/lib/libssl/src/doc/apps/speed.pod b/src/lib/libssl/src/doc/apps/speed.pod
index 0dcdba873e..1cd1998d16 100644
--- a/src/lib/libssl/src/doc/apps/speed.pod
+++ b/src/lib/libssl/src/doc/apps/speed.pod
@@ -44,7 +44,7 @@ This command is used to test the performance of cryptographic algorithms.
44 44
45=item B<-engine id> 45=item B<-engine id>
46 46
47specifying an engine (by it's unique B<id> string) will cause B<speed> 47specifying an engine (by its unique B<id> string) will cause B<speed>
48to attempt to obtain a functional reference to the specified engine, 48to attempt to obtain a functional reference to the specified engine,
49thus initialising it if needed. The engine will then be set as the default 49thus initialising it if needed. The engine will then be set as the default
50for all available algorithms. 50for all available algorithms.
diff --git a/src/lib/libssl/src/doc/apps/spkac.pod b/src/lib/libssl/src/doc/apps/spkac.pod
index c3f1ff9c64..97fb80e401 100644
--- a/src/lib/libssl/src/doc/apps/spkac.pod
+++ b/src/lib/libssl/src/doc/apps/spkac.pod
@@ -81,7 +81,7 @@ verifies the digital signature on the supplied SPKAC.
81 81
82=item B<-engine id> 82=item B<-engine id>
83 83
84specifying an engine (by it's unique B<id> string) will cause B<req> 84specifying an engine (by its unique B<id> string) will cause B<spkac>
85to attempt to obtain a functional reference to the specified engine, 85to attempt to obtain a functional reference to the specified engine,
86thus initialising it if needed. The engine will then be set as the default 86thus initialising it if needed. The engine will then be set as the default
87for all available algorithms. 87for all available algorithms.
diff --git a/src/lib/libssl/src/doc/apps/verify.pod b/src/lib/libssl/src/doc/apps/verify.pod
index ff2629d2cf..336098f1e3 100644
--- a/src/lib/libssl/src/doc/apps/verify.pod
+++ b/src/lib/libssl/src/doc/apps/verify.pod
@@ -10,6 +10,18 @@ B<openssl> B<verify>
10[B<-CApath directory>] 10[B<-CApath directory>]
11[B<-CAfile file>] 11[B<-CAfile file>]
12[B<-purpose purpose>] 12[B<-purpose purpose>]
13[B<-policy arg>]
14[B<-ignore_critical>]
15[B<-crl_check>]
16[B<-crl_check_all>]
17[B<-policy_check>]
18[B<-explicit_policy>]
19[B<-inhibit_any>]
20[B<-inhibit_map>]
21[B<-x509_strict>]
22[B<-extended_crl>]
23[B<-use_deltas>]
24[B<-policy_print>]
13[B<-untrusted file>] 25[B<-untrusted file>]
14[B<-help>] 26[B<-help>]
15[B<-issuer_checks>] 27[B<-issuer_checks>]
@@ -66,6 +78,68 @@ certificate was rejected. However the presence of rejection messages
66does not itself imply that anything is wrong: during the normal 78does not itself imply that anything is wrong: during the normal
67verify process several rejections may take place. 79verify process several rejections may take place.
68 80
81=item B<-policy arg>
82
83Enable policy processing and add B<arg> to the user-initial-policy-set
84(see RFC3280 et al). The policy B<arg> can be an object name an OID in numeric
85form. This argument can appear more than once.
86
87=item B<-policy_check>
88
89Enables certificate policy processing.
90
91=item B<-explicit_policy>
92
93Set policy variable require-explicit-policy (see RFC3280 et al).
94
95=item B<-inhibit_any>
96
97Set policy variable inhibit-any-policy (see RFC3280 et al).
98
99=item B<-inhibit_map>
100
101Set policy variable inhibit-policy-mapping (see RFC3280 et al).
102
103=item B<-policy_print>
104
105Print out diagnostics, related to policy checking
106
107=item B<-crl_check>
108
109Checks end entity certificate validity by attempting to lookup a valid CRL.
110If a valid CRL cannot be found an error occurs.
111
112=item B<-crl_check_all>
113
114Checks the validity of B<all> certificates in the chain by attempting
115to lookup valid CRLs.
116
117=item B<-ignore_critical>
118
119Normally if an unhandled critical extension is present which is not
120supported by OpenSSL the certificate is rejected (as required by
121RFC3280 et al). If this option is set critical extensions are
122ignored.
123
124=item B<-x509_strict>
125
126Disable workarounds for broken certificates which have to be disabled
127for strict X.509 compliance.
128
129=item B<-extended_crl>
130
131Enable extended CRL features such as indirect CRLs and alternate CRL
132signing keys.
133
134=item B<-use_deltas>
135
136Enable support for delta CRLs.
137
138=item B<-check_ss_sig>
139
140Verify the signature on the self-signed root CA. This is disabled by default
141because it doesn't add any security.
142
69=item B<-> 143=item B<->
70 144
71marks the last option. All arguments following this are assumed to be 145marks the last option. All arguments following this are assumed to be
@@ -166,12 +240,12 @@ the operation was successful.
166 240
167=item B<2 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: unable to get issuer certificate> 241=item B<2 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: unable to get issuer certificate>
168 242
169the issuer certificate could not be found: this occurs if the issuer certificate 243the issuer certificate of a looked up certificate could not be found. This
170of an untrusted certificate cannot be found. 244normally means the list of trusted certificates is not complete.
171 245
172=item B<3 X509_V_ERR_UNABLE_TO_GET_CRL: unable to get certificate CRL> 246=item B<3 X509_V_ERR_UNABLE_TO_GET_CRL: unable to get certificate CRL>
173 247
174the CRL of a certificate could not be found. Unused. 248the CRL of a certificate could not be found.
175 249
176=item B<4 X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: unable to decrypt certificate's signature> 250=item B<4 X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: unable to decrypt certificate's signature>
177 251
@@ -194,7 +268,7 @@ the signature of the certificate is invalid.
194 268
195=item B<8 X509_V_ERR_CRL_SIGNATURE_FAILURE: CRL signature failure> 269=item B<8 X509_V_ERR_CRL_SIGNATURE_FAILURE: CRL signature failure>
196 270
197the signature of the certificate is invalid. Unused. 271the signature of the certificate is invalid.
198 272
199=item B<9 X509_V_ERR_CERT_NOT_YET_VALID: certificate is not yet valid> 273=item B<9 X509_V_ERR_CERT_NOT_YET_VALID: certificate is not yet valid>
200 274
@@ -206,11 +280,11 @@ the certificate has expired: that is the notAfter date is before the current tim
206 280
207=item B<11 X509_V_ERR_CRL_NOT_YET_VALID: CRL is not yet valid> 281=item B<11 X509_V_ERR_CRL_NOT_YET_VALID: CRL is not yet valid>
208 282
209the CRL is not yet valid. Unused. 283the CRL is not yet valid.
210 284
211=item B<12 X509_V_ERR_CRL_HAS_EXPIRED: CRL has expired> 285=item B<12 X509_V_ERR_CRL_HAS_EXPIRED: CRL has expired>
212 286
213the CRL has expired. Unused. 287the CRL has expired.
214 288
215=item B<13 X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: format error in certificate's notBefore field> 289=item B<13 X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: format error in certificate's notBefore field>
216 290
@@ -222,11 +296,11 @@ the certificate notAfter field contains an invalid time.
222 296
223=item B<15 X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD: format error in CRL's lastUpdate field> 297=item B<15 X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD: format error in CRL's lastUpdate field>
224 298
225the CRL lastUpdate field contains an invalid time. Unused. 299the CRL lastUpdate field contains an invalid time.
226 300
227=item B<16 X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: format error in CRL's nextUpdate field> 301=item B<16 X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: format error in CRL's nextUpdate field>
228 302
229the CRL nextUpdate field contains an invalid time. Unused. 303the CRL nextUpdate field contains an invalid time.
230 304
231=item B<17 X509_V_ERR_OUT_OF_MEM: out of memory> 305=item B<17 X509_V_ERR_OUT_OF_MEM: out of memory>
232 306
@@ -244,8 +318,8 @@ be found locally.
244 318
245=item B<20 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: unable to get local issuer certificate> 319=item B<20 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: unable to get local issuer certificate>
246 320
247the issuer certificate of a locally looked up certificate could not be found. This normally means 321the issuer certificate could not be found: this occurs if the issuer
248the list of trusted certificates is not complete. 322certificate of an untrusted certificate cannot be found.
249 323
250=item B<21 X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: unable to verify the first certificate> 324=item B<21 X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: unable to verify the first certificate>
251 325
@@ -258,7 +332,7 @@ the certificate chain length is greater than the supplied maximum depth. Unused.
258 332
259=item B<23 X509_V_ERR_CERT_REVOKED: certificate revoked> 333=item B<23 X509_V_ERR_CERT_REVOKED: certificate revoked>
260 334
261the certificate has been revoked. Unused. 335the certificate has been revoked.
262 336
263=item B<24 X509_V_ERR_INVALID_CA: invalid CA certificate> 337=item B<24 X509_V_ERR_INVALID_CA: invalid CA certificate>
264 338
@@ -321,6 +395,10 @@ the certificates in the file will be recognised.
321Previous versions of OpenSSL assume certificates with matching subject name are identical and 395Previous versions of OpenSSL assume certificates with matching subject name are identical and
322mishandled them. 396mishandled them.
323 397
398Previous versions of this documentation swapped the meaning of the
399B<X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT> and
400B<20 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY> error codes.
401
324=head1 SEE ALSO 402=head1 SEE ALSO
325 403
326L<x509(1)|x509(1)> 404L<x509(1)|x509(1)>
diff --git a/src/lib/libssl/src/doc/apps/x509.pod b/src/lib/libssl/src/doc/apps/x509.pod
index f43c175235..3002b08123 100644
--- a/src/lib/libssl/src/doc/apps/x509.pod
+++ b/src/lib/libssl/src/doc/apps/x509.pod
@@ -23,6 +23,7 @@ B<openssl> B<x509>
23[B<-issuer>] 23[B<-issuer>]
24[B<-nameopt option>] 24[B<-nameopt option>]
25[B<-email>] 25[B<-email>]
26[B<-ocsp_uri>]
26[B<-startdate>] 27[B<-startdate>]
27[B<-enddate>] 28[B<-enddate>]
28[B<-purpose>] 29[B<-purpose>]
@@ -103,7 +104,7 @@ then this option has no effect: SHA1 is always used with DSA keys.
103 104
104=item B<-engine id> 105=item B<-engine id>
105 106
106specifying an engine (by it's unique B<id> string) will cause B<req> 107specifying an engine (by its unique B<id> string) will cause B<x509>
107to attempt to obtain a functional reference to the specified engine, 108to attempt to obtain a functional reference to the specified engine,
108thus initialising it if needed. The engine will then be set as the default 109thus initialising it if needed. The engine will then be set as the default
109for all available algorithms. 110for all available algorithms.
@@ -157,6 +158,16 @@ outputs the "hash" of the certificate issuer name.
157 158
158synonym for "-subject_hash" for backward compatibility reasons. 159synonym for "-subject_hash" for backward compatibility reasons.
159 160
161=item B<-subject_hash_old>
162
163outputs the "hash" of the certificate subject name using the older algorithm
164as used by OpenSSL versions before 1.0.0.
165
166=item B<-issuer_hash_old>
167
168outputs the "hash" of the certificate issuer name using the older algorithm
169as used by OpenSSL versions before 1.0.0.
170
160=item B<-subject> 171=item B<-subject>
161 172
162outputs the subject name. 173outputs the subject name.
@@ -176,6 +187,10 @@ set multiple options. See the B<NAME OPTIONS> section for more information.
176 187
177outputs the email address(es) if any. 188outputs the email address(es) if any.
178 189
190=item B<-ocsp_uri>
191
192outputs the OCSP responder address(es) if any.
193
179=item B<-startdate> 194=item B<-startdate>
180 195
181prints out the start date of the certificate, that is the notBefore date. 196prints out the start date of the certificate, that is the notBefore date.
@@ -376,7 +391,9 @@ no extensions are added to the certificate.
376the section to add certificate extensions from. If this option is not 391the section to add certificate extensions from. If this option is not
377specified then the extensions should either be contained in the unnamed 392specified then the extensions should either be contained in the unnamed
378(default) section or the default section should contain a variable called 393(default) section or the default section should contain a variable called
379"extensions" which contains the section to use. 394"extensions" which contains the section to use. See the
395L<x509v3_config(5)|x509v3_config(5)> manual page for details of the
396extension section format.
380 397
381=back 398=back
382 399
@@ -823,10 +840,17 @@ OpenSSL 0.9.5 and later.
823=head1 SEE ALSO 840=head1 SEE ALSO
824 841
825L<req(1)|req(1)>, L<ca(1)|ca(1)>, L<genrsa(1)|genrsa(1)>, 842L<req(1)|req(1)>, L<ca(1)|ca(1)>, L<genrsa(1)|genrsa(1)>,
826L<gendsa(1)|gendsa(1)>, L<verify(1)|verify(1)> 843L<gendsa(1)|gendsa(1)>, L<verify(1)|verify(1)>,
844L<x509v3_config(5)|x509v3_config(5)>
827 845
828=head1 HISTORY 846=head1 HISTORY
829 847
830Before OpenSSL 0.9.8, the default digest for RSA keys was MD5. 848Before OpenSSL 0.9.8, the default digest for RSA keys was MD5.
831 849
850The hash algorithm used in the B<-subject_hash> and B<-issuer_hash> options
851before OpenSSL 1.0.0 was based on the deprecated MD5 algorithm and the encoding
852of the distinguished name. In OpenSSL 1.0.0 and later it is based on a
853canonical version of the DN using SHA1. This means that any directories using
854the old form must have their links rebuilt using B<c_rehash> or similar.
855
832=cut 856=cut
diff --git a/src/lib/libssl/src/doc/crypto/ASN1_OBJECT_new.pod b/src/lib/libssl/src/doc/crypto/ASN1_OBJECT_new.pod
index 51679bfcd9..9bae40fccf 100644
--- a/src/lib/libssl/src/doc/crypto/ASN1_OBJECT_new.pod
+++ b/src/lib/libssl/src/doc/crypto/ASN1_OBJECT_new.pod
@@ -6,6 +6,8 @@ ASN1_OBJECT_new, ASN1_OBJECT_free, - object allocation functions
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/asn1.h>
10
9 ASN1_OBJECT *ASN1_OBJECT_new(void); 11 ASN1_OBJECT *ASN1_OBJECT_new(void);
10 void ASN1_OBJECT_free(ASN1_OBJECT *a); 12 void ASN1_OBJECT_free(ASN1_OBJECT *a);
11 13
diff --git a/src/lib/libssl/src/doc/crypto/ASN1_STRING_length.pod b/src/lib/libssl/src/doc/crypto/ASN1_STRING_length.pod
index c4ec693f17..a08e9a0fa4 100644
--- a/src/lib/libssl/src/doc/crypto/ASN1_STRING_length.pod
+++ b/src/lib/libssl/src/doc/crypto/ASN1_STRING_length.pod
@@ -8,6 +8,8 @@ ASN1_STRING utility functions
8 8
9=head1 SYNOPSIS 9=head1 SYNOPSIS
10 10
11 #include <openssl/asn1.h>
12
11 int ASN1_STRING_length(ASN1_STRING *x); 13 int ASN1_STRING_length(ASN1_STRING *x);
12 unsigned char * ASN1_STRING_data(ASN1_STRING *x); 14 unsigned char * ASN1_STRING_data(ASN1_STRING *x);
13 15
diff --git a/src/lib/libssl/src/doc/crypto/ASN1_STRING_new.pod b/src/lib/libssl/src/doc/crypto/ASN1_STRING_new.pod
index 5b1bbb7eb2..8ac2a03ae2 100644
--- a/src/lib/libssl/src/doc/crypto/ASN1_STRING_new.pod
+++ b/src/lib/libssl/src/doc/crypto/ASN1_STRING_new.pod
@@ -7,6 +7,8 @@ ASN1_STRING allocation functions
7 7
8=head1 SYNOPSIS 8=head1 SYNOPSIS
9 9
10 #include <openssl/asn1.h>
11
10 ASN1_STRING * ASN1_STRING_new(void); 12 ASN1_STRING * ASN1_STRING_new(void);
11 ASN1_STRING * ASN1_STRING_type_new(int type); 13 ASN1_STRING * ASN1_STRING_type_new(int type);
12 void ASN1_STRING_free(ASN1_STRING *a); 14 void ASN1_STRING_free(ASN1_STRING *a);
diff --git a/src/lib/libssl/src/doc/crypto/BIO_f_buffer.pod b/src/lib/libssl/src/doc/crypto/BIO_f_buffer.pod
index c9093c6a57..c0dccf1abe 100644
--- a/src/lib/libssl/src/doc/crypto/BIO_f_buffer.pod
+++ b/src/lib/libssl/src/doc/crypto/BIO_f_buffer.pod
@@ -31,7 +31,7 @@ BIO_get_buffer_num_lines() returns the number of lines currently buffered.
31 31
32BIO_set_read_buffer_size(), BIO_set_write_buffer_size() and BIO_set_buffer_size() 32BIO_set_read_buffer_size(), BIO_set_write_buffer_size() and BIO_set_buffer_size()
33set the read, write or both read and write buffer sizes to B<size>. The initial 33set the read, write or both read and write buffer sizes to B<size>. The initial
34buffer size is DEFAULT_BUFFER_SIZE, currently 1024. Any attempt to reduce the 34buffer size is DEFAULT_BUFFER_SIZE, currently 4096. Any attempt to reduce the
35buffer size below DEFAULT_BUFFER_SIZE is ignored. Any buffered data is cleared 35buffer size below DEFAULT_BUFFER_SIZE is ignored. Any buffered data is cleared
36when the buffer is resized. 36when the buffer is resized.
37 37
@@ -66,4 +66,9 @@ there was an error.
66 66
67=head1 SEE ALSO 67=head1 SEE ALSO
68 68
69TBA 69L<BIO(3)|BIO(3)>,
70L<BIO_reset(3)|BIO_reset(3)>,
71L<BIO_flush(3)|BIO_flush(3)>,
72L<BIO_pop(3)|BIO_pop(3)>,
73L<BIO_ctrl(3)|BIO_ctrl(3)>,
74L<BIO_int_ctrl(3)|BIO_ctrl(3)>
diff --git a/src/lib/libssl/src/doc/crypto/BIO_f_md.pod b/src/lib/libssl/src/doc/crypto/BIO_f_md.pod
index 0d24083e6d..2cc41f89d2 100644
--- a/src/lib/libssl/src/doc/crypto/BIO_f_md.pod
+++ b/src/lib/libssl/src/doc/crypto/BIO_f_md.pod
@@ -58,6 +58,12 @@ If an application needs to call BIO_gets() or BIO_puts() through
58a chain containing digest BIOs then this can be done by prepending 58a chain containing digest BIOs then this can be done by prepending
59a buffering BIO. 59a buffering BIO.
60 60
61Before OpenSSL 1.0.0 the call to BIO_get_md_ctx() would only work if the BIO
62had been initialized for example by calling BIO_set_md() ). In OpenSSL
631.0.0 and later the context is always returned and the BIO is state is set
64to initialized. This allows applications to initialize the context externally
65if the standard calls such as BIO_set_md() are not sufficiently flexible.
66
61=head1 RETURN VALUES 67=head1 RETURN VALUES
62 68
63BIO_f_md() returns the digest BIO method. 69BIO_f_md() returns the digest BIO method.
diff --git a/src/lib/libssl/src/doc/crypto/BIO_f_ssl.pod b/src/lib/libssl/src/doc/crypto/BIO_f_ssl.pod
index f0b731731f..bc5861ab34 100644
--- a/src/lib/libssl/src/doc/crypto/BIO_f_ssl.pod
+++ b/src/lib/libssl/src/doc/crypto/BIO_f_ssl.pod
@@ -308,6 +308,15 @@ a client and also echoes the request to standard output.
308 308
309 BIO_free_all(sbio); 309 BIO_free_all(sbio);
310 310
311=head1 BUGS
312
313In OpenSSL versions before 1.0.0 the BIO_pop() call was handled incorrectly,
314the I/O BIO reference count was incorrectly incremented (instead of
315decremented) and dissociated with the SSL BIO even if the SSL BIO was not
316explicitly being popped (e.g. a pop higher up the chain). Applications which
317included workarounds for this bug (e.g. freeing BIOs more than once) should
318be modified to handle this fix or they may free up an already freed BIO.
319
311=head1 SEE ALSO 320=head1 SEE ALSO
312 321
313TBA 322TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_s_file.pod b/src/lib/libssl/src/doc/crypto/BIO_s_file.pod
index b2a29263f4..188aea347d 100644
--- a/src/lib/libssl/src/doc/crypto/BIO_s_file.pod
+++ b/src/lib/libssl/src/doc/crypto/BIO_s_file.pod
@@ -76,6 +76,10 @@ normally be closed so the BIO_NOCLOSE flag should be set.
76Because the file BIO calls the underlying stdio functions any quirks 76Because the file BIO calls the underlying stdio functions any quirks
77in stdio behaviour will be mirrored by the corresponding BIO. 77in stdio behaviour will be mirrored by the corresponding BIO.
78 78
79On Windows BIO_new_files reserves for the filename argument to be
80UTF-8 encoded. In other words if you have to make it work in multi-
81lingual environment, encode file names in UTF-8.
82
79=head1 EXAMPLES 83=head1 EXAMPLES
80 84
81File BIO "hello world": 85File BIO "hello world":
diff --git a/src/lib/libssl/src/doc/crypto/BIO_s_mem.pod b/src/lib/libssl/src/doc/crypto/BIO_s_mem.pod
index 19648acfae..8f85e0dcee 100644
--- a/src/lib/libssl/src/doc/crypto/BIO_s_mem.pod
+++ b/src/lib/libssl/src/doc/crypto/BIO_s_mem.pod
@@ -74,7 +74,7 @@ Writes to memory BIOs will always succeed if memory is available: that is
74their size can grow indefinitely. 74their size can grow indefinitely.
75 75
76Every read from a read write memory BIO will remove the data just read with 76Every read from a read write memory BIO will remove the data just read with
77an internal copy operation, if a BIO contains a lots of data and it is 77an internal copy operation, if a BIO contains a lot of data and it is
78read in small chunks the operation can be very slow. The use of a read only 78read in small chunks the operation can be very slow. The use of a read only
79memory BIO avoids this problem. If the BIO must be read write then adding 79memory BIO avoids this problem. If the BIO must be read write then adding
80a buffering BIO to the chain will speed up the process. 80a buffering BIO to the chain will speed up the process.
diff --git a/src/lib/libssl/src/doc/crypto/BIO_should_retry.pod b/src/lib/libssl/src/doc/crypto/BIO_should_retry.pod
index 539c391272..b6d51f719d 100644
--- a/src/lib/libssl/src/doc/crypto/BIO_should_retry.pod
+++ b/src/lib/libssl/src/doc/crypto/BIO_should_retry.pod
@@ -45,7 +45,7 @@ needs to read data.
45BIO_should_io_special() is true if some "special" condition, that is a 45BIO_should_io_special() is true if some "special" condition, that is a
46reason other than reading or writing is the cause of the condition. 46reason other than reading or writing is the cause of the condition.
47 47
48BIO_get_retry_reason() returns a mask of the cause of a retry condition 48BIO_retry_type() returns a mask of the cause of a retry condition
49consisting of the values B<BIO_FLAGS_READ>, B<BIO_FLAGS_WRITE>, 49consisting of the values B<BIO_FLAGS_READ>, B<BIO_FLAGS_WRITE>,
50B<BIO_FLAGS_IO_SPECIAL> though current BIO types will only set one of 50B<BIO_FLAGS_IO_SPECIAL> though current BIO types will only set one of
51these. 51these.
diff --git a/src/lib/libssl/src/doc/crypto/CRYPTO_set_ex_data.pod b/src/lib/libssl/src/doc/crypto/CRYPTO_set_ex_data.pod
index 1bd5bed67d..7409c02aac 100644
--- a/src/lib/libssl/src/doc/crypto/CRYPTO_set_ex_data.pod
+++ b/src/lib/libssl/src/doc/crypto/CRYPTO_set_ex_data.pod
@@ -6,6 +6,8 @@ CRYPTO_set_ex_data, CRYPTO_get_ex_data - internal application specific data func
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/crypto.h>
10
9 int CRYPTO_set_ex_data(CRYPTO_EX_DATA *r, int idx, void *arg); 11 int CRYPTO_set_ex_data(CRYPTO_EX_DATA *r, int idx, void *arg);
10 12
11 void *CRYPTO_get_ex_data(CRYPTO_EX_DATA *r, int idx); 13 void *CRYPTO_get_ex_data(CRYPTO_EX_DATA *r, int idx);
diff --git a/src/lib/libssl/src/doc/crypto/DSA_get_ex_new_index.pod b/src/lib/libssl/src/doc/crypto/DSA_get_ex_new_index.pod
index 4612e708ec..fb6efc1182 100644
--- a/src/lib/libssl/src/doc/crypto/DSA_get_ex_new_index.pod
+++ b/src/lib/libssl/src/doc/crypto/DSA_get_ex_new_index.pod
@@ -6,7 +6,7 @@ DSA_get_ex_new_index, DSA_set_ex_data, DSA_get_ex_data - add application specifi
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/DSA.h> 9 #include <openssl/dsa.h>
10 10
11 int DSA_get_ex_new_index(long argl, void *argp, 11 int DSA_get_ex_new_index(long argl, void *argp,
12 CRYPTO_EX_new *new_func, 12 CRYPTO_EX_new *new_func,
diff --git a/src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod b/src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod
index 130cd7f60a..5b477ac6ec 100644
--- a/src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod
+++ b/src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod
@@ -64,9 +64,9 @@ EVP digest routines
64 64
65The EVP digest routines are a high level interface to message digests. 65The EVP digest routines are a high level interface to message digests.
66 66
67EVP_MD_CTX_init() initializes digest contet B<ctx>. 67EVP_MD_CTX_init() initializes digest context B<ctx>.
68 68
69EVP_MD_CTX_create() allocates, initializes and returns a digest contet. 69EVP_MD_CTX_create() allocates, initializes and returns a digest context.
70 70
71EVP_DigestInit_ex() sets up digest context B<ctx> to use a digest 71EVP_DigestInit_ex() sets up digest context B<ctx> to use a digest
72B<type> from ENGINE B<impl>. B<ctx> must be initialized before calling this 72B<type> from ENGINE B<impl>. B<ctx> must be initialized before calling this
@@ -102,7 +102,7 @@ the passed context B<ctx> does not have to be initialized, and it always
102uses the default digest implementation. 102uses the default digest implementation.
103 103
104EVP_DigestFinal() is similar to EVP_DigestFinal_ex() except the digest 104EVP_DigestFinal() is similar to EVP_DigestFinal_ex() except the digest
105contet B<ctx> is automatically cleaned up. 105context B<ctx> is automatically cleaned up.
106 106
107EVP_MD_CTX_copy() is similar to EVP_MD_CTX_copy_ex() except the destination 107EVP_MD_CTX_copy() is similar to EVP_MD_CTX_copy_ex() except the destination
108B<out> does not have to be initialized. 108B<out> does not have to be initialized.
@@ -132,7 +132,9 @@ return B<EVP_MD> structures for the MD2, MD5, SHA, SHA1, MDC2 and RIPEMD160 dige
132algorithms respectively. The associated signature algorithm is RSA in each case. 132algorithms respectively. The associated signature algorithm is RSA in each case.
133 133
134EVP_dss() and EVP_dss1() return B<EVP_MD> structures for SHA and SHA1 digest 134EVP_dss() and EVP_dss1() return B<EVP_MD> structures for SHA and SHA1 digest
135algorithms but using DSS (DSA) for the signature algorithm. 135algorithms but using DSS (DSA) for the signature algorithm. Note: there is
136no need to use these pseudo-digests in OpenSSL 1.0.0 and later, they are
137however retained for compatibility.
136 138
137EVP_md_null() is a "null" message digest that does nothing: i.e. the hash it 139EVP_md_null() is a "null" message digest that does nothing: i.e. the hash it
138returns is of zero length. 140returns is of zero length.
@@ -228,12 +230,6 @@ digest name passed on the command line.
228 printf("\n"); 230 printf("\n");
229 } 231 }
230 232
231=head1 BUGS
232
233The link between digests and signing algorithms results in a situation where
234EVP_sha1() must be used with RSA and EVP_dss1() must be used with DSS
235even though they are identical digests.
236
237=head1 SEE ALSO 233=head1 SEE ALSO
238 234
239L<evp(3)|evp(3)>, L<hmac(3)|hmac(3)>, L<md2(3)|md2(3)>, 235L<evp(3)|evp(3)>, L<hmac(3)|hmac(3)>, L<md2(3)|md2(3)>,
@@ -253,4 +249,11 @@ EVP_md_null(), EVP_md2(), EVP_md5(), EVP_sha(), EVP_sha1(),
253EVP_dss(), EVP_dss1(), EVP_mdc2() and EVP_ripemd160() were 249EVP_dss(), EVP_dss1(), EVP_mdc2() and EVP_ripemd160() were
254changed to return truely const EVP_MD * in OpenSSL 0.9.7. 250changed to return truely const EVP_MD * in OpenSSL 0.9.7.
255 251
252The link between digests and signing algorithms was fixed in OpenSSL 1.0 and
253later, so now EVP_sha1() can be used with RSA and DSA, there is no need to
254use EVP_dss1() any more.
255
256OpenSSL 1.0 and later does not include the MD2 digest algorithm in the
257default configuration due to its security weaknesses.
258
256=cut 259=cut
diff --git a/src/lib/libssl/src/doc/crypto/EVP_PKEY_verifyrecover.pod b/src/lib/libssl/src/doc/crypto/EVP_PKEY_verifyrecover.pod
new file mode 100644
index 0000000000..e2a2a8c6f8
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/EVP_PKEY_verifyrecover.pod
@@ -0,0 +1,103 @@
1=pod
2
3=head1 NAME
4
5EVP_PKEY_verifyrecover_init, EVP_PKEY_verifyrecover - recover signature using a public key algorithm
6
7=head1 SYNOPSIS
8
9 #include <openssl/evp.h>
10
11 int EVP_PKEY_verifyrecover_init(EVP_PKEY_CTX *ctx);
12 int EVP_PKEY_verifyrecover(EVP_PKEY_CTX *ctx,
13 unsigned char *rout, size_t *routlen,
14 const unsigned char *sig, size_t siglen);
15
16=head1 DESCRIPTION
17
18The EVP_PKEY_verifyrecover_init() function initializes a public key algorithm
19context using key B<pkey> for a verify recover operation.
20
21The EVP_PKEY_verifyrecover() function recovers signed data
22using B<ctx>. The signature is specified using the B<sig> and
23B<siglen> parameters. If B<rout> is B<NULL> then the maximum size of the output
24buffer is written to the B<routlen> parameter. If B<rout> is not B<NULL> then
25before the call the B<routlen> parameter should contain the length of the
26B<rout> buffer, if the call is successful recovered data is written to
27B<rout> and the amount of data written to B<routlen>.
28
29=head1 NOTES
30
31Normally an application is only interested in whether a signature verification
32operation is successful in those cases the EVP_verify() function should be
33used.
34
35Sometimes however it is useful to obtain the data originally signed using a
36signing operation. Only certain public key algorithms can recover a signature
37in this way (for example RSA in PKCS padding mode).
38
39After the call to EVP_PKEY_verifyrecover_init() algorithm specific control
40operations can be performed to set any appropriate parameters for the
41operation.
42
43The function EVP_PKEY_verifyrecover() can be called more than once on the same
44context if several operations are performed using the same parameters.
45
46=head1 RETURN VALUES
47
48EVP_PKEY_verifyrecover_init() and EVP_PKEY_verifyrecover() return 1 for success
49and 0 or a negative value for failure. In particular a return value of -2
50indicates the operation is not supported by the public key algorithm.
51
52=head1 EXAMPLE
53
54Recover digest originally signed using PKCS#1 and SHA256 digest:
55
56 #include <openssl/evp.h>
57 #include <openssl/rsa.h>
58
59 EVP_PKEY_CTX *ctx;
60 unsigned char *rout, *sig;
61 size_t routlen, siglen;
62 EVP_PKEY *verify_key;
63 /* NB: assumes verify_key, sig and siglen are already set up
64 * and that verify_key is an RSA public key
65 */
66 ctx = EVP_PKEY_CTX_new(verify_key);
67 if (!ctx)
68 /* Error occurred */
69 if (EVP_PKEY_verifyrecover_init(ctx) <= 0)
70 /* Error */
71 if (EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_PADDING) <= 0)
72 /* Error */
73 if (EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha256()) <= 0)
74 /* Error */
75
76 /* Determine buffer length */
77 if (EVP_PKEY_verifyrecover(ctx, rout, &routlen, sig, siglen) <= 0)
78 /* Error */
79
80 rout = OPENSSL_malloc(routlen);
81
82 if (!rout)
83 /* malloc failure */
84
85 if (EVP_PKEY_verifyrecover(ctx, rout, &routlen, sig, siglen) <= 0)
86 /* Error */
87
88 /* Recovered data is routlen bytes written to buffer rout */
89
90=head1 SEE ALSO
91
92L<EVP_PKEY_CTX_new(3)|EVP_PKEY_CTX_new(3)>,
93L<EVP_PKEY_encrypt(3)|EVP_PKEY_encrypt(3)>,
94L<EVP_PKEY_decrypt(3)|EVP_PKEY_decrypt(3)>,
95L<EVP_PKEY_sign(3)|EVP_PKEY_sign(3)>,
96L<EVP_PKEY_verify(3)|EVP_PKEY_verify(3)>,
97L<EVP_PKEY_derive(3)|EVP_PKEY_derive(3)>
98
99=head1 HISTORY
100
101These functions were first added to OpenSSL 1.0.0.
102
103=cut
diff --git a/src/lib/libssl/src/doc/crypto/EVP_SignInit.pod b/src/lib/libssl/src/doc/crypto/EVP_SignInit.pod
index b6e62ce7f6..620a623ab6 100644
--- a/src/lib/libssl/src/doc/crypto/EVP_SignInit.pod
+++ b/src/lib/libssl/src/doc/crypto/EVP_SignInit.pod
@@ -77,6 +77,15 @@ will occur.
77Older versions of this documentation wrongly stated that calls to 77Older versions of this documentation wrongly stated that calls to
78EVP_SignUpdate() could not be made after calling EVP_SignFinal(). 78EVP_SignUpdate() could not be made after calling EVP_SignFinal().
79 79
80Since the private key is passed in the call to EVP_SignFinal() any error
81relating to the private key (for example an unsuitable key and digest
82combination) will not be indicated until after potentially large amounts of
83data have been passed through EVP_SignUpdate().
84
85It is not possible to change the signing parameters using these function.
86
87The previous two bugs are fixed in the newer EVP_SignDigest*() function.
88
80=head1 SEE ALSO 89=head1 SEE ALSO
81 90
82L<EVP_VerifyInit(3)|EVP_VerifyInit(3)>, 91L<EVP_VerifyInit(3)|EVP_VerifyInit(3)>,
diff --git a/src/lib/libssl/src/doc/crypto/EVP_VerifyInit.pod b/src/lib/libssl/src/doc/crypto/EVP_VerifyInit.pod
index b6afaedee5..9097f09410 100644
--- a/src/lib/libssl/src/doc/crypto/EVP_VerifyInit.pod
+++ b/src/lib/libssl/src/doc/crypto/EVP_VerifyInit.pod
@@ -67,6 +67,15 @@ will occur.
67Older versions of this documentation wrongly stated that calls to 67Older versions of this documentation wrongly stated that calls to
68EVP_VerifyUpdate() could not be made after calling EVP_VerifyFinal(). 68EVP_VerifyUpdate() could not be made after calling EVP_VerifyFinal().
69 69
70Since the public key is passed in the call to EVP_SignFinal() any error
71relating to the private key (for example an unsuitable key and digest
72combination) will not be indicated until after potentially large amounts of
73data have been passed through EVP_SignUpdate().
74
75It is not possible to change the signing parameters using these function.
76
77The previous two bugs are fixed in the newer EVP_VerifyDigest*() function.
78
70=head1 SEE ALSO 79=head1 SEE ALSO
71 80
72L<evp(3)|evp(3)>, 81L<evp(3)|evp(3)>,
diff --git a/src/lib/libssl/src/doc/crypto/OBJ_nid2obj.pod b/src/lib/libssl/src/doc/crypto/OBJ_nid2obj.pod
index 7dcc07923f..1e45dd40f6 100644
--- a/src/lib/libssl/src/doc/crypto/OBJ_nid2obj.pod
+++ b/src/lib/libssl/src/doc/crypto/OBJ_nid2obj.pod
@@ -8,6 +8,8 @@ functions
8 8
9=head1 SYNOPSIS 9=head1 SYNOPSIS
10 10
11 #include <openssl/objects.h>
12
11 ASN1_OBJECT * OBJ_nid2obj(int n); 13 ASN1_OBJECT * OBJ_nid2obj(int n);
12 const char * OBJ_nid2ln(int n); 14 const char * OBJ_nid2ln(int n);
13 const char * OBJ_nid2sn(int n); 15 const char * OBJ_nid2sn(int n);
diff --git a/src/lib/libssl/src/doc/crypto/PKCS12_parse.pod b/src/lib/libssl/src/doc/crypto/PKCS12_parse.pod
index 51344f883a..c54cf2ad61 100644
--- a/src/lib/libssl/src/doc/crypto/PKCS12_parse.pod
+++ b/src/lib/libssl/src/doc/crypto/PKCS12_parse.pod
@@ -20,24 +20,31 @@ certificate to B<*cert> and any additional certificates to B<*ca>.
20 20
21=head1 NOTES 21=head1 NOTES
22 22
23The parameters B<pkey> and B<cert> cannot be B<NULL>. B<ca> can be <NULL> 23The parameters B<pkey> and B<cert> cannot be B<NULL>. B<ca> can be <NULL> in
24in which case additional certificates will be discarded. B<*ca> can also 24which case additional certificates will be discarded. B<*ca> can also be a
25be a valid STACK in which case additional certificates are appended to 25valid STACK in which case additional certificates are appended to B<*ca>. If
26B<*ca>. If B<*ca> is B<NULL> a new STACK will be allocated. 26B<*ca> is B<NULL> a new STACK will be allocated.
27 27
28The B<friendlyName> and B<localKeyID> attributes (if present) on each certificate 28The B<friendlyName> and B<localKeyID> attributes (if present) on each
29will be stored in the B<alias> and B<keyid> attributes of the B<X509> structure. 29certificate will be stored in the B<alias> and B<keyid> attributes of the
30B<X509> structure.
31
32=head1 RETURN VALUES
33
34PKCS12_parse() returns 1 for success and zero if an error occurred.
35
36The error can be obtained from L<ERR_get_error(3)|ERR_get_error(3)>
30 37
31=head1 BUGS 38=head1 BUGS
32 39
33Only a single private key and corresponding certificate is returned by this function. 40Only a single private key and corresponding certificate is returned by this
34More complex PKCS#12 files with multiple private keys will only return the first 41function. More complex PKCS#12 files with multiple private keys will only
35match. 42return the first match.
36 43
37Only B<friendlyName> and B<localKeyID> attributes are currently stored in certificates. 44Only B<friendlyName> and B<localKeyID> attributes are currently stored in
38Other attributes are discarded. 45certificates. Other attributes are discarded.
39 46
40Attributes currently cannot be store in the private key B<EVP_PKEY> structure. 47Attributes currently cannot be stored in the private key B<EVP_PKEY> structure.
41 48
42=head1 SEE ALSO 49=head1 SEE ALSO
43 50
diff --git a/src/lib/libssl/src/doc/crypto/PKCS7_decrypt.pod b/src/lib/libssl/src/doc/crypto/PKCS7_decrypt.pod
index b0ca067b89..325699d0b6 100644
--- a/src/lib/libssl/src/doc/crypto/PKCS7_decrypt.pod
+++ b/src/lib/libssl/src/doc/crypto/PKCS7_decrypt.pod
@@ -6,7 +6,9 @@ PKCS7_decrypt - decrypt content from a PKCS#7 envelopedData structure
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); 9 #include <openssl/pkcs7.h>
10
11 int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags);
10 12
11=head1 DESCRIPTION 13=head1 DESCRIPTION
12 14
diff --git a/src/lib/libssl/src/doc/crypto/PKCS7_encrypt.pod b/src/lib/libssl/src/doc/crypto/PKCS7_encrypt.pod
index 1a507b22a2..2cd925a7e0 100644
--- a/src/lib/libssl/src/doc/crypto/PKCS7_encrypt.pod
+++ b/src/lib/libssl/src/doc/crypto/PKCS7_encrypt.pod
@@ -6,7 +6,9 @@ PKCS7_encrypt - create a PKCS#7 envelopedData structure
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, int flags); 9 #include <openssl/pkcs7.h>
10
11 PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, int flags);
10 12
11=head1 DESCRIPTION 13=head1 DESCRIPTION
12 14
@@ -16,43 +18,55 @@ B<cipher> is the symmetric cipher to use. B<flags> is an optional set of flags.
16 18
17=head1 NOTES 19=head1 NOTES
18 20
19Only RSA keys are supported in PKCS#7 and envelopedData so the recipient certificates 21Only RSA keys are supported in PKCS#7 and envelopedData so the recipient
20supplied to this function must all contain RSA public keys, though they do not have to 22certificates supplied to this function must all contain RSA public keys, though
21be signed using the RSA algorithm. 23they do not have to be signed using the RSA algorithm.
22 24
23EVP_des_ede3_cbc() (triple DES) is the algorithm of choice for S/MIME use because 25EVP_des_ede3_cbc() (triple DES) is the algorithm of choice for S/MIME use
24most clients will support it. 26because most clients will support it.
25 27
26Some old "export grade" clients may only support weak encryption using 40 or 64 bit 28Some old "export grade" clients may only support weak encryption using 40 or 64
27RC2. These can be used by passing EVP_rc2_40_cbc() and EVP_rc2_64_cbc() respectively. 29bit RC2. These can be used by passing EVP_rc2_40_cbc() and EVP_rc2_64_cbc()
30respectively.
28 31
29The algorithm passed in the B<cipher> parameter must support ASN1 encoding of its 32The algorithm passed in the B<cipher> parameter must support ASN1 encoding of
30parameters. 33its parameters.
31 34
32Many browsers implement a "sign and encrypt" option which is simply an S/MIME 35Many browsers implement a "sign and encrypt" option which is simply an S/MIME
33envelopedData containing an S/MIME signed message. This can be readily produced 36envelopedData containing an S/MIME signed message. This can be readily produced
34by storing the S/MIME signed message in a memory BIO and passing it to 37by storing the S/MIME signed message in a memory BIO and passing it to
35PKCS7_encrypt(). 38PKCS7_encrypt().
36 39
37The following flags can be passed in the B<flags> parameter. 40The following flags can be passed in the B<flags> parameter.
38 41
39If the B<PKCS7_TEXT> flag is set MIME headers for type B<text/plain> are prepended 42If the B<PKCS7_TEXT> flag is set MIME headers for type B<text/plain> are
40to the data. 43prepended to the data.
41 44
42Normally the supplied content is translated into MIME canonical format (as required 45Normally the supplied content is translated into MIME canonical format (as
43by the S/MIME specifications) if B<PKCS7_BINARY> is set no translation occurs. This 46required by the S/MIME specifications) if B<PKCS7_BINARY> is set no translation
44option should be used if the supplied data is in binary format otherwise the translation 47occurs. This option should be used if the supplied data is in binary format
45will corrupt it. If B<PKCS7_BINARY> is set then B<PKCS7_TEXT> is ignored. 48otherwise the translation will corrupt it. If B<PKCS7_BINARY> is set then
49B<PKCS7_TEXT> is ignored.
46 50
47=head1 RETURN VALUES 51If the B<PKCS7_STREAM> flag is set a partial B<PKCS7> structure is output
52suitable for streaming I/O: no data is read from the BIO B<in>.
48 53
49PKCS7_encrypt() returns either a valid PKCS7 structure or NULL if an error occurred. 54=head1 NOTES
50The error can be obtained from ERR_get_error(3).
51 55
52=head1 BUGS 56If the flag B<PKCS7_STREAM> is set the returned B<PKCS7> structure is B<not>
57complete and outputting its contents via a function that does not
58properly finalize the B<PKCS7> structure will give unpredictable
59results.
53 60
54The lack of single pass processing and need to hold all data in memory as 61Several functions including SMIME_write_PKCS7(), i2d_PKCS7_bio_stream(),
55mentioned in PKCS7_sign() also applies to PKCS7_verify(). 62PEM_write_bio_PKCS7_stream() finalize the structure. Alternatively finalization
63can be performed by obtaining the streaming ASN1 B<BIO> directly using
64BIO_new_PKCS7().
65
66=head1 RETURN VALUES
67
68PKCS7_encrypt() returns either a PKCS7 structure or NULL if an error occurred.
69The error can be obtained from ERR_get_error(3).
56 70
57=head1 SEE ALSO 71=head1 SEE ALSO
58 72
@@ -61,5 +75,6 @@ L<ERR_get_error(3)|ERR_get_error(3)>, L<PKCS7_decrypt(3)|PKCS7_decrypt(3)>
61=head1 HISTORY 75=head1 HISTORY
62 76
63PKCS7_decrypt() was added to OpenSSL 0.9.5 77PKCS7_decrypt() was added to OpenSSL 0.9.5
78The B<PKCS7_STREAM> flag was first supported in OpenSSL 1.0.0.
64 79
65=cut 80=cut
diff --git a/src/lib/libssl/src/doc/crypto/PKCS7_sign.pod b/src/lib/libssl/src/doc/crypto/PKCS7_sign.pod
index ffd0c734b0..64a35144f8 100644
--- a/src/lib/libssl/src/doc/crypto/PKCS7_sign.pod
+++ b/src/lib/libssl/src/doc/crypto/PKCS7_sign.pod
@@ -6,14 +6,16 @@ PKCS7_sign - create a PKCS#7 signedData structure
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, BIO *data, int flags); 9 #include <openssl/pkcs7.h>
10
11 PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, BIO *data, int flags);
10 12
11=head1 DESCRIPTION 13=head1 DESCRIPTION
12 14
13PKCS7_sign() creates and returns a PKCS#7 signedData structure. B<signcert> 15PKCS7_sign() creates and returns a PKCS#7 signedData structure. B<signcert> is
14is the certificate to sign with, B<pkey> is the corresponsding private key. 16the certificate to sign with, B<pkey> is the corresponsding private key.
15B<certs> is an optional additional set of certificates to include in the 17B<certs> is an optional additional set of certificates to include in the PKCS#7
16PKCS#7 structure (for example any intermediate CAs in the chain). 18structure (for example any intermediate CAs in the chain).
17 19
18The data to be signed is read from BIO B<data>. 20The data to be signed is read from BIO B<data>.
19 21
@@ -21,72 +23,83 @@ B<flags> is an optional set of flags.
21 23
22=head1 NOTES 24=head1 NOTES
23 25
24Any of the following flags (ored together) can be passed in the B<flags> parameter. 26Any of the following flags (ored together) can be passed in the B<flags>
27parameter.
25 28
26Many S/MIME clients expect the signed content to include valid MIME headers. If 29Many S/MIME clients expect the signed content to include valid MIME headers. If
27the B<PKCS7_TEXT> flag is set MIME headers for type B<text/plain> are prepended 30the B<PKCS7_TEXT> flag is set MIME headers for type B<text/plain> are prepended
28to the data. 31to the data.
29 32
30If B<PKCS7_NOCERTS> is set the signer's certificate will not be included in the 33If B<PKCS7_NOCERTS> is set the signer's certificate will not be included in the
31PKCS7 structure, the signer's certificate must still be supplied in the B<signcert> 34PKCS7 structure, the signer's certificate must still be supplied in the
32parameter though. This can reduce the size of the signature if the signers certificate 35B<signcert> parameter though. This can reduce the size of the signature if the
33can be obtained by other means: for example a previously signed message. 36signers certificate can be obtained by other means: for example a previously
34 37signed message.
35The data being signed is included in the PKCS7 structure, unless B<PKCS7_DETACHED> 38
36is set in which case it is omitted. This is used for PKCS7 detached signatures 39The data being signed is included in the PKCS7 structure, unless
37which are used in S/MIME plaintext signed messages for example. 40B<PKCS7_DETACHED> is set in which case it is omitted. This is used for PKCS7
41detached signatures which are used in S/MIME plaintext signed messages for
42example.
43
44Normally the supplied content is translated into MIME canonical format (as
45required by the S/MIME specifications) if B<PKCS7_BINARY> is set no translation
46occurs. This option should be used if the supplied data is in binary format
47otherwise the translation will corrupt it.
48
49The signedData structure includes several PKCS#7 autenticatedAttributes
50including the signing time, the PKCS#7 content type and the supported list of
51ciphers in an SMIMECapabilities attribute. If B<PKCS7_NOATTR> is set then no
52authenticatedAttributes will be used. If B<PKCS7_NOSMIMECAP> is set then just
53the SMIMECapabilities are omitted.
38 54
39Normally the supplied content is translated into MIME canonical format (as required 55If present the SMIMECapabilities attribute indicates support for the following
40by the S/MIME specifications) if B<PKCS7_BINARY> is set no translation occurs. This 56algorithms: triple DES, 128 bit RC2, 64 bit RC2, DES and 40 bit RC2. If any of
41option should be used if the supplied data is in binary format otherwise the translation 57these algorithms is disabled then it will not be included.
42will corrupt it.
43 58
44The signedData structure includes several PKCS#7 autenticatedAttributes including 59If the flags B<PKCS7_STREAM> is set then the returned B<PKCS7> structure is
45the signing time, the PKCS#7 content type and the supported list of ciphers in 60just initialized ready to perform the signing operation. The signing is however
46an SMIMECapabilities attribute. If B<PKCS7_NOATTR> is set then no authenticatedAttributes 61B<not> performed and the data to be signed is not read from the B<data>
47will be used. If B<PKCS7_NOSMIMECAP> is set then just the SMIMECapabilities are 62parameter. Signing is deferred until after the data has been written. In this
48omitted. 63way data can be signed in a single pass.
49 64
50If present the SMIMECapabilities attribute indicates support for the following 65If the B<PKCS7_PARTIAL> flag is set a partial B<PKCS7> structure is output to
51algorithms: triple DES, 128 bit RC2, 64 bit RC2, DES and 40 bit RC2. If any 66which additional signers and capabilities can be added before finalization.
52of these algorithms is disabled then it will not be included.
53 67
54If the flags B<PKCS7_PARTSIGN> is set then the returned B<PKCS7> structure
55is just initialized ready to perform the signing operation. The signing
56is however B<not> performed and the data to be signed is not read from
57the B<data> parameter. Signing is deferred until after the data has been
58written. In this way data can be signed in a single pass. Currently the
59flag B<PKCS7_DETACHED> B<must> also be set.
60 68
61=head1 NOTES 69=head1 NOTES
62 70
63Currently the flag B<PKCS7_PARTSIGN> is only supported for detached 71If the flag B<PKCS7_STREAM> is set the returned B<PKCS7> structure is B<not>
64data. If this flag is set the returned B<PKCS7> structure is B<not> 72complete and outputting its contents via a function that does not properly
65complete and outputting its contents via a function that does not 73finalize the B<PKCS7> structure will give unpredictable results.
66properly finalize the B<PKCS7> structure will give unpredictable
67results.
68 74
69At present only the SMIME_write_PKCS7() function properly finalizes the 75Several functions including SMIME_write_PKCS7(), i2d_PKCS7_bio_stream(),
70structure. 76PEM_write_bio_PKCS7_stream() finalize the structure. Alternatively finalization
77can be performed by obtaining the streaming ASN1 B<BIO> directly using
78BIO_new_PKCS7().
71 79
72=head1 BUGS 80If a signer is specified it will use the default digest for the signing
81algorithm. This is B<SHA1> for both RSA and DSA keys.
82
83In OpenSSL 1.0.0 the B<certs>, B<signcert> and B<pkey> parameters can all be
84B<NULL> if the B<PKCS7_PARTIAL> flag is set. One or more signers can be added
85using the function B<PKCS7_sign_add_signer()>. B<PKCS7_final()> must also be
86called to finalize the structure if streaming is not enabled. Alternative
87signing digests can also be specified using this method.
73 88
74PKCS7_sign() is somewhat limited. It does not support multiple signers, some 89In OpenSSL 1.0.0 if B<signcert> and B<pkey> are NULL then a certificates only
75advanced attributes such as counter signatures are not supported. 90PKCS#7 structure is output.
76 91
77The SHA1 digest algorithm is currently always used. 92In versions of OpenSSL before 1.0.0 the B<signcert> and B<pkey> parameters must
93B<NOT> be NULL.
78 94
79When the signed data is not detached it will be stored in memory within the 95=head1 BUGS
80B<PKCS7> structure. This effectively limits the size of messages which can be
81signed due to memory restraints. There should be a way to sign data without
82having to hold it all in memory, this would however require fairly major
83revisions of the OpenSSL ASN1 code.
84 96
97Some advanced attributes such as counter signatures are not supported.
85 98
86=head1 RETURN VALUES 99=head1 RETURN VALUES
87 100
88PKCS7_sign() returns either a valid PKCS7 structure or NULL if an error occurred. 101PKCS7_sign() returns either a valid PKCS7 structure or NULL if an error
89The error can be obtained from ERR_get_error(3). 102occurred. The error can be obtained from ERR_get_error(3).
90 103
91=head1 SEE ALSO 104=head1 SEE ALSO
92 105
@@ -96,6 +109,8 @@ L<ERR_get_error(3)|ERR_get_error(3)>, L<PKCS7_verify(3)|PKCS7_verify(3)>
96 109
97PKCS7_sign() was added to OpenSSL 0.9.5 110PKCS7_sign() was added to OpenSSL 0.9.5
98 111
99The B<PKCS7_PARTSIGN> flag was added in OpenSSL 0.9.8 112The B<PKCS7_PARTIAL> flag was added in OpenSSL 1.0.0
113
114The B<PKCS7_STREAM> flag was added in OpenSSL 1.0.0
100 115
101=cut 116=cut
diff --git a/src/lib/libssl/src/doc/crypto/PKCS7_verify.pod b/src/lib/libssl/src/doc/crypto/PKCS7_verify.pod
index 3490b5dc82..7c10a4cc3c 100644
--- a/src/lib/libssl/src/doc/crypto/PKCS7_verify.pod
+++ b/src/lib/libssl/src/doc/crypto/PKCS7_verify.pod
@@ -6,9 +6,11 @@ PKCS7_verify - verify a PKCS#7 signedData structure
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, BIO *indata, BIO *out, int flags); 9 #include <openssl/pkcs7.h>
10 10
11STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags); 11 int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, BIO *indata, BIO *out, int flags);
12
13 STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags);
12 14
13=head1 DESCRIPTION 15=head1 DESCRIPTION
14 16
diff --git a/src/lib/libssl/src/doc/crypto/SMIME_read_PKCS7.pod b/src/lib/libssl/src/doc/crypto/SMIME_read_PKCS7.pod
index ffafa37887..9d46715941 100644
--- a/src/lib/libssl/src/doc/crypto/SMIME_read_PKCS7.pod
+++ b/src/lib/libssl/src/doc/crypto/SMIME_read_PKCS7.pod
@@ -6,7 +6,9 @@ SMIME_read_PKCS7 - parse S/MIME message.
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9PKCS7 *SMIME_read_PKCS7(BIO *in, BIO **bcont); 9 #include <openssl/pkcs7.h>
10
11 PKCS7 *SMIME_read_PKCS7(BIO *in, BIO **bcont);
10 12
11=head1 DESCRIPTION 13=head1 DESCRIPTION
12 14
diff --git a/src/lib/libssl/src/doc/crypto/SMIME_write_PKCS7.pod b/src/lib/libssl/src/doc/crypto/SMIME_write_PKCS7.pod
index 61945b3887..ca6bd02763 100644
--- a/src/lib/libssl/src/doc/crypto/SMIME_write_PKCS7.pod
+++ b/src/lib/libssl/src/doc/crypto/SMIME_write_PKCS7.pod
@@ -6,17 +6,18 @@ SMIME_write_PKCS7 - convert PKCS#7 structure to S/MIME format.
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9int SMIME_write_PKCS7(BIO *out, PKCS7 *p7, BIO *data, int flags); 9 #include <openssl/pkcs7.h>
10
11 int SMIME_write_PKCS7(BIO *out, PKCS7 *p7, BIO *data, int flags);
10 12
11=head1 DESCRIPTION 13=head1 DESCRIPTION
12 14
13SMIME_write_PKCS7() adds the appropriate MIME headers to a PKCS#7 15SMIME_write_PKCS7() adds the appropriate MIME headers to a PKCS#7
14structure to produce an S/MIME message. 16structure to produce an S/MIME message.
15 17
16B<out> is the BIO to write the data to. B<p7> is the appropriate 18B<out> is the BIO to write the data to. B<p7> is the appropriate B<PKCS7>
17B<PKCS7> structure. If cleartext signing (B<multipart/signed>) is 19structure. If streaming is enabled then the content must be supplied in the
18being used then the signed data must be supplied in the B<data> 20B<data> argument. B<flags> is an optional set of flags.
19argument. B<flags> is an optional set of flags.
20 21
21=head1 NOTES 22=head1 NOTES
22 23
@@ -30,15 +31,18 @@ If the B<PKCS7_TEXT> flag is set MIME headers for type B<text/plain>
30are added to the content, this only makes sense if B<PKCS7_DETACHED> 31are added to the content, this only makes sense if B<PKCS7_DETACHED>
31is also set. 32is also set.
32 33
33If the B<PKCS7_PARTSIGN> flag is set the signed data is finalized 34If the B<PKCS7_STREAM> flag is set streaming is performed. This flag should
34and output along with the content. This flag should only be set 35only be set if B<PKCS7_STREAM> was also set in the previous call to
35if B<PKCS7_DETACHED> is also set and the previous call to PKCS7_sign() 36PKCS7_sign() or B<PKCS7_encrypt()>.
36also set these flags.
37 37
38If cleartext signing is being used and B<PKCS7_PARTSIGN> not set then 38If cleartext signing is being used and B<PKCS7_STREAM> not set then
39the data must be read twice: once to compute the signature in PKCS7_sign() 39the data must be read twice: once to compute the signature in PKCS7_sign()
40and once to output the S/MIME message. 40and once to output the S/MIME message.
41 41
42If streaming is performed the content is output in BER format using indefinite
43length constructuted encoding except in the case of signed data with detached
44content where the content is absent and DER format is used.
45
42=head1 BUGS 46=head1 BUGS
43 47
44SMIME_write_PKCS7() always base64 encodes PKCS#7 structures, there 48SMIME_write_PKCS7() always base64 encodes PKCS#7 structures, there
diff --git a/src/lib/libssl/src/doc/crypto/X509_NAME_ENTRY_get_object.pod b/src/lib/libssl/src/doc/crypto/X509_NAME_ENTRY_get_object.pod
index 11b35f6fd3..41902c0d45 100644
--- a/src/lib/libssl/src/doc/crypto/X509_NAME_ENTRY_get_object.pod
+++ b/src/lib/libssl/src/doc/crypto/X509_NAME_ENTRY_get_object.pod
@@ -9,15 +9,17 @@ X509_NAME_ENTRY_create_by_OBJ - X509_NAME_ENTRY utility functions
9 9
10=head1 SYNOPSIS 10=head1 SYNOPSIS
11 11
12ASN1_OBJECT * X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne); 12 #include <openssl/x509.h>
13ASN1_STRING * X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne);
14 13
15int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, ASN1_OBJECT *obj); 14 ASN1_OBJECT * X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne);
16int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, const unsigned char *bytes, int len); 15 ASN1_STRING * X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne);
17 16
18X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, const char *field, int type, const unsigned char *bytes, int len); 17 int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, ASN1_OBJECT *obj);
19X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, int type,unsigned char *bytes, int len); 18 int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, const unsigned char *bytes, int len);
20X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, ASN1_OBJECT *obj, 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);
21 23
22=head1 DESCRIPTION 24=head1 DESCRIPTION
23 25
diff --git a/src/lib/libssl/src/doc/crypto/X509_NAME_add_entry_by_txt.pod b/src/lib/libssl/src/doc/crypto/X509_NAME_add_entry_by_txt.pod
index e2ab4b0d2b..1afd008cb3 100644
--- a/src/lib/libssl/src/doc/crypto/X509_NAME_add_entry_by_txt.pod
+++ b/src/lib/libssl/src/doc/crypto/X509_NAME_add_entry_by_txt.pod
@@ -7,15 +7,17 @@ X509_NAME_add_entry, X509_NAME_delete_entry - X509_NAME modification functions
7 7
8=head1 SYNOPSIS 8=head1 SYNOPSIS
9 9
10int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, const unsigned char *bytes, int len, int loc, int set); 10 #include <openssl/x509.h>
11 11
12int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, unsigned char *bytes, int len, int loc, int set); 12 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);
13 13
14int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, unsigned char *bytes, int len, int loc, int set); 14 int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, unsigned char *bytes, int len, int loc, int set);
15 15
16int X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne, int loc, int set); 16 int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, unsigned char *bytes, int len, int loc, int set);
17 17
18X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); 18 int X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne, int loc, int set);
19
20 X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc);
19 21
20=head1 DESCRIPTION 22=head1 DESCRIPTION
21 23
diff --git a/src/lib/libssl/src/doc/crypto/X509_NAME_get_index_by_NID.pod b/src/lib/libssl/src/doc/crypto/X509_NAME_get_index_by_NID.pod
index 333323d734..3b1f9ff43b 100644
--- a/src/lib/libssl/src/doc/crypto/X509_NAME_get_index_by_NID.pod
+++ b/src/lib/libssl/src/doc/crypto/X509_NAME_get_index_by_NID.pod
@@ -8,14 +8,16 @@ X509_NAME lookup and enumeration functions
8 8
9=head1 SYNOPSIS 9=head1 SYNOPSIS
10 10
11int X509_NAME_get_index_by_NID(X509_NAME *name,int nid,int lastpos); 11 #include <openssl/x509.h>
12int X509_NAME_get_index_by_OBJ(X509_NAME *name,ASN1_OBJECT *obj, int lastpos);
13 12
14int X509_NAME_entry_count(X509_NAME *name); 13 int X509_NAME_get_index_by_NID(X509_NAME *name,int nid,int lastpos);
15X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc); 14 int X509_NAME_get_index_by_OBJ(X509_NAME *name,ASN1_OBJECT *obj, int lastpos);
16 15
17int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf,int len); 16 int X509_NAME_entry_count(X509_NAME *name);
18int X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, char *buf,int len); 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);
19 21
20=head1 DESCRIPTION 22=head1 DESCRIPTION
21 23
diff --git a/src/lib/libssl/src/doc/crypto/X509_new.pod b/src/lib/libssl/src/doc/crypto/X509_new.pod
index fd5fc65ce1..d38872335f 100644
--- a/src/lib/libssl/src/doc/crypto/X509_new.pod
+++ b/src/lib/libssl/src/doc/crypto/X509_new.pod
@@ -6,6 +6,8 @@ X509_new, X509_free - X509 certificate ASN1 allocation functions
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/x509.h>
10
9 X509 *X509_new(void); 11 X509 *X509_new(void);
10 void X509_free(X509 *a); 12 void X509_free(X509 *a);
11 13
diff --git a/src/lib/libssl/src/doc/crypto/bn_internal.pod b/src/lib/libssl/src/doc/crypto/bn_internal.pod
index 891914678c..91840b0f0d 100644
--- a/src/lib/libssl/src/doc/crypto/bn_internal.pod
+++ b/src/lib/libssl/src/doc/crypto/bn_internal.pod
@@ -13,6 +13,8 @@ library internal functions
13 13
14=head1 SYNOPSIS 14=head1 SYNOPSIS
15 15
16 #include <openssl/bn.h>
17
16 BN_ULONG bn_mul_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w); 18 BN_ULONG bn_mul_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w);
17 BN_ULONG bn_mul_add_words(BN_ULONG *rp, BN_ULONG *ap, int num, 19 BN_ULONG bn_mul_add_words(BN_ULONG *rp, BN_ULONG *ap, int num,
18 BN_ULONG w); 20 BN_ULONG w);
@@ -70,24 +72,34 @@ applications.
70 72
71=head2 The BIGNUM structure 73=head2 The BIGNUM structure
72 74
73 typedef struct bignum_st 75 typedef struct bignum_st BIGNUM;
76
77 struct bignum_st
74 { 78 {
75 int top; /* number of words used in d */ 79 BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */
76 BN_ULONG *d; /* pointer to an array containing the integer value */ 80 int top; /* Index of last used d +1. */
77 int max; /* size of the d array */ 81 /* The next are internal book keeping for bn_expand. */
78 int neg; /* sign */ 82 int dmax; /* Size of the d array. */
79 } BIGNUM; 83 int neg; /* one if the number is negative */
84 int flags;
85 };
86
80 87
81The integer value is stored in B<d>, a malloc()ed array of words (B<BN_ULONG>), 88The integer value is stored in B<d>, a malloc()ed array of words (B<BN_ULONG>),
82least significant word first. A B<BN_ULONG> can be either 16, 32 or 64 bits 89least significant word first. A B<BN_ULONG> can be either 16, 32 or 64 bits
83in size, depending on the 'number of bits' (B<BITS2>) specified in 90in size, depending on the 'number of bits' (B<BITS2>) specified in
84C<openssl/bn.h>. 91C<openssl/bn.h>.
85 92
86B<max> is the size of the B<d> array that has been allocated. B<top> 93B<dmax> is the size of the B<d> array that has been allocated. B<top>
87is the number of words being used, so for a value of 4, bn.d[0]=4 and 94is the number of words being used, so for a value of 4, bn.d[0]=4 and
88bn.top=1. B<neg> is 1 if the number is negative. When a B<BIGNUM> is 95bn.top=1. B<neg> is 1 if the number is negative. When a B<BIGNUM> is
89B<0>, the B<d> field can be B<NULL> and B<top> == B<0>. 96B<0>, the B<d> field can be B<NULL> and B<top> == B<0>.
90 97
98B<flags> is a bit field of flags which are defined in C<openssl/bn.h>. The
99flags begin with B<BN_FLG_>. The macros BN_set_flags(b,n) and
100BN_get_flags(b,n) exist to enable or fetch flag(s) B<n> from B<BIGNUM>
101structure B<b>.
102
91Various routines in this library require the use of temporary 103Various routines in this library require the use of temporary
92B<BIGNUM> variables during their execution. Since dynamic memory 104B<BIGNUM> variables during their execution. Since dynamic memory
93allocation to create B<BIGNUM>s is rather expensive when used in 105allocation to create B<BIGNUM>s is rather expensive when used in
@@ -207,12 +219,12 @@ significant non-zero word plus one when B<a> has shrunk.
207=head2 Debugging 219=head2 Debugging
208 220
209bn_check_top() verifies that C<((a)-E<gt>top E<gt>= 0 && (a)-E<gt>top 221bn_check_top() verifies that C<((a)-E<gt>top E<gt>= 0 && (a)-E<gt>top
210E<lt>= (a)-E<gt>max)>. A violation will cause the program to abort. 222E<lt>= (a)-E<gt>dmax)>. A violation will cause the program to abort.
211 223
212bn_print() prints B<a> to stderr. bn_dump() prints B<n> words at B<d> 224bn_print() prints B<a> to stderr. bn_dump() prints B<n> words at B<d>
213(in reverse order, i.e. most significant word first) to stderr. 225(in reverse order, i.e. most significant word first) to stderr.
214 226
215bn_set_max() makes B<a> a static number with a B<max> of its current size. 227bn_set_max() makes B<a> a static number with a B<dmax> of its current size.
216This is used by bn_set_low() and bn_set_high() to make B<r> a read-only 228This is used by bn_set_low() and bn_set_high() to make B<r> a read-only
217B<BIGNUM> that contains the B<n> low or high words of B<a>. 229B<BIGNUM> that contains the B<n> low or high words of B<a>.
218 230
diff --git a/src/lib/libssl/src/doc/crypto/d2i_RSAPublicKey.pod b/src/lib/libssl/src/doc/crypto/d2i_RSAPublicKey.pod
index 279b29c873..aa6078bcf6 100644
--- a/src/lib/libssl/src/doc/crypto/d2i_RSAPublicKey.pod
+++ b/src/lib/libssl/src/doc/crypto/d2i_RSAPublicKey.pod
@@ -11,21 +11,21 @@ d2i_Netscape_RSA - RSA public and private key encoding functions.
11 #include <openssl/rsa.h> 11 #include <openssl/rsa.h>
12 #include <openssl/x509.h> 12 #include <openssl/x509.h>
13 13
14 RSA * d2i_RSAPublicKey(RSA **a, unsigned char **pp, long length); 14 RSA * d2i_RSAPublicKey(RSA **a, const unsigned char **pp, long length);
15 15
16 int i2d_RSAPublicKey(RSA *a, unsigned char **pp); 16 int i2d_RSAPublicKey(RSA *a, unsigned char **pp);
17 17
18 RSA * d2i_RSA_PUBKEY(RSA **a, unsigned char **pp, long length); 18 RSA * d2i_RSA_PUBKEY(RSA **a, const unsigned char **pp, long length);
19 19
20 int i2d_RSA_PUBKEY(RSA *a, unsigned char **pp); 20 int i2d_RSA_PUBKEY(RSA *a, unsigned char **pp);
21 21
22 RSA * d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length); 22 RSA * d2i_RSAPrivateKey(RSA **a, const unsigned char **pp, long length);
23 23
24 int i2d_RSAPrivateKey(RSA *a, unsigned char **pp); 24 int i2d_RSAPrivateKey(RSA *a, unsigned char **pp);
25 25
26 int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)()); 26 int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)());
27 27
28 RSA * d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)()); 28 RSA * d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length, int (*cb)());
29 29
30=head1 DESCRIPTION 30=head1 DESCRIPTION
31 31
diff --git a/src/lib/libssl/src/doc/crypto/d2i_X509.pod b/src/lib/libssl/src/doc/crypto/d2i_X509.pod
index 5bfa18afbb..298ec54a4c 100644
--- a/src/lib/libssl/src/doc/crypto/d2i_X509.pod
+++ b/src/lib/libssl/src/doc/crypto/d2i_X509.pod
@@ -15,8 +15,8 @@ i2d_X509_fp - X509 encode and decode functions
15 X509 *d2i_X509_bio(BIO *bp, X509 **x); 15 X509 *d2i_X509_bio(BIO *bp, X509 **x);
16 X509 *d2i_X509_fp(FILE *fp, X509 **x); 16 X509 *d2i_X509_fp(FILE *fp, X509 **x);
17 17
18 int i2d_X509_bio(X509 *x, BIO *bp); 18 int i2d_X509_bio(BIO *bp, X509 *x);
19 int i2d_X509_fp(X509 *x, FILE *fp); 19 int i2d_X509_fp(FILE *fp, X509 *x);
20 20
21=head1 DESCRIPTION 21=head1 DESCRIPTION
22 22
@@ -212,11 +212,11 @@ d2i_X509(), d2i_X509_bio() and d2i_X509_fp() return a valid B<X509> structure
212or B<NULL> if an error occurs. The error code that can be obtained by 212or B<NULL> if an error occurs. The error code that can be obtained by
213L<ERR_get_error(3)|ERR_get_error(3)>. 213L<ERR_get_error(3)|ERR_get_error(3)>.
214 214
215i2d_X509(), i2d_X509_bio() and i2d_X509_fp() return a the number of bytes 215i2d_X509() returns the number of bytes successfully encoded or a negative
216successfully encoded or a negative value if an error occurs. The error code 216value if an error occurs. The error code can be obtained by
217can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. 217L<ERR_get_error(3)|ERR_get_error(3)>.
218 218
219i2d_X509_bio() and i2d_X509_fp() returns 1 for success and 0 if an error 219i2d_X509_bio() and i2d_X509_fp() return 1 for success and 0 if an error
220occurs The error code can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. 220occurs The error code can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
221 221
222=head1 SEE ALSO 222=head1 SEE ALSO
diff --git a/src/lib/libssl/src/doc/crypto/d2i_X509_CRL.pod b/src/lib/libssl/src/doc/crypto/d2i_X509_CRL.pod
index e7295a5d61..224f9e082b 100644
--- a/src/lib/libssl/src/doc/crypto/d2i_X509_CRL.pod
+++ b/src/lib/libssl/src/doc/crypto/d2i_X509_CRL.pod
@@ -15,8 +15,8 @@ i2d_X509_CRL_bio, i2d_X509_CRL_fp - PKCS#10 certificate request functions.
15 X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **x); 15 X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **x);
16 X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **x); 16 X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **x);
17 17
18 int i2d_X509_CRL_bio(X509_CRL *x, BIO *bp); 18 int i2d_X509_CRL_bio(BIO *bp, X509_CRL *x);
19 int i2d_X509_CRL_fp(X509_CRL *x, FILE *fp); 19 int i2d_X509_CRL_fp(FILE *fp, X509_CRL *x);
20 20
21=head1 DESCRIPTION 21=head1 DESCRIPTION
22 22
diff --git a/src/lib/libssl/src/doc/crypto/d2i_X509_REQ.pod b/src/lib/libssl/src/doc/crypto/d2i_X509_REQ.pod
index ae32a3891d..91c0c1974b 100644
--- a/src/lib/libssl/src/doc/crypto/d2i_X509_REQ.pod
+++ b/src/lib/libssl/src/doc/crypto/d2i_X509_REQ.pod
@@ -15,8 +15,8 @@ i2d_X509_REQ_bio, i2d_X509_REQ_fp - PKCS#10 certificate request functions.
15 X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **x); 15 X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **x);
16 X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **x); 16 X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **x);
17 17
18 int i2d_X509_REQ_bio(X509_REQ *x, BIO *bp); 18 int i2d_X509_REQ_bio(BIO *bp, X509_REQ *x);
19 int i2d_X509_REQ_fp(X509_REQ *x, FILE *fp); 19 int i2d_X509_REQ_fp(FILE *fp, X509_REQ *x);
20 20
21=head1 DESCRIPTION 21=head1 DESCRIPTION
22 22
diff --git a/src/lib/libssl/src/doc/crypto/evp.pod b/src/lib/libssl/src/doc/crypto/evp.pod
index b3ca14314f..9faa349243 100644
--- a/src/lib/libssl/src/doc/crypto/evp.pod
+++ b/src/lib/libssl/src/doc/crypto/evp.pod
@@ -22,14 +22,24 @@ digital signatures.
22Symmetric encryption is available with the B<EVP_Encrypt>I<...> 22Symmetric encryption is available with the B<EVP_Encrypt>I<...>
23functions. The B<EVP_Digest>I<...> functions provide message digests. 23functions. The B<EVP_Digest>I<...> functions provide message digests.
24 24
25The B<EVP_PKEY>I<...> functions provide a high level interface to
26asymmetric algorithms.
27
25Algorithms are loaded with OpenSSL_add_all_algorithms(3). 28Algorithms are loaded with OpenSSL_add_all_algorithms(3).
26 29
27All the symmetric algorithms (ciphers) and digests can be replaced by ENGINE 30All the symmetric algorithms (ciphers), digests and asymmetric algorithms
28modules providing alternative implementations. If ENGINE implementations of 31(public key algorithms) can be replaced by ENGINE modules providing alternative
29ciphers or digests are registered as defaults, then the various EVP functions 32implementations. If ENGINE implementations of ciphers or digests are registered
30will automatically use those implementations automatically in preference to 33as defaults, then the various EVP functions will automatically use those
31built in software implementations. For more information, consult the engine(3) 34implementations automatically in preference to built in software
32man page. 35implementations. For more information, consult the engine(3) man page.
36
37Although low level algorithm specific functions exist for many algorithms
38their use is discouraged. They cannot be used with an ENGINE and ENGINE
39versions of new algorithms cannot be accessed using the low level functions.
40Also makes code harder to adapt to new algorithms and some options are not
41cleanly supported at the low level and some operations are more efficient
42using the high level interface.
33 43
34=head1 SEE ALSO 44=head1 SEE ALSO
35 45
diff --git a/src/lib/libssl/src/doc/crypto/hmac.pod b/src/lib/libssl/src/doc/crypto/hmac.pod
index 0bd79a6d3a..d92138d273 100644
--- a/src/lib/libssl/src/doc/crypto/hmac.pod
+++ b/src/lib/libssl/src/doc/crypto/hmac.pod
@@ -15,12 +15,12 @@ authentication code
15 15
16 void HMAC_CTX_init(HMAC_CTX *ctx); 16 void HMAC_CTX_init(HMAC_CTX *ctx);
17 17
18 void HMAC_Init(HMAC_CTX *ctx, const void *key, int key_len, 18 int HMAC_Init(HMAC_CTX *ctx, const void *key, int key_len,
19 const EVP_MD *md); 19 const EVP_MD *md);
20 void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int key_len, 20 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int key_len,
21 const EVP_MD *md, ENGINE *impl); 21 const EVP_MD *md, ENGINE *impl);
22 void HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, int len); 22 int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, int len);
23 void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); 23 int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
24 24
25 void HMAC_CTX_cleanup(HMAC_CTX *ctx); 25 void HMAC_CTX_cleanup(HMAC_CTX *ctx);
26 void HMAC_cleanup(HMAC_CTX *ctx); 26 void HMAC_cleanup(HMAC_CTX *ctx);
@@ -41,8 +41,6 @@ If B<md> is NULL, the digest is placed in a static array. The size of
41the output is placed in B<md_len>, unless it is B<NULL>. 41the output is placed in B<md_len>, unless it is B<NULL>.
42 42
43B<evp_md> can be EVP_sha1(), EVP_ripemd160() etc. 43B<evp_md> can be EVP_sha1(), EVP_ripemd160() etc.
44B<key> and B<evp_md> may be B<NULL> if a key and hash function have
45been set in a previous call to HMAC_Init() for that B<HMAC_CTX>.
46 44
47HMAC_CTX_init() initialises a B<HMAC_CTX> before first use. It must be 45HMAC_CTX_init() initialises a B<HMAC_CTX> before first use. It must be
48called. 46called.
@@ -78,10 +76,13 @@ must have space for the hash function output.
78 76
79=head1 RETURN VALUES 77=head1 RETURN VALUES
80 78
81HMAC() returns a pointer to the message authentication code. 79HMAC() returns a pointer to the message authentication code or NULL if
80an error occurred.
82 81
83HMAC_CTX_init(), HMAC_Init_ex(), HMAC_Update(), HMAC_Final() and 82HMAC_Init_ex(), HMAC_Update() and HMAC_Final() return 1 for success or 0 if
84HMAC_CTX_cleanup() do not return values. 83an error occurred.
84
85HMAC_CTX_init() and HMAC_CTX_cleanup() do not return values.
85 86
86=head1 CONFORMING TO 87=head1 CONFORMING TO
87 88
@@ -99,4 +100,7 @@ are available since SSLeay 0.9.0.
99HMAC_CTX_init(), HMAC_Init_ex() and HMAC_CTX_cleanup() are available 100HMAC_CTX_init(), HMAC_Init_ex() and HMAC_CTX_cleanup() are available
100since OpenSSL 0.9.7. 101since OpenSSL 0.9.7.
101 102
103HMAC_Init_ex(), HMAC_Update() and HMAC_Final() did not return values in
104versions of OpenSSL before 1.0.0.
105
102=cut 106=cut
diff --git a/src/lib/libssl/src/doc/crypto/lhash.pod b/src/lib/libssl/src/doc/crypto/lhash.pod
index dcdbb43a8e..73a19b6c7e 100644
--- a/src/lib/libssl/src/doc/crypto/lhash.pod
+++ b/src/lib/libssl/src/doc/crypto/lhash.pod
@@ -8,18 +8,20 @@ lh_new, lh_free, lh_insert, lh_delete, lh_retrieve, lh_doall, lh_doall_arg, lh_e
8 8
9 #include <openssl/lhash.h> 9 #include <openssl/lhash.h>
10 10
11 LHASH *lh_new(LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE compare); 11 DECLARE_LHASH_OF(<type>);
12 void lh_free(LHASH *table);
13 12
14 void *lh_insert(LHASH *table, void *data); 13 LHASH *lh_<type>_new();
15 void *lh_delete(LHASH *table, void *data); 14 void lh_<type>_free(LHASH_OF(<type> *table);
16 void *lh_retrieve(LHASH *table, void *data);
17 15
18 void lh_doall(LHASH *table, LHASH_DOALL_FN_TYPE func); 16 <type> *lh_<type>_insert(LHASH_OF(<type> *table, <type> *data);
19 void lh_doall_arg(LHASH *table, LHASH_DOALL_ARG_FN_TYPE func, 17 <type> *lh_<type>_delete(LHASH_OF(<type> *table, <type> *data);
20 void *arg); 18 <type> *lh_retrieve(LHASH_OF<type> *table, <type> *data);
21 19
22 int lh_error(LHASH *table); 20 void lh_<type>_doall(LHASH_OF(<type> *table, LHASH_DOALL_FN_TYPE func);
21 void lh_<type>_doall_arg(LHASH_OF(<type> *table, LHASH_DOALL_ARG_FN_TYPE func,
22 <type2>, <type2> *arg);
23
24 int lh_<type>_error(LHASH_OF(<type> *table);
23 25
24 typedef int (*LHASH_COMP_FN_TYPE)(const void *, const void *); 26 typedef int (*LHASH_COMP_FN_TYPE)(const void *, const void *);
25 typedef unsigned long (*LHASH_HASH_FN_TYPE)(const void *); 27 typedef unsigned long (*LHASH_HASH_FN_TYPE)(const void *);
@@ -28,113 +30,115 @@ lh_new, lh_free, lh_insert, lh_delete, lh_retrieve, lh_doall, lh_doall_arg, lh_e
28 30
29=head1 DESCRIPTION 31=head1 DESCRIPTION
30 32
31This library implements dynamic hash tables. The hash table entries 33This library implements type-checked dynamic hash tables. The hash
32can be arbitrary structures. Usually they consist of key and value 34table entries can be arbitrary structures. Usually they consist of key
33fields. 35and value fields.
34 36
35lh_new() creates a new B<LHASH> structure to store arbitrary data 37lh_<type>_new() creates a new B<LHASH_OF(<type>> structure to store
36entries, and provides the 'hash' and 'compare' callbacks to be used in 38arbitrary data entries, and provides the 'hash' and 'compare'
37organising the table's entries. The B<hash> callback takes a pointer 39callbacks to be used in organising the table's entries. The B<hash>
38to a table entry as its argument and returns an unsigned long hash 40callback takes a pointer to a table entry as its argument and returns
39value for its key field. The hash value is normally truncated to a 41an unsigned long hash value for its key field. The hash value is
40power of 2, so make sure that your hash function returns well mixed 42normally truncated to a power of 2, so make sure that your hash
41low order bits. The B<compare> callback takes two arguments (pointers 43function returns well mixed low order bits. The B<compare> callback
42to two hash table entries), and returns 0 if their keys are equal, 44takes two arguments (pointers to two hash table entries), and returns
43non-zero otherwise. If your hash table will contain items of some 450 if their keys are equal, non-zero otherwise. If your hash table
44particular type and the B<hash> and B<compare> callbacks hash/compare 46will contain items of some particular type and the B<hash> and
45these types, then the B<DECLARE_LHASH_HASH_FN> and 47B<compare> callbacks hash/compare these types, then the
46B<IMPLEMENT_LHASH_COMP_FN> macros can be used to create callback 48B<DECLARE_LHASH_HASH_FN> and B<IMPLEMENT_LHASH_COMP_FN> macros can be
47wrappers of the prototypes required by lh_new(). These provide 49used to create callback wrappers of the prototypes required by
48per-variable casts before calling the type-specific callbacks written 50lh_<type>_new(). These provide per-variable casts before calling the
49by the application author. These macros, as well as those used for 51type-specific callbacks written by the application author. These
50the "doall" callbacks, are defined as; 52macros, as well as those used for the "doall" callbacks, are defined
51 53as;
52 #define DECLARE_LHASH_HASH_FN(f_name,o_type) \ 54
53 unsigned long f_name##_LHASH_HASH(const void *); 55 #define DECLARE_LHASH_HASH_FN(name, o_type) \
54 #define IMPLEMENT_LHASH_HASH_FN(f_name,o_type) \ 56 unsigned long name##_LHASH_HASH(const void *);
55 unsigned long f_name##_LHASH_HASH(const void *arg) { \ 57 #define IMPLEMENT_LHASH_HASH_FN(name, o_type) \
56 o_type a = (o_type)arg; \ 58 unsigned long name##_LHASH_HASH(const void *arg) { \
57 return f_name(a); } 59 const o_type *a = arg; \
58 #define LHASH_HASH_FN(f_name) f_name##_LHASH_HASH 60 return name##_hash(a); }
59 61 #define LHASH_HASH_FN(name) name##_LHASH_HASH
60 #define DECLARE_LHASH_COMP_FN(f_name,o_type) \ 62
61 int f_name##_LHASH_COMP(const void *, const void *); 63 #define DECLARE_LHASH_COMP_FN(name, o_type) \
62 #define IMPLEMENT_LHASH_COMP_FN(f_name,o_type) \ 64 int name##_LHASH_COMP(const void *, const void *);
63 int f_name##_LHASH_COMP(const void *arg1, const void *arg2) { \ 65 #define IMPLEMENT_LHASH_COMP_FN(name, o_type) \
64 o_type a = (o_type)arg1; \ 66 int name##_LHASH_COMP(const void *arg1, const void *arg2) { \
65 o_type b = (o_type)arg2; \ 67 const o_type *a = arg1; \
66 return f_name(a,b); } 68 const o_type *b = arg2; \
67 #define LHASH_COMP_FN(f_name) f_name##_LHASH_COMP 69 return name##_cmp(a,b); }
68 70 #define LHASH_COMP_FN(name) name##_LHASH_COMP
69 #define DECLARE_LHASH_DOALL_FN(f_name,o_type) \ 71
70 void f_name##_LHASH_DOALL(const void *); 72 #define DECLARE_LHASH_DOALL_FN(name, o_type) \
71 #define IMPLEMENT_LHASH_DOALL_FN(f_name,o_type) \ 73 void name##_LHASH_DOALL(void *);
72 void f_name##_LHASH_DOALL(const void *arg) { \ 74 #define IMPLEMENT_LHASH_DOALL_FN(name, o_type) \
73 o_type a = (o_type)arg; \ 75 void name##_LHASH_DOALL(void *arg) { \
74 f_name(a); } 76 o_type *a = arg; \
75 #define LHASH_DOALL_FN(f_name) f_name##_LHASH_DOALL 77 name##_doall(a); }
76 78 #define LHASH_DOALL_FN(name) name##_LHASH_DOALL
77 #define DECLARE_LHASH_DOALL_ARG_FN(f_name,o_type,a_type) \ 79
78 void f_name##_LHASH_DOALL_ARG(const void *, const void *); 80 #define DECLARE_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
79 #define IMPLEMENT_LHASH_DOALL_ARG_FN(f_name,o_type,a_type) \ 81 void name##_LHASH_DOALL_ARG(void *, void *);
80 void f_name##_LHASH_DOALL_ARG(const void *arg1, const void *arg2) { \ 82 #define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
81 o_type a = (o_type)arg1; \ 83 void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \
82 a_type b = (a_type)arg2; \ 84 o_type *a = arg1; \
83 f_name(a,b); } 85 a_type *b = arg2; \
84 #define LHASH_DOALL_ARG_FN(f_name) f_name##_LHASH_DOALL_ARG 86 name##_doall_arg(a, b); }
85 87 #define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG
86An example of a hash table storing (pointers to) structures of type 'STUFF' 88
87could be defined as follows; 89 An example of a hash table storing (pointers to) structures of type 'STUFF'
90 could be defined as follows;
88 91
89 /* Calculates the hash value of 'tohash' (implemented elsewhere) */ 92 /* Calculates the hash value of 'tohash' (implemented elsewhere) */
90 unsigned long STUFF_hash(const STUFF *tohash); 93 unsigned long STUFF_hash(const STUFF *tohash);
91 /* Orders 'arg1' and 'arg2' (implemented elsewhere) */ 94 /* Orders 'arg1' and 'arg2' (implemented elsewhere) */
92 int STUFF_cmp(const STUFF *arg1, const STUFF *arg2); 95 int stuff_cmp(const STUFF *arg1, const STUFF *arg2);
93 /* Create the type-safe wrapper functions for use in the LHASH internals */ 96 /* Create the type-safe wrapper functions for use in the LHASH internals */
94 static IMPLEMENT_LHASH_HASH_FN(STUFF_hash, const STUFF *) 97 static IMPLEMENT_LHASH_HASH_FN(stuff, STUFF);
95 static IMPLEMENT_LHASH_COMP_FN(STUFF_cmp, const STUFF *); 98 static IMPLEMENT_LHASH_COMP_FN(stuff, STUFF);
96 /* ... */ 99 /* ... */
97 int main(int argc, char *argv[]) { 100 int main(int argc, char *argv[]) {
98 /* Create the new hash table using the hash/compare wrappers */ 101 /* Create the new hash table using the hash/compare wrappers */
99 LHASH *hashtable = lh_new(LHASH_HASH_FN(STUFF_hash), 102 LHASH_OF(STUFF) *hashtable = lh_STUFF_new(LHASH_HASH_FN(STUFF_hash),
100 LHASH_COMP_FN(STUFF_cmp)); 103 LHASH_COMP_FN(STUFF_cmp));
101 /* ... */ 104 /* ... */
102 } 105 }
103 106
104lh_free() frees the B<LHASH> structure B<table>. Allocated hash table 107lh_<type>_free() frees the B<LHASH_OF(<type>> structure
105entries will not be freed; consider using lh_doall() to deallocate any 108B<table>. Allocated hash table entries will not be freed; consider
106remaining entries in the hash table (see below). 109using lh_<type>_doall() to deallocate any remaining entries in the
110hash table (see below).
107 111
108lh_insert() inserts the structure pointed to by B<data> into B<table>. 112lh_<type>_insert() inserts the structure pointed to by B<data> into
109If there already is an entry with the same key, the old value is 113B<table>. If there already is an entry with the same key, the old
110replaced. Note that lh_insert() stores pointers, the data are not 114value is replaced. Note that lh_<type>_insert() stores pointers, the
111copied. 115data are not copied.
112 116
113lh_delete() deletes an entry from B<table>. 117lh_<type>_delete() deletes an entry from B<table>.
114 118
115lh_retrieve() looks up an entry in B<table>. Normally, B<data> is 119lh_<type>_retrieve() looks up an entry in B<table>. Normally, B<data>
116a structure with the key field(s) set; the function will return a 120is a structure with the key field(s) set; the function will return a
117pointer to a fully populated structure. 121pointer to a fully populated structure.
118 122
119lh_doall() will, for every entry in the hash table, call B<func> with 123lh_<type>_doall() will, for every entry in the hash table, call
120the data item as its parameter. For lh_doall() and lh_doall_arg(), 124B<func> with the data item as its parameter. For lh_<type>_doall()
121function pointer casting should be avoided in the callbacks (see 125and lh_<type>_doall_arg(), function pointer casting should be avoided
122B<NOTE>) - instead, either declare the callbacks to match the 126in the callbacks (see B<NOTE>) - instead use the declare/implement
123prototype required in lh_new() or use the declare/implement macros to 127macros to create type-checked wrappers that cast variables prior to
124create type-safe wrappers that cast variables prior to calling your 128calling your type-specific callbacks. An example of this is
125type-specific callbacks. An example of this is illustrated here where 129illustrated here where the callback is used to cleanup resources for
126the callback is used to cleanup resources for items in the hash table 130items in the hash table prior to the hashtable itself being
127prior to the hashtable itself being deallocated: 131deallocated:
128 132
129 /* Cleans up resources belonging to 'a' (this is implemented elsewhere) */ 133 /* Cleans up resources belonging to 'a' (this is implemented elsewhere) */
130 void STUFF_cleanup(STUFF *a); 134 void STUFF_cleanup_doall(STUFF *a);
131 /* Implement a prototype-compatible wrapper for "STUFF_cleanup" */ 135 /* Implement a prototype-compatible wrapper for "STUFF_cleanup" */
132 IMPLEMENT_LHASH_DOALL_FN(STUFF_cleanup, STUFF *) 136 IMPLEMENT_LHASH_DOALL_FN(STUFF_cleanup, STUFF)
133 /* ... then later in the code ... */ 137 /* ... then later in the code ... */
134 /* So to run "STUFF_cleanup" against all items in a hash table ... */ 138 /* So to run "STUFF_cleanup" against all items in a hash table ... */
135 lh_doall(hashtable, LHASH_DOALL_FN(STUFF_cleanup)); 139 lh_STUFF_doall(hashtable, LHASH_DOALL_FN(STUFF_cleanup));
136 /* Then the hash table itself can be deallocated */ 140 /* Then the hash table itself can be deallocated */
137 lh_free(hashtable); 141 lh_STUFF_free(hashtable);
138 142
139When doing this, be careful if you delete entries from the hash table 143When doing this, be careful if you delete entries from the hash table
140in your callbacks: the table may decrease in size, moving the item 144in your callbacks: the table may decrease in size, moving the item
@@ -145,51 +149,52 @@ you start (which will stop the hash table ever decreasing in size).
145The best solution is probably to avoid deleting items from the hash 149The best solution is probably to avoid deleting items from the hash
146table inside a "doall" callback! 150table inside a "doall" callback!
147 151
148lh_doall_arg() is the same as lh_doall() except that B<func> will be 152lh_<type>_doall_arg() is the same as lh_<type>_doall() except that
149called with B<arg> as the second argument and B<func> should be of 153B<func> will be called with B<arg> as the second argument and B<func>
150type B<LHASH_DOALL_ARG_FN_TYPE> (a callback prototype that is passed 154should be of type B<LHASH_DOALL_ARG_FN_TYPE> (a callback prototype
151both the table entry and an extra argument). As with lh_doall(), you 155that is passed both the table entry and an extra argument). As with
152can instead choose to declare your callback with a prototype matching 156lh_doall(), you can instead choose to declare your callback with a
153the types you are dealing with and use the declare/implement macros to 157prototype matching the types you are dealing with and use the
154create compatible wrappers that cast variables before calling your 158declare/implement macros to create compatible wrappers that cast
155type-specific callbacks. An example of this is demonstrated here 159variables before calling your type-specific callbacks. An example of
156(printing all hash table entries to a BIO that is provided by the 160this is demonstrated here (printing all hash table entries to a BIO
157caller): 161that is provided by the caller):
158 162
159 /* Prints item 'a' to 'output_bio' (this is implemented elsewhere) */ 163 /* Prints item 'a' to 'output_bio' (this is implemented elsewhere) */
160 void STUFF_print(const STUFF *a, BIO *output_bio); 164 void STUFF_print_doall_arg(const STUFF *a, BIO *output_bio);
161 /* Implement a prototype-compatible wrapper for "STUFF_print" */ 165 /* Implement a prototype-compatible wrapper for "STUFF_print" */
162 static IMPLEMENT_LHASH_DOALL_ARG_FN(STUFF_print, const STUFF *, BIO *) 166 static IMPLEMENT_LHASH_DOALL_ARG_FN(STUFF, const STUFF, BIO)
163 /* ... then later in the code ... */ 167 /* ... then later in the code ... */
164 /* Print out the entire hashtable to a particular BIO */ 168 /* Print out the entire hashtable to a particular BIO */
165 lh_doall_arg(hashtable, LHASH_DOALL_ARG_FN(STUFF_print), logging_bio); 169 lh_STUFF_doall_arg(hashtable, LHASH_DOALL_ARG_FN(STUFF_print), BIO,
170 logging_bio);
166 171
167lh_error() can be used to determine if an error occurred in the last 172lh_<type>_error() can be used to determine if an error occurred in the last
168operation. lh_error() is a macro. 173operation. lh_<type>_error() is a macro.
169 174
170=head1 RETURN VALUES 175=head1 RETURN VALUES
171 176
172lh_new() returns B<NULL> on error, otherwise a pointer to the new 177lh_<type>_new() returns B<NULL> on error, otherwise a pointer to the new
173B<LHASH> structure. 178B<LHASH> structure.
174 179
175When a hash table entry is replaced, lh_insert() returns the value 180When a hash table entry is replaced, lh_<type>_insert() returns the value
176being replaced. B<NULL> is returned on normal operation and on error. 181being replaced. B<NULL> is returned on normal operation and on error.
177 182
178lh_delete() returns the entry being deleted. B<NULL> is returned if 183lh_<type>_delete() returns the entry being deleted. B<NULL> is returned if
179there is no such value in the hash table. 184there is no such value in the hash table.
180 185
181lh_retrieve() returns the hash table entry if it has been found, 186lh_<type>_retrieve() returns the hash table entry if it has been found,
182B<NULL> otherwise. 187B<NULL> otherwise.
183 188
184lh_error() returns 1 if an error occurred in the last operation, 0 189lh_<type>_error() returns 1 if an error occurred in the last operation, 0
185otherwise. 190otherwise.
186 191
187lh_free(), lh_doall() and lh_doall_arg() return no values. 192lh_<type>_free(), lh_<type>_doall() and lh_<type>_doall_arg() return no values.
188 193
189=head1 NOTE 194=head1 NOTE
190 195
191The various LHASH macros and callback types exist to make it possible 196The various LHASH macros and callback types exist to make it possible
192to write type-safe code without resorting to function-prototype 197to write type-checked code without resorting to function-prototype
193casting - an evil that makes application code much harder to 198casting - an evil that makes application code much harder to
194audit/verify and also opens the window of opportunity for stack 199audit/verify and also opens the window of opportunity for stack
195corruption and other hard-to-find bugs. It also, apparently, violates 200corruption and other hard-to-find bugs. It also, apparently, violates
@@ -227,7 +232,7 @@ without any "const" qualifiers.
227 232
228=head1 BUGS 233=head1 BUGS
229 234
230lh_insert() returns B<NULL> both for success and error. 235lh_<type>_insert() returns B<NULL> both for success and error.
231 236
232=head1 INTERNALS 237=head1 INTERNALS
233 238
@@ -272,8 +277,8 @@ lh_strhash() is a demo string hashing function:
272 unsigned long lh_strhash(const char *c); 277 unsigned long lh_strhash(const char *c);
273 278
274Since the B<LHASH> routines would normally be passed structures, this 279Since the B<LHASH> routines would normally be passed structures, this
275routine would not normally be passed to lh_new(), rather it would be 280routine would not normally be passed to lh_<type>_new(), rather it would be
276used in the function passed to lh_new(). 281used in the function passed to lh_<type>_new().
277 282
278=head1 SEE ALSO 283=head1 SEE ALSO
279 284
@@ -291,4 +296,7 @@ were changed for better type safety, and the function types LHASH_COMP_FN_TYPE,
291LHASH_HASH_FN_TYPE, LHASH_DOALL_FN_TYPE and LHASH_DOALL_ARG_FN_TYPE 296LHASH_HASH_FN_TYPE, LHASH_DOALL_FN_TYPE and LHASH_DOALL_ARG_FN_TYPE
292became available. 297became available.
293 298
299In OpenSSL 1.0.0, the lhash interface was revamped for even better
300type checking.
301
294=cut 302=cut
diff --git a/src/lib/libssl/src/doc/crypto/pem.pod b/src/lib/libssl/src/doc/crypto/pem.pod
index 4f9a27df0c..d5b1896119 100644
--- a/src/lib/libssl/src/doc/crypto/pem.pod
+++ b/src/lib/libssl/src/doc/crypto/pem.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5PEM - PEM routines 5PEM, PEM_read_bio_PrivateKey, PEM_read_PrivateKey, PEM_write_bio_PrivateKey, PEM_write_PrivateKey, PEM_write_bio_PKCS8PrivateKey, PEM_write_PKCS8PrivateKey, PEM_write_bio_PKCS8PrivateKey_nid, PEM_write_PKCS8PrivateKey_nid, PEM_read_bio_PUBKEY, PEM_read_PUBKEY, PEM_write_bio_PUBKEY, PEM_write_PUBKEY, PEM_read_bio_RSAPrivateKey, PEM_read_RSAPrivateKey, PEM_write_bio_RSAPrivateKey, PEM_write_RSAPrivateKey, PEM_read_bio_RSAPublicKey, PEM_read_RSAPublicKey, PEM_write_bio_RSAPublicKey, PEM_write_RSAPublicKey, PEM_read_bio_RSA_PUBKEY, PEM_read_RSA_PUBKEY, PEM_write_bio_RSA_PUBKEY, PEM_write_RSA_PUBKEY, PEM_read_bio_DSAPrivateKey, PEM_read_DSAPrivateKey, PEM_write_bio_DSAPrivateKey, PEM_write_DSAPrivateKey, PEM_read_bio_DSA_PUBKEY, PEM_read_DSA_PUBKEY, PEM_write_bio_DSA_PUBKEY, PEM_write_DSA_PUBKEY, PEM_read_bio_DSAparams, PEM_read_DSAparams, PEM_write_bio_DSAparams, PEM_write_DSAparams, PEM_read_bio_DHparams, PEM_read_DHparams, PEM_write_bio_DHparams, PEM_write_DHparams, PEM_read_bio_X509, PEM_read_X509, PEM_write_bio_X509, PEM_write_X509, PEM_read_bio_X509_AUX, PEM_read_X509_AUX, PEM_write_bio_X509_AUX, PEM_write_X509_AUX, PEM_read_bio_X509_REQ, PEM_read_X509_REQ, PEM_write_bio_X509_REQ, PEM_write_X509_REQ, PEM_write_bio_X509_REQ_NEW, PEM_write_X509_REQ_NEW, PEM_read_bio_X509_CRL, PEM_read_X509_CRL, PEM_write_bio_X509_CRL, PEM_write_X509_CRL, PEM_read_bio_PKCS7, PEM_read_PKCS7, PEM_write_bio_PKCS7, PEM_write_PKCS7, PEM_read_bio_NETSCAPE_CERT_SEQUENCE, PEM_read_NETSCAPE_CERT_SEQUENCE, PEM_write_bio_NETSCAPE_CERT_SEQUENCE, PEM_write_NETSCAPE_CERT_SEQUENCE - PEM routines
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
diff --git a/src/lib/libssl/src/doc/crypto/threads.pod b/src/lib/libssl/src/doc/crypto/threads.pod
index 3df4ecd776..dc0e9391dc 100644
--- a/src/lib/libssl/src/doc/crypto/threads.pod
+++ b/src/lib/libssl/src/doc/crypto/threads.pod
@@ -2,7 +2,9 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5CRYPTO_set_locking_callback, CRYPTO_set_id_callback, CRYPTO_num_locks, 5CRYPTO_THREADID_set_callback, CRYPTO_THREADID_get_callback,
6CRYPTO_THREADID_current, CRYPTO_THREADID_cmp, CRYPTO_THREADID_cpy,
7CRYPTO_THREADID_hash, CRYPTO_set_locking_callback, CRYPTO_num_locks,
6CRYPTO_set_dynlock_create_callback, CRYPTO_set_dynlock_lock_callback, 8CRYPTO_set_dynlock_create_callback, CRYPTO_set_dynlock_lock_callback,
7CRYPTO_set_dynlock_destroy_callback, CRYPTO_get_new_dynlockid, 9CRYPTO_set_dynlock_destroy_callback, CRYPTO_get_new_dynlockid,
8CRYPTO_destroy_dynlockid, CRYPTO_lock - OpenSSL thread support 10CRYPTO_destroy_dynlockid, CRYPTO_lock - OpenSSL thread support
@@ -11,14 +13,26 @@ CRYPTO_destroy_dynlockid, CRYPTO_lock - OpenSSL thread support
11 13
12 #include <openssl/crypto.h> 14 #include <openssl/crypto.h>
13 15
14 void CRYPTO_set_locking_callback(void (*locking_function)(int mode, 16 /* Don't use this structure directly. */
15 int n, const char *file, int line)); 17 typedef struct crypto_threadid_st
16 18 {
17 void CRYPTO_set_id_callback(unsigned long (*id_function)(void)); 19 void *ptr;
20 unsigned long val;
21 } CRYPTO_THREADID;
22 /* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */
23 void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long val);
24 void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr);
25 int CRYPTO_THREADID_set_callback(void (*threadid_func)(CRYPTO_THREADID *));
26 void (*CRYPTO_THREADID_get_callback(void))(CRYPTO_THREADID *);
27 void CRYPTO_THREADID_current(CRYPTO_THREADID *id);
28 int CRYPTO_THREADID_cmp(const CRYPTO_THREADID *a,
29 const CRYPTO_THREADID *b);
30 void CRYPTO_THREADID_cpy(CRYPTO_THREADID *dest,
31 const CRYPTO_THREADID *src);
32 unsigned long CRYPTO_THREADID_hash(const CRYPTO_THREADID *id);
18 33
19 int CRYPTO_num_locks(void); 34 int CRYPTO_num_locks(void);
20 35
21
22 /* struct CRYPTO_dynlock_value needs to be defined by the user */ 36 /* struct CRYPTO_dynlock_value needs to be defined by the user */
23 struct CRYPTO_dynlock_value; 37 struct CRYPTO_dynlock_value;
24 38
@@ -50,7 +64,8 @@ CRYPTO_destroy_dynlockid, CRYPTO_lock - OpenSSL thread support
50=head1 DESCRIPTION 64=head1 DESCRIPTION
51 65
52OpenSSL can safely be used in multi-threaded applications provided 66OpenSSL can safely be used in multi-threaded applications provided
53that at least two callback functions are set. 67that at least two callback functions are set, locking_function and
68threadid_func.
54 69
55locking_function(int mode, int n, const char *file, int line) is 70locking_function(int mode, int n, const char *file, int line) is
56needed to perform locking on shared data structures. 71needed to perform locking on shared data structures.
@@ -65,10 +80,42 @@ B<CRYPTO_LOCK>, and releases it otherwise.
65B<file> and B<line> are the file number of the function setting the 80B<file> and B<line> are the file number of the function setting the
66lock. They can be useful for debugging. 81lock. They can be useful for debugging.
67 82
68id_function(void) is a function that returns a thread ID, for example 83threadid_func(CRYPTO_THREADID *id) is needed to record the currently-executing
69pthread_self() if it returns an integer (see NOTES below). It isn't 84thread's identifier into B<id>. The implementation of this callback should not
70needed on Windows nor on platforms where getpid() returns a different 85fill in B<id> directly, but should use CRYPTO_THREADID_set_numeric() if thread
71ID for each thread (see NOTES below). 86IDs are numeric, or CRYPTO_THREADID_set_pointer() if they are pointer-based.
87If the application does not register such a callback using
88CRYPTO_THREADID_set_callback(), then a default implementation is used - on
89Windows and BeOS this uses the system's default thread identifying APIs, and on
90all other platforms it uses the address of B<errno>. The latter is satisfactory
91for thread-safety if and only if the platform has a thread-local error number
92facility.
93
94Once threadid_func() is registered, or if the built-in default implementation is
95to be used;
96
97=over 4
98
99=item *
100CRYPTO_THREADID_current() records the currently-executing thread ID into the
101given B<id> object.
102
103=item *
104CRYPTO_THREADID_cmp() compares two thread IDs (returning zero for equality, ie.
105the same semantics as memcmp()).
106
107=item *
108CRYPTO_THREADID_cpy() duplicates a thread ID value,
109
110=item *
111CRYPTO_THREADID_hash() returns a numeric value usable as a hash-table key. This
112is usually the exact numeric or pointer-based thread ID used internally, however
113this also handles the unusual case where pointers are larger than 'long'
114variables and the platform's thread IDs are pointer-based - in this case, mixing
115is done to attempt to produce a unique numeric value even though it is not as
116wide as the platform's true thread IDs.
117
118=back
72 119
73Additionally, OpenSSL supports dynamic locks, and sometimes, some parts 120Additionally, OpenSSL supports dynamic locks, and sometimes, some parts
74of OpenSSL need it for better performance. To enable this, the following 121of OpenSSL need it for better performance. To enable this, the following
@@ -140,22 +187,6 @@ You can find out if OpenSSL was configured with thread support:
140Also, dynamic locks are currently not used internally by OpenSSL, but 187Also, dynamic locks are currently not used internally by OpenSSL, but
141may do so in the future. 188may do so in the future.
142 189
143Defining id_function(void) has it's own issues. Generally speaking,
144pthread_self() should be used, even on platforms where getpid() gives
145different answers in each thread, since that may depend on the machine
146the program is run on, not the machine where the program is being
147compiled. For instance, Red Hat 8 Linux and earlier used
148LinuxThreads, whose getpid() returns a different value for each
149thread. Red Hat 9 Linux and later use NPTL, which is
150Posix-conformant, and has a getpid() that returns the same value for
151all threads in a process. A program compiled on Red Hat 8 and run on
152Red Hat 9 will therefore see getpid() returning the same value for
153all threads.
154
155There is still the issue of platforms where pthread_self() returns
156something other than an integer. This is a bit unusual, and this
157manual has no cookbook solution for that case.
158
159=head1 EXAMPLES 190=head1 EXAMPLES
160 191
161B<crypto/threads/mttest.c> shows examples of the callback functions on 192B<crypto/threads/mttest.c> shows examples of the callback functions on
@@ -163,10 +194,14 @@ Solaris, Irix and Win32.
163 194
164=head1 HISTORY 195=head1 HISTORY
165 196
166CRYPTO_set_locking_callback() and CRYPTO_set_id_callback() are 197CRYPTO_set_locking_callback() is
167available in all versions of SSLeay and OpenSSL. 198available in all versions of SSLeay and OpenSSL.
168CRYPTO_num_locks() was added in OpenSSL 0.9.4. 199CRYPTO_num_locks() was added in OpenSSL 0.9.4.
169All functions dealing with dynamic locks were added in OpenSSL 0.9.5b-dev. 200All functions dealing with dynamic locks were added in OpenSSL 0.9.5b-dev.
201B<CRYPTO_THREADID> and associated functions were introduced in OpenSSL 1.0.0
202to replace (actually, deprecate) the previous CRYPTO_set_id_callback(),
203CRYPTO_get_id_callback(), and CRYPTO_thread_id() functions which assumed
204thread IDs to always be represented by 'unsigned long'.
170 205
171=head1 SEE ALSO 206=head1 SEE ALSO
172 207
diff --git a/src/lib/libssl/src/doc/crypto/ui_compat.pod b/src/lib/libssl/src/doc/crypto/ui_compat.pod
index 9ab3c69bf2..adf2ae5e53 100644
--- a/src/lib/libssl/src/doc/crypto/ui_compat.pod
+++ b/src/lib/libssl/src/doc/crypto/ui_compat.pod
@@ -7,6 +7,8 @@ Compatibility user interface functions
7 7
8=head1 SYNOPSIS 8=head1 SYNOPSIS
9 9
10 #include <openssl/des_old.h>
11
10 int des_read_password(DES_cblock *key,const char *prompt,int verify); 12 int des_read_password(DES_cblock *key,const char *prompt,int verify);
11 int des_read_2passwords(DES_cblock *key1,DES_cblock *key2, 13 int des_read_2passwords(DES_cblock *key1,DES_cblock *key2,
12 const char *prompt,int verify); 14 const char *prompt,int verify);
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CIPHER_get_name.pod b/src/lib/libssl/src/doc/ssl/SSL_CIPHER_get_name.pod
index f62a869a9b..eb772b55de 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_CIPHER_get_name.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_CIPHER_get_name.pod
@@ -11,7 +11,7 @@ SSL_CIPHER_get_name, SSL_CIPHER_get_bits, SSL_CIPHER_get_version, SSL_CIPHER_des
11 const char *SSL_CIPHER_get_name(const SSL_CIPHER *cipher); 11 const char *SSL_CIPHER_get_name(const SSL_CIPHER *cipher);
12 int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, int *alg_bits); 12 int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, int *alg_bits);
13 char *SSL_CIPHER_get_version(const SSL_CIPHER *cipher); 13 char *SSL_CIPHER_get_version(const SSL_CIPHER *cipher);
14 char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int size); 14 char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int size);
15 15
16=head1 DESCRIPTION 16=head1 DESCRIPTION
17 17
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_new.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_new.pod
index 465220a75c..73e8c47f9a 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_CTX_new.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_new.pod
@@ -8,7 +8,7 @@ SSL_CTX_new - create a new SSL_CTX object as framework for TLS/SSL enabled funct
8 8
9 #include <openssl/ssl.h> 9 #include <openssl/ssl.h>
10 10
11 SSL_CTX *SSL_CTX_new(SSL_METHOD *method); 11 SSL_CTX *SSL_CTX_new(const SSL_METHOD *method);
12 12
13=head1 DESCRIPTION 13=head1 DESCRIPTION
14 14
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_mode.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_mode.pod
index 9822544e5e..8cb669daeb 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_mode.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_mode.pod
@@ -61,6 +61,16 @@ deal with read/write operations returning without success report. The
61flag SSL_MODE_AUTO_RETRY will cause read/write operations to only 61flag SSL_MODE_AUTO_RETRY will cause read/write operations to only
62return after the handshake and successful completion. 62return after the handshake and successful completion.
63 63
64=item SSL_MODE_RELEASE_BUFFERS
65
66When we no longer need a read buffer or a write buffer for a given SSL,
67then release the memory we were using to hold it. Released memory is
68either appended to a list of unused RAM chunks on the SSL_CTX, or simply
69freed if the list of unused chunks would become longer than
70SSL_CTX->freelist_max_len, which defaults to 32. Using this flag can
71save around 34k per idle SSL connection.
72This flag has no effect on SSL v2 connections, or on DTLS connections.
73
64=back 74=back
65 75
66=head1 RETURN VALUES 76=head1 RETURN VALUES
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_options.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_options.pod
index eaed190809..310db84b31 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_options.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_options.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5SSL_CTX_set_options, SSL_set_options, SSL_CTX_get_options, SSL_get_options - manipulate SSL engine options 5SSL_CTX_set_options, SSL_set_options, SSL_CTX_clear_options, SSL_clear_options, SSL_CTX_get_options, SSL_get_options, SSL_get_secure_renegotiation_support - manipulate SSL options
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
@@ -11,26 +11,41 @@ SSL_CTX_set_options, SSL_set_options, SSL_CTX_get_options, SSL_get_options - man
11 long SSL_CTX_set_options(SSL_CTX *ctx, long options); 11 long SSL_CTX_set_options(SSL_CTX *ctx, long options);
12 long SSL_set_options(SSL *ssl, long options); 12 long SSL_set_options(SSL *ssl, long options);
13 13
14 long SSL_CTX_clear_options(SSL_CTX *ctx, long options);
15 long SSL_clear_options(SSL *ssl, long options);
16
14 long SSL_CTX_get_options(SSL_CTX *ctx); 17 long SSL_CTX_get_options(SSL_CTX *ctx);
15 long SSL_get_options(SSL *ssl); 18 long SSL_get_options(SSL *ssl);
16 19
20 long SSL_get_secure_renegotiation_support(SSL *ssl);
21
17=head1 DESCRIPTION 22=head1 DESCRIPTION
18 23
24Note: all these functions are implemented using macros.
25
19SSL_CTX_set_options() adds the options set via bitmask in B<options> to B<ctx>. 26SSL_CTX_set_options() adds the options set via bitmask in B<options> to B<ctx>.
20Options already set before are not cleared! 27Options already set before are not cleared!
21 28
22SSL_set_options() adds the options set via bitmask in B<options> to B<ssl>. 29SSL_set_options() adds the options set via bitmask in B<options> to B<ssl>.
23Options already set before are not cleared! 30Options already set before are not cleared!
24 31
32SSL_CTX_clear_options() clears the options set via bitmask in B<options>
33to B<ctx>.
34
35SSL_clear_options() clears the options set via bitmask in B<options> to B<ssl>.
36
25SSL_CTX_get_options() returns the options set for B<ctx>. 37SSL_CTX_get_options() returns the options set for B<ctx>.
26 38
27SSL_get_options() returns the options set for B<ssl>. 39SSL_get_options() returns the options set for B<ssl>.
28 40
41SSL_get_secure_renegotiation_support() indicates whether the peer supports
42secure renegotiation.
43
29=head1 NOTES 44=head1 NOTES
30 45
31The behaviour of the SSL library can be changed by setting several options. 46The behaviour of the SSL library can be changed by setting several options.
32The options are coded as bitmasks and can be combined by a logical B<or> 47The options are coded as bitmasks and can be combined by a logical B<or>
33operation (|). Options can only be added but can never be reset. 48operation (|).
34 49
35SSL_CTX_set_options() and SSL_set_options() affect the (external) 50SSL_CTX_set_options() and SSL_set_options() affect the (external)
36protocol behaviour of the SSL library. The (internal) behaviour of 51protocol behaviour of the SSL library. The (internal) behaviour of
@@ -199,26 +214,117 @@ Do not use the TLSv1 protocol.
199 214
200When performing renegotiation as a server, always start a new session 215When performing renegotiation as a server, always start a new session
201(i.e., session resumption requests are only accepted in the initial 216(i.e., session resumption requests are only accepted in the initial
202handshake). This option is not needed for clients. 217handshake). This option is not needed for clients.
203 218
204=item SSL_OP_NO_TICKET 219=item SSL_OP_NO_TICKET
205 220
206Normally clients and servers will, where possible, transparently make use 221Normally clients and servers will, where possible, transparently make use
207of RFC4507bis tickets for stateless session resumption if extension support 222of RFC4507bis tickets for stateless session resumption.
208is explicitly set when OpenSSL is compiled.
209 223
210If this option is set this functionality is disabled and tickets will 224If this option is set this functionality is disabled and tickets will
211not be used by clients or servers. 225not be used by clients or servers.
212 226
227=item SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
228
229Allow legacy insecure renegotiation between OpenSSL and unpatched clients or
230servers. See the B<SECURE RENEGOTIATION> section for more details.
231
232=item SSL_OP_LEGACY_SERVER_CONNECT
233
234Allow legacy insecure renegotiation between OpenSSL and unpatched servers
235B<only>: this option is currently set by default. See the
236B<SECURE RENEGOTIATION> section for more details.
237
213=back 238=back
214 239
240=head1 SECURE RENEGOTIATION
241
242OpenSSL 0.9.8m and later always attempts to use secure renegotiation as
243described in RFC5746. This counters the prefix attack described in
244CVE-2009-3555 and elsewhere.
245
246The deprecated and highly broken SSLv2 protocol does not support
247renegotiation at all: its use is B<strongly> discouraged.
248
249This attack has far reaching consequences which application writers should be
250aware of. In the description below an implementation supporting secure
251renegotiation is referred to as I<patched>. A server not supporting secure
252renegotiation is referred to as I<unpatched>.
253
254The following sections describe the operations permitted by OpenSSL's secure
255renegotiation implementation.
256
257=head2 Patched client and server
258
259Connections and renegotiation are always permitted by OpenSSL implementations.
260
261=head2 Unpatched client and patched OpenSSL server
262
263The initial connection suceeds but client renegotiation is denied by the
264server with a B<no_renegotiation> warning alert if TLS v1.0 is used or a fatal
265B<handshake_failure> alert in SSL v3.0.
266
267If the patched OpenSSL server attempts to renegotiate a fatal
268B<handshake_failure> alert is sent. This is because the server code may be
269unaware of the unpatched nature of the client.
270
271If the option B<SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION> is set then
272renegotiation B<always> succeeds.
273
274B<NB:> a bug in OpenSSL clients earlier than 0.9.8m (all of which are
275unpatched) will result in the connection hanging if it receives a
276B<no_renegotiation> alert. OpenSSL versions 0.9.8m and later will regard
277a B<no_renegotiation> alert as fatal and respond with a fatal
278B<handshake_failure> alert. This is because the OpenSSL API currently has
279no provision to indicate to an application that a renegotiation attempt
280was refused.
281
282=head2 Patched OpenSSL client and unpatched server.
283
284If the option B<SSL_OP_LEGACY_SERVER_CONNECT> or
285B<SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION> is set then initial connections
286and renegotiation between patched OpenSSL clients and unpatched servers
287succeeds. If neither option is set then initial connections to unpatched
288servers will fail.
289
290The option B<SSL_OP_LEGACY_SERVER_CONNECT> is currently set by default even
291though it has security implications: otherwise it would be impossible to
292connect to unpatched servers (i.e. all of them initially) and this is clearly
293not acceptable. Renegotiation is permitted because this does not add any
294additional security issues: during an attack clients do not see any
295renegotiations anyway.
296
297As more servers become patched the option B<SSL_OP_LEGACY_SERVER_CONNECT> will
298B<not> be set by default in a future version of OpenSSL.
299
300OpenSSL client applications wishing to ensure they can connect to unpatched
301servers should always B<set> B<SSL_OP_LEGACY_SERVER_CONNECT>
302
303OpenSSL client applications that want to ensure they can B<not> connect to
304unpatched servers (and thus avoid any security issues) should always B<clear>
305B<SSL_OP_LEGACY_SERVER_CONNECT> using SSL_CTX_clear_options() or
306SSL_clear_options().
307
308The difference between the B<SSL_OP_LEGACY_SERVER_CONNECT> and
309B<SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION> options is that
310B<SSL_OP_LEGACY_SERVER_CONNECT> enables initial connections and secure
311renegotiation between OpenSSL clients and unpatched servers B<only>, while
312B<SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION> allows initial connections
313and renegotiation between OpenSSL and unpatched clients or servers.
314
215=head1 RETURN VALUES 315=head1 RETURN VALUES
216 316
217SSL_CTX_set_options() and SSL_set_options() return the new options bitmask 317SSL_CTX_set_options() and SSL_set_options() return the new options bitmask
218after adding B<options>. 318after adding B<options>.
219 319
320SSL_CTX_clear_options() and SSL_clear_options() return the new options bitmask
321after clearing B<options>.
322
220SSL_CTX_get_options() and SSL_get_options() return the current bitmask. 323SSL_CTX_get_options() and SSL_get_options() return the current bitmask.
221 324
325SSL_get_secure_renegotiation_support() returns 1 is the peer supports
326secure renegotiation and 0 if it does not.
327
222=head1 SEE ALSO 328=head1 SEE ALSO
223 329
224L<ssl(3)|ssl(3)>, L<SSL_new(3)|SSL_new(3)>, L<SSL_clear(3)|SSL_clear(3)>, 330L<ssl(3)|ssl(3)>, L<SSL_new(3)|SSL_new(3)>, L<SSL_clear(3)|SSL_clear(3)>,
@@ -241,4 +347,11 @@ Versions up to OpenSSL 0.9.6c do not include the countermeasure that
241can be disabled with this option (in OpenSSL 0.9.6d, it was always 347can be disabled with this option (in OpenSSL 0.9.6d, it was always
242enabled). 348enabled).
243 349
350SSL_CTX_clear_options() and SSL_clear_options() were first added in OpenSSL
3510.9.8m.
352
353B<SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION>, B<SSL_OP_LEGACY_SERVER_CONNECT>
354and the function SSL_get_secure_renegotiation_support() were first added in
355OpenSSL 0.9.8m.
356
244=cut 357=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_ssl_version.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_ssl_version.pod
index 0020180965..254f2b4397 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_ssl_version.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_ssl_version.pod
@@ -9,9 +9,9 @@ SSL_CTX_set_ssl_version, SSL_set_ssl_method, SSL_get_ssl_method
9 9
10 #include <openssl/ssl.h> 10 #include <openssl/ssl.h>
11 11
12 int SSL_CTX_set_ssl_version(SSL_CTX *ctx, SSL_METHOD *method); 12 int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *method);
13 int SSL_set_ssl_method(SSL *s, SSL_METHOD *method); 13 int SSL_set_ssl_method(SSL *s, const SSL_METHOD *method);
14 SSL_METHOD *SSL_get_ssl_method(SSL *ssl); 14 const SSL_METHOD *SSL_get_ssl_method(SSL *ssl);
15 15
16=head1 DESCRIPTION 16=head1 DESCRIPTION
17 17
diff --git a/src/lib/libssl/src/doc/ssl/SSL_library_init.pod b/src/lib/libssl/src/doc/ssl/SSL_library_init.pod
index ecf3c4858e..8766776fea 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_library_init.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_library_init.pod
@@ -15,7 +15,7 @@ SSL_library_init, OpenSSL_add_ssl_algorithms, SSLeay_add_ssl_algorithms
15 15
16=head1 DESCRIPTION 16=head1 DESCRIPTION
17 17
18SSL_library_init() registers the available ciphers and digests. 18SSL_library_init() registers the available SSL/TLS ciphers and digests.
19 19
20OpenSSL_add_ssl_algorithms() and SSLeay_add_ssl_algorithms() are synonyms 20OpenSSL_add_ssl_algorithms() and SSLeay_add_ssl_algorithms() are synonyms
21for SSL_library_init(). 21for SSL_library_init().
@@ -23,27 +23,32 @@ for SSL_library_init().
23=head1 NOTES 23=head1 NOTES
24 24
25SSL_library_init() must be called before any other action takes place. 25SSL_library_init() must be called before any other action takes place.
26SSL_library_init() is not reentrant.
26 27
27=head1 WARNING 28=head1 WARNING
28 29
29SSL_library_init() only registers ciphers. Another important initialization 30SSL_library_init() adds ciphers and digests used directly and indirectly by
30is the seeding of the PRNG (Pseudo Random Number Generator), which has to 31SSL/TLS.
31be performed separately.
32 32
33=head1 EXAMPLES 33=head1 EXAMPLES
34 34
35A typical TLS/SSL application will start with the library initialization, 35A typical TLS/SSL application will start with the library initialization,
36will provide readable error messages and will seed the PRNG. 36and provide readable error messages.
37 37
38 SSL_load_error_strings(); /* readable error messages */ 38 SSL_load_error_strings(); /* readable error messages */
39 SSL_library_init(); /* initialize library */ 39 SSL_library_init(); /* initialize library */
40 actions_to_seed_PRNG();
41 40
42=head1 RETURN VALUES 41=head1 RETURN VALUES
43 42
44SSL_library_init() always returns "1", so it is safe to discard the return 43SSL_library_init() always returns "1", so it is safe to discard the return
45value. 44value.
46 45
46=head1 NOTES
47
48OpenSSL 0.9.8o and 1.0.0a and later added SHA2 algorithms to SSL_library_init().
49Applications which need to use SHA2 in earlier versions of OpenSSL should call
50OpenSSL_add_all_algorithms() as well.
51
47=head1 SEE ALSO 52=head1 SEE ALSO
48 53
49L<ssl(3)|ssl(3)>, L<SSL_load_error_strings(3)|SSL_load_error_strings(3)>, 54L<ssl(3)|ssl(3)>, L<SSL_load_error_strings(3)|SSL_load_error_strings(3)>,
diff --git a/src/lib/libssl/src/doc/ssl/ssl.pod b/src/lib/libssl/src/doc/ssl/ssl.pod
index 266697d221..2b6004ee32 100644
--- a/src/lib/libssl/src/doc/ssl/ssl.pod
+++ b/src/lib/libssl/src/doc/ssl/ssl.pod
@@ -130,39 +130,39 @@ protocol methods defined in B<SSL_METHOD> structures.
130 130
131=over 4 131=over 4
132 132
133=item SSL_METHOD *B<SSLv2_client_method>(void); 133=item const SSL_METHOD *B<SSLv2_client_method>(void);
134 134
135Constructor for the SSLv2 SSL_METHOD structure for a dedicated client. 135Constructor for the SSLv2 SSL_METHOD structure for a dedicated client.
136 136
137=item SSL_METHOD *B<SSLv2_server_method>(void); 137=item const SSL_METHOD *B<SSLv2_server_method>(void);
138 138
139Constructor for the SSLv2 SSL_METHOD structure for a dedicated server. 139Constructor for the SSLv2 SSL_METHOD structure for a dedicated server.
140 140
141=item SSL_METHOD *B<SSLv2_method>(void); 141=item const SSL_METHOD *B<SSLv2_method>(void);
142 142
143Constructor for the SSLv2 SSL_METHOD structure for combined client and server. 143Constructor for the SSLv2 SSL_METHOD structure for combined client and server.
144 144
145=item SSL_METHOD *B<SSLv3_client_method>(void); 145=item const SSL_METHOD *B<SSLv3_client_method>(void);
146 146
147Constructor for the SSLv3 SSL_METHOD structure for a dedicated client. 147Constructor for the SSLv3 SSL_METHOD structure for a dedicated client.
148 148
149=item SSL_METHOD *B<SSLv3_server_method>(void); 149=item const SSL_METHOD *B<SSLv3_server_method>(void);
150 150
151Constructor for the SSLv3 SSL_METHOD structure for a dedicated server. 151Constructor for the SSLv3 SSL_METHOD structure for a dedicated server.
152 152
153=item SSL_METHOD *B<SSLv3_method>(void); 153=item const SSL_METHOD *B<SSLv3_method>(void);
154 154
155Constructor for the SSLv3 SSL_METHOD structure for combined client and server. 155Constructor for the SSLv3 SSL_METHOD structure for combined client and server.
156 156
157=item SSL_METHOD *B<TLSv1_client_method>(void); 157=item const SSL_METHOD *B<TLSv1_client_method>(void);
158 158
159Constructor for the TLSv1 SSL_METHOD structure for a dedicated client. 159Constructor for the TLSv1 SSL_METHOD structure for a dedicated client.
160 160
161=item SSL_METHOD *B<TLSv1_server_method>(void); 161=item cosnt SSL_METHOD *B<TLSv1_server_method>(void);
162 162
163Constructor for the TLSv1 SSL_METHOD structure for a dedicated server. 163Constructor for the TLSv1 SSL_METHOD structure for a dedicated server.
164 164
165=item SSL_METHOD *B<TLSv1_method>(void); 165=item const SSL_METHOD *B<TLSv1_method>(void);
166 166
167Constructor for the TLSv1 SSL_METHOD structure for combined client and server. 167Constructor for the TLSv1 SSL_METHOD structure for combined client and server.
168 168
@@ -249,7 +249,7 @@ protocol context defined in the B<SSL_CTX> structure.
249 249
250=item long B<SSL_CTX_need_tmp_RSA>(SSL_CTX *ctx); 250=item long B<SSL_CTX_need_tmp_RSA>(SSL_CTX *ctx);
251 251
252=item SSL_CTX *B<SSL_CTX_new>(SSL_METHOD *meth); 252=item SSL_CTX *B<SSL_CTX_new>(const SSL_METHOD *meth);
253 253
254=item int B<SSL_CTX_remove_session>(SSL_CTX *ctx, SSL_SESSION *c); 254=item int B<SSL_CTX_remove_session>(SSL_CTX *ctx, SSL_SESSION *c);
255 255
@@ -327,7 +327,7 @@ protocol context defined in the B<SSL_CTX> structure.
327 327
328=item void B<SSL_CTX_set_session_cache_mode>(SSL_CTX *ctx, int mode); 328=item void B<SSL_CTX_set_session_cache_mode>(SSL_CTX *ctx, int mode);
329 329
330=item int B<SSL_CTX_set_ssl_version>(SSL_CTX *ctx, SSL_METHOD *meth); 330=item int B<SSL_CTX_set_ssl_version>(SSL_CTX *ctx, const SSL_METHOD *meth);
331 331
332=item void B<SSL_CTX_set_timeout>(SSL_CTX *ctx, long t); 332=item void B<SSL_CTX_set_timeout>(SSL_CTX *ctx, long t);
333 333
@@ -374,6 +374,15 @@ session instead of a context.
374 374
375=item int B<SSL_CTX_use_certificate_file>(SSL_CTX *ctx, char *file, int type); 375=item int B<SSL_CTX_use_certificate_file>(SSL_CTX *ctx, char *file, int type);
376 376
377=item void B<SSL_CTX_set_psk_client_callback>(SSL_CTX *ctx, unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len));
378
379=item int B<SSL_CTX_use_psk_identity_hint>(SSL_CTX *ctx, const char *hint);
380
381=item void B<SSL_CTX_set_psk_server_callback>(SSL_CTX *ctx, unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len));
382
383
384
385
377=back 386=back
378 387
379=head2 DEALING WITH SESSIONS 388=head2 DEALING WITH SESSIONS
@@ -512,7 +521,7 @@ connection defined in the B<SSL> structure.
512 521
513=item int B<SSL_get_shutdown>(const SSL *ssl); 522=item int B<SSL_get_shutdown>(const SSL *ssl);
514 523
515=item SSL_METHOD *B<SSL_get_ssl_method>(SSL *ssl); 524=item const SSL_METHOD *B<SSL_get_ssl_method>(SSL *ssl);
516 525
517=item int B<SSL_get_state>(const SSL *ssl); 526=item int B<SSL_get_state>(const SSL *ssl);
518 527
@@ -596,7 +605,7 @@ connection defined in the B<SSL> structure.
596 605
597=item void B<SSL_set_shutdown>(SSL *ssl, int mode); 606=item void B<SSL_set_shutdown>(SSL *ssl, int mode);
598 607
599=item int B<SSL_set_ssl_method>(SSL *ssl, SSL_METHOD *meth); 608=item int B<SSL_set_ssl_method>(SSL *ssl, const SSL_METHOD *meth);
600 609
601=item void B<SSL_set_time>(SSL *ssl, long t); 610=item void B<SSL_set_time>(SSL *ssl, long t);
602 611
@@ -650,6 +659,16 @@ connection defined in the B<SSL> structure.
650 659
651=item int B<SSL_write>(SSL *ssl, const void *buf, int num); 660=item int B<SSL_write>(SSL *ssl, const void *buf, int num);
652 661
662=item void B<SSL_set_psk_client_callback>(SSL *ssl, unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len));
663
664=item int B<SSL_use_psk_identity_hint>(SSL *ssl, const char *hint);
665
666=item void B<SSL_set_psk_server_callback>(SSL *ssl, unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len));
667
668=item const char *B<SSL_get_psk_identity_hint>(SSL *ssl);
669
670=item const char *B<SSL_get_psk_identity>(SSL *ssl);
671
653=back 672=back
654 673
655=head1 SEE ALSO 674=head1 SEE ALSO
@@ -726,7 +745,10 @@ L<SSL_write(3)|SSL_write(3)>,
726L<SSL_SESSION_free(3)|SSL_SESSION_free(3)>, 745L<SSL_SESSION_free(3)|SSL_SESSION_free(3)>,
727L<SSL_SESSION_get_ex_new_index(3)|SSL_SESSION_get_ex_new_index(3)>, 746L<SSL_SESSION_get_ex_new_index(3)|SSL_SESSION_get_ex_new_index(3)>,
728L<SSL_SESSION_get_time(3)|SSL_SESSION_get_time(3)>, 747L<SSL_SESSION_get_time(3)|SSL_SESSION_get_time(3)>,
729L<d2i_SSL_SESSION(3)|d2i_SSL_SESSION(3)> 748L<d2i_SSL_SESSION(3)|d2i_SSL_SESSION(3)>,
749L<SSL_CTX_set_psk_client_callback(3)|SSL_CTX_set_psk_client_callback(3)>,
750L<SSL_CTX_use_psk_identity_hint(3)|SSL_CTX_use_psk_identity_hint(3)>,
751L<SSL_get_psk_identity(3)|SSL_get_psk_identity(3)>
730 752
731=head1 HISTORY 753=head1 HISTORY
732 754
diff --git a/src/lib/libssl/src/doc/ssleay.txt b/src/lib/libssl/src/doc/ssleay.txt
index a8b04d7059..4d2e714868 100644
--- a/src/lib/libssl/src/doc/ssleay.txt
+++ b/src/lib/libssl/src/doc/ssleay.txt
@@ -20,7 +20,7 @@ don't do that.
20==== readme ======================================================== 20==== readme ========================================================
21 21
22This is the old 0.6.6 docuementation. Most of the cipher stuff is still 22This is the old 0.6.6 docuementation. Most of the cipher stuff is still
23relevent but I'm working (very slowly) on new docuemtation. 23relevent but I'm working (very slowly) on new documentation.
24The current version can be found online at 24The current version can be found online at
25 25
26http://www.cryptsoft.com/ssleay/doc 26http://www.cryptsoft.com/ssleay/doc
@@ -548,8 +548,8 @@ application, ssleay. This one program is composed of many programs that
548can all be compiled independantly. 548can all be compiled independantly.
549 549
550ssleay has 3 modes of operation. 550ssleay has 3 modes of operation.
5511) If the ssleay binaray has the name of one of its component programs, it 5511) If the ssleay binary has the name of one of its component programs, it
552executes that program and then exits. This can be achieve by using hard or 552executes that program and then exits. This can be achieved by using hard or
553symbolic links, or failing that, just renaming the binary. 553symbolic links, or failing that, just renaming the binary.
5542) If the first argument to ssleay is the name of one of the component 5542) If the first argument to ssleay is the name of one of the component
555programs, that program runs that program and then exits. 555programs, that program runs that program and then exits.
@@ -1185,7 +1185,7 @@ typedef struct bio_st
1185 example is for BIO_s_sock(). A socket needs to be 1185 example is for BIO_s_sock(). A socket needs to be
1186 assigned to the BIO before it can be used. 1186 assigned to the BIO before it can be used.
1187- 'shutdown', this flag indicates if the underlying 1187- 'shutdown', this flag indicates if the underlying
1188 comunication primative being used should be closed/freed 1188 communication primitive being used should be closed/freed
1189 when the BIO is closed. 1189 when the BIO is closed.
1190- 'flags' is used to hold extra state. It is primarily used 1190- 'flags' is used to hold extra state. It is primarily used
1191 to hold information about why a non-blocking operation 1191 to hold information about why a non-blocking operation
@@ -1799,7 +1799,7 @@ int BN_set_word(BIGNUM *a, unsigned long w);
1799 1799
1800unsigned long BN_get_word(BIGNUM *a); 1800unsigned long BN_get_word(BIGNUM *a);
1801 Returns 'a' in an unsigned long. Not remarkably, often 'a' will 1801 Returns 'a' in an unsigned long. Not remarkably, often 'a' will
1802 be biger than a word, in which case 0xffffffffL is returned. 1802 be bigger than a word, in which case 0xffffffffL is returned.
1803 1803
1804Word Operations 1804Word Operations
1805These functions are much more efficient that the normal bignum arithmetic 1805These functions are much more efficient that the normal bignum arithmetic
@@ -2058,7 +2058,7 @@ Now you will notice that macros like
2058 PEM_ASN1_write((int (*)())i2d_X509,PEM_STRING_X509,fp, \ 2058 PEM_ASN1_write((int (*)())i2d_X509,PEM_STRING_X509,fp, \
2059 (char *)x, NULL,NULL,0,NULL) 2059 (char *)x, NULL,NULL,0,NULL)
2060Don't do encryption normally. If you want to PEM encrypt your X509 structure, 2060Don't do encryption normally. If you want to PEM encrypt your X509 structure,
2061either just call PEM_ASN1_write directly or just define you own 2061either just call PEM_ASN1_write directly or just define your own
2062macro variant. As you can see, this macro just sets all encryption related 2062macro variant. As you can see, this macro just sets all encryption related
2063parameters to NULL. 2063parameters to NULL.
2064 2064
@@ -5566,7 +5566,7 @@ These 2 functions create and destroy SSL_CTX structures
5566 5566
5567The SSL_CTX has a session_cache_mode which is by default, 5567The SSL_CTX has a session_cache_mode which is by default,
5568in SSL_SESS_CACHE_SERVER mode. What this means is that the library 5568in SSL_SESS_CACHE_SERVER mode. What this means is that the library
5569will automatically add new session-id's to the cache apon sucsessful 5569will automatically add new session-id's to the cache upon successful
5570SSL_accept() calls. 5570SSL_accept() calls.
5571If SSL_SESS_CACHE_CLIENT is set, then client certificates are also added 5571If SSL_SESS_CACHE_CLIENT is set, then client certificates are also added
5572to the cache. 5572to the cache.
@@ -5580,12 +5580,12 @@ SSL_SESS_NO_CACHE_BOTH - Either SSL_accept() or SSL_connect().
5580If SSL_SESS_CACHE_NO_AUTO_CLEAR is set, old timed out sessions are 5580If SSL_SESS_CACHE_NO_AUTO_CLEAR is set, old timed out sessions are
5581not automatically removed each 255, SSL_connect()s or SSL_accept()s. 5581not automatically removed each 255, SSL_connect()s or SSL_accept()s.
5582 5582
5583By default, apon every 255 successful SSL_connect() or SSL_accept()s, 5583By default, upon every 255 successful SSL_connect() or SSL_accept()s,
5584the cache is flush. Please note that this could be expensive on 5584the cache is flush. Please note that this could be expensive on
5585a heavily loaded SSL server, in which case, turn this off and 5585a heavily loaded SSL server, in which case, turn this off and
5586clear the cache of old entries 'manually' (with one of the functions 5586clear the cache of old entries 'manually' (with one of the functions
5587listed below) every few hours. Perhaps I should up this number, it is hard 5587listed below) every few hours. Perhaps I should up this number, it is hard
5588to say. Remember, the '255' new calls is just a mechanims to get called 5588to say. Remember, the '255' new calls is just a mechanism to get called
5589every now and then, in theory at most 255 new session-id's will have been 5589every now and then, in theory at most 255 new session-id's will have been
5590added but if 100 are added every minute, you would still have 5590added but if 100 are added every minute, you would still have
5591500 in the cache before any would start being flushed (assuming a 3 minute 5591500 in the cache before any would start being flushed (assuming a 3 minute
@@ -5628,10 +5628,10 @@ if copy is 1. Otherwise, the reference count is not modified.
5628void SSL_CTX_sess_set_get_cb(ctx,cb) sets the callback and 5628void SSL_CTX_sess_set_get_cb(ctx,cb) sets the callback and
5629int (*cb)()SSL_CTX_sess_get_get_cb(ctx) returns the callback. 5629int (*cb)()SSL_CTX_sess_get_get_cb(ctx) returns the callback.
5630 5630
5631These callbacks are basically indended to be used by processes to 5631These callbacks are basically intended to be used by processes to
5632send their session-id's to other processes. I currently have not implemented 5632send their session-id's to other processes. I currently have not implemented
5633non-blocking semantics for these callbacks, it is upto the appication 5633non-blocking semantics for these callbacks, it is upto the application
5634to make the callbacks effiecent if they require blocking (perhaps 5634to make the callbacks efficient if they require blocking (perhaps
5635by 'saving' them and then 'posting them' when control returns from 5635by 'saving' them and then 'posting them' when control returns from
5636the SSL_accept(). 5636the SSL_accept().
5637 5637
@@ -6589,7 +6589,7 @@ This information can be used to recall the functions when the 'error'
6589condition has dissapeared. 6589condition has dissapeared.
6590 6590
6591After the connection has been made, information can be retrived about the 6591After the connection has been made, information can be retrived about the
6592SSL session and the session-id values that have been decided apon. 6592SSL session and the session-id values that have been decided upon.
6593The 'peer' certificate can be retrieved. 6593The 'peer' certificate can be retrieved.
6594 6594
6595The session-id values include 6595The session-id values include
diff --git a/src/lib/libssl/src/doc/standards.txt b/src/lib/libssl/src/doc/standards.txt
index a5ce778f8e..7bada8d35f 100644
--- a/src/lib/libssl/src/doc/standards.txt
+++ b/src/lib/libssl/src/doc/standards.txt
@@ -69,6 +69,10 @@ PKCS#12: Personal Information Exchange Syntax Standard, version 1.0.
693174 US Secure Hash Algorithm 1 (SHA1). D. Eastlake 3rd, P. Jones. 693174 US Secure Hash Algorithm 1 (SHA1). D. Eastlake 3rd, P. Jones.
70 September 2001. (Format: TXT=35525 bytes) (Status: INFORMATIONAL) 70 September 2001. (Format: TXT=35525 bytes) (Status: INFORMATIONAL)
71 71
723161 Internet X.509 Public Key Infrastructure, Time-Stamp Protocol (TSP)
73 C. Adams, P. Cain, D. Pinkas, R. Zuccherato. August 2001
74 (Status: PROPOSED STANDARD)
75
723268 Advanced Encryption Standard (AES) Ciphersuites for Transport 763268 Advanced Encryption Standard (AES) Ciphersuites for Transport
73 Layer Security (TLS). P. Chown. June 2002. (Format: TXT=13530 bytes) 77 Layer Security (TLS). P. Chown. June 2002. (Format: TXT=13530 bytes)
74 (Status: PROPOSED STANDARD) 78 (Status: PROPOSED STANDARD)