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/README2
-rw-r--r--src/lib/libssl/src/doc/apps/CA.pl.pod11
-rw-r--r--src/lib/libssl/src/doc/apps/ca.pod9
-rw-r--r--src/lib/libssl/src/doc/apps/ciphers.pod8
-rw-r--r--src/lib/libssl/src/doc/apps/dgst.pod67
-rw-r--r--src/lib/libssl/src/doc/apps/dhparam.pod2
-rw-r--r--src/lib/libssl/src/doc/apps/dsaparam.pod2
-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/openssl.pod19
-rw-r--r--src/lib/libssl/src/doc/apps/passwd.pod13
-rw-r--r--src/lib/libssl/src/doc/apps/pkcs12.pod2
-rw-r--r--src/lib/libssl/src/doc/apps/rand.pod2
-rw-r--r--src/lib/libssl/src/doc/apps/req.pod10
-rw-r--r--src/lib/libssl/src/doc/apps/rsa.pod31
-rw-r--r--src/lib/libssl/src/doc/apps/rsautl.pod183
-rw-r--r--src/lib/libssl/src/doc/apps/s_client.pod8
-rw-r--r--src/lib/libssl/src/doc/apps/s_server.pod8
-rw-r--r--src/lib/libssl/src/doc/apps/smime.pod57
-rw-r--r--src/lib/libssl/src/doc/apps/speed.pod14
-rw-r--r--src/lib/libssl/src/doc/apps/verify.pod63
-rw-r--r--src/lib/libssl/src/doc/apps/x509.pod176
-rw-r--r--src/lib/libssl/src/doc/c-indentation.el5
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_ctrl.pod128
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_f_base64.pod82
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_f_buffer.pod69
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_f_cipher.pod76
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_f_md.pod138
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_f_null.pod32
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_f_ssl.pod313
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_find_type.pod98
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_new.pod65
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_new_bio_pair.pod102
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_push.pod69
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_read.pod66
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_s_accept.pod184
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_s_bio.pod130
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_s_connect.pod182
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_s_fd.pod89
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_s_file.pod144
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_s_mem.pod115
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_s_null.pod37
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_s_socket.pod61
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_set_callback.pod108
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_should_retry.pod114
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_CTX_start.pod3
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_bn2bin.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_mod_mul_montgomery.pod4
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_mod_mul_reciprocal.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_zero.pod3
-rw-r--r--src/lib/libssl/src/doc/crypto/DH_set_method.pod62
-rw-r--r--src/lib/libssl/src/doc/crypto/DSA_set_method.pod58
-rw-r--r--src/lib/libssl/src/doc/crypto/ERR_error_string.pod16
-rw-r--r--src/lib/libssl/src/doc/crypto/ERR_get_error.pod5
-rw-r--r--src/lib/libssl/src/doc/crypto/ERR_remove_state.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod15
-rw-r--r--src/lib/libssl/src/doc/crypto/EVP_EncryptInit.pod199
-rw-r--r--src/lib/libssl/src/doc/crypto/EVP_OpenInit.pod28
-rw-r--r--src/lib/libssl/src/doc/crypto/EVP_SealInit.pod18
-rw-r--r--src/lib/libssl/src/doc/crypto/EVP_SignInit.pod6
-rw-r--r--src/lib/libssl/src/doc/crypto/EVP_VerifyInit.pod15
-rw-r--r--src/lib/libssl/src/doc/crypto/OPENSSL_VERSION_NUMBER.pod46
-rw-r--r--src/lib/libssl/src/doc/crypto/OpenSSL_add_all_algorithms.pod5
-rw-r--r--src/lib/libssl/src/doc/crypto/RAND_egd.pod4
-rw-r--r--src/lib/libssl/src/doc/crypto/RSA_get_ex_new_index.pod14
-rw-r--r--src/lib/libssl/src/doc/crypto/RSA_print.pod5
-rw-r--r--src/lib/libssl/src/doc/crypto/RSA_public_encrypt.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/RSA_set_method.pod60
-rw-r--r--src/lib/libssl/src/doc/crypto/bio.pod54
-rw-r--r--src/lib/libssl/src/doc/crypto/blowfish.pod39
-rw-r--r--src/lib/libssl/src/doc/crypto/bn_internal.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/buffer.pod6
-rw-r--r--src/lib/libssl/src/doc/crypto/crypto.pod12
-rw-r--r--src/lib/libssl/src/doc/crypto/des.pod10
-rw-r--r--src/lib/libssl/src/doc/crypto/des_modes.pod8
-rw-r--r--src/lib/libssl/src/doc/crypto/dh.pod9
-rw-r--r--src/lib/libssl/src/doc/crypto/dsa.pod9
-rw-r--r--src/lib/libssl/src/doc/crypto/err.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/evp.pod37
-rw-r--r--src/lib/libssl/src/doc/crypto/hmac.pod3
-rw-r--r--src/lib/libssl/src/doc/crypto/lhash.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/md5.pod46
-rw-r--r--src/lib/libssl/src/doc/crypto/rsa.pod11
-rw-r--r--src/lib/libssl/src/doc/crypto/threads.pod92
-rw-r--r--src/lib/libssl/src/doc/openssl.txt59
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CIPHER_get_name.pod57
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_free.pod29
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_new.pod93
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_set_cipher_list.pod52
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_set_ssl_version.pod60
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_SESSION_free.pod25
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_accept.pod72
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_clear.pod39
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_connect.pod69
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_free.pod33
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_get_ciphers.pod42
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_get_current_cipher.pod43
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_get_error.pod26
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_get_fd.pod44
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_get_peer_cert_chain.pod52
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_get_peer_certificate.pod48
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_get_rbio.pod40
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_get_session.pod48
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_get_verify_result.pod57
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_library_init.pod52
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_new.pod42
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_pending.pod30
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_read.pod77
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_set_bio.pod34
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_set_fd.pod54
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_set_session.pod45
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_set_verify_result.pod38
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_shutdown.pod62
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_write.pod76
-rw-r--r--src/lib/libssl/src/doc/ssl/ssl.pod22
-rw-r--r--src/lib/libssl/src/doc/standards.txt121
116 files changed, 5362 insertions, 293 deletions
diff --git a/src/lib/libssl/src/doc/README b/src/lib/libssl/src/doc/README
index 14469a82e3..6ecc14d994 100644
--- a/src/lib/libssl/src/doc/README
+++ b/src/lib/libssl/src/doc/README
@@ -4,6 +4,8 @@
4 ssl/ssl.pod ......... Documentation of OpenSSL ssl.h+libssl.a 4 ssl/ssl.pod ......... Documentation of OpenSSL ssl.h+libssl.a
5 openssl.txt ......... Assembled documentation files for OpenSSL [not final] 5 openssl.txt ......... Assembled documentation files for OpenSSL [not final]
6 ssleay.txt .......... Assembled documentation of ancestor SSLeay [obsolete] 6 ssleay.txt .......... Assembled documentation of ancestor SSLeay [obsolete]
7 standards.txt ....... Assembled pointers to standards, RFCs or internet drafts
8 that are related to OpenSSL.
7 9
8 An archive of HTML documents for the SSLeay library is available from 10 An archive of HTML documents for the SSLeay library is available from
9 http://www.columbia.edu/~ariel/ssleay/ 11 http://www.columbia.edu/~ariel/ssleay/
diff --git a/src/lib/libssl/src/doc/apps/CA.pl.pod b/src/lib/libssl/src/doc/apps/CA.pl.pod
index 9d287f0c4d..63cd1320cc 100644
--- a/src/lib/libssl/src/doc/apps/CA.pl.pod
+++ b/src/lib/libssl/src/doc/apps/CA.pl.pod
@@ -69,9 +69,16 @@ list box), otherwise the name "My Certificate" is used.
69 69
70calls the B<ca> program to sign a certificate request. It expects the request 70calls the B<ca> program to sign a certificate request. It expects the request
71to be in the file "newreq.pem". The new certificate is written to the file 71to be in the file "newreq.pem". The new certificate is written to the file
72"newcert.pem" except in the case of the B<-xcert> option when it is written 72"newcert.pem" except in the case of the B<-xsign> option when it is written
73to standard output. 73to standard output.
74 74
75
76=item B<-signCA>
77
78this option is the same as the B<-signreq> option except it uses the configuration
79file section B<v3_ca> and so makes the signed request a valid CA certificate. This
80is useful when creating intermediate CA from a root CA.
81
75=item B<-signcert> 82=item B<-signcert>
76 83
77this option is the same as B<-sign> except it expects a self signed certificate 84this option is the same as B<-sign> except it expects a self signed certificate
@@ -122,7 +129,7 @@ Create the CA directories and files:
122 129
123enter cacert.pem when prompted for the CA file name. 130enter cacert.pem when prompted for the CA file name.
124 131
125Create a DSA certificate request and privat key (a different set of parameters 132Create a DSA certificate request and private key (a different set of parameters
126can optionally be created first): 133can optionally be created first):
127 134
128 openssl req -out newreq.pem -newkey dsa:dsap.pem 135 openssl req -out newreq.pem -newkey dsa:dsap.pem
diff --git a/src/lib/libssl/src/doc/apps/ca.pod b/src/lib/libssl/src/doc/apps/ca.pod
index 03209aa6b1..d352925864 100644
--- a/src/lib/libssl/src/doc/apps/ca.pod
+++ b/src/lib/libssl/src/doc/apps/ca.pod
@@ -23,6 +23,7 @@ B<openssl> B<ca>
23[B<-policy arg>] 23[B<-policy arg>]
24[B<-keyfile arg>] 24[B<-keyfile arg>]
25[B<-key arg>] 25[B<-key arg>]
26[B<-passin arg>]
26[B<-cert file>] 27[B<-cert file>]
27[B<-in file>] 28[B<-in file>]
28[B<-out file>] 29[B<-out file>]
@@ -99,6 +100,10 @@ the password used to encrypt the private key. Since on some
99systems the command line arguments are visible (e.g. Unix with 100systems the command line arguments are visible (e.g. Unix with
100the 'ps' utility) this option should be used with caution. 101the 'ps' utility) this option should be used with caution.
101 102
103=item B<-passin arg>
104
105the key password source. For more information about the format of B<arg>
106see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>.
102=item B<-verbose> 107=item B<-verbose>
103 108
104this prints extra details about the operations being performed. 109this prints extra details about the operations being performed.
@@ -342,6 +347,10 @@ Sign a certificate request:
342 347
343 openssl ca -in req.pem -out newcert.pem 348 openssl ca -in req.pem -out newcert.pem
344 349
350Sign a certificate request, using CA extensions:
351
352 openssl ca -in req.pem -extensions v3_ca -out newcert.pem
353
345Generate a CRL 354Generate a CRL
346 355
347 openssl ca -gencrl -out crl.pem 356 openssl ca -gencrl -out crl.pem
diff --git a/src/lib/libssl/src/doc/apps/ciphers.pod b/src/lib/libssl/src/doc/apps/ciphers.pod
index 2301e28251..21077614a7 100644
--- a/src/lib/libssl/src/doc/apps/ciphers.pod
+++ b/src/lib/libssl/src/doc/apps/ciphers.pod
@@ -25,9 +25,13 @@ the appropriate cipherlist.
25 25
26=item B<-v> 26=item B<-v>
27 27
28verbose option. List ciphers with a complete description of the authentication, 28verbose option. List ciphers with a complete description of
29key exchange, encryption and mac algorithms used along with any key size 29protocol version (SSLv2 or SSLv3; the latter includes TLS), key exchange,
30authentication, encryption and mac algorithms used along with any key size
30restrictions and whether the algorithm is classed as an "export" cipher. 31restrictions and whether the algorithm is classed as an "export" cipher.
32Note that without the B<-v> option, ciphers may seem to appear twice
33in a cipher list; this is when similar ciphers are available for
34SSL v2 and for SSL v3/TLS v1.
31 35
32=item B<-ssl3> 36=item B<-ssl3>
33 37
diff --git a/src/lib/libssl/src/doc/apps/dgst.pod b/src/lib/libssl/src/doc/apps/dgst.pod
index fcfd3ecf23..1648742bcf 100644
--- a/src/lib/libssl/src/doc/apps/dgst.pod
+++ b/src/lib/libssl/src/doc/apps/dgst.pod
@@ -2,25 +2,32 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5dgst, md5, md2, sha1, sha, mdc2, ripemd160 - message digests 5dgst, md5, md4, md2, sha1, sha, mdc2, ripemd160 - message digests
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9B<openssl> B<dgst> 9B<openssl> B<dgst>
10[B<-md5|-md2|-sha1|-sha|mdc2|-ripemd160>] 10[B<-md5|-md4|-md2|-sha1|-sha|-mdc2|-ripemd160|-dss1>]
11[B<-c>] 11[B<-c>]
12[B<-d>] 12[B<-d>]
13[B<-hex>]
14[B<-binary>]
15[B<-out filename>]
16[B<-sign filename>]
17[B<-verify filename>]
18[B<-prverify filename>]
19[B<-signature filename>]
13[B<file...>] 20[B<file...>]
14 21
15[B<md5|md2|sha1|sha|mdc2|ripemd160>] 22[B<md5|md4|md2|sha1|sha|mdc2|ripemd160>]
16[B<-c>] 23[B<-c>]
17[B<-d>] 24[B<-d>]
18[B<file...>] 25[B<file...>]
19 26
20=head1 DESCRIPTION 27=head1 DESCRIPTION
21 28
22The digest functions print out the message digest of a supplied file or files 29The digest functions output the message digest of a supplied file or files
23in hexadecimal form. 30in hexadecimal form. They can also be used for digital signing and verification.
24 31
25=head1 OPTIONS 32=head1 OPTIONS
26 33
@@ -28,12 +35,51 @@ in hexadecimal form.
28 35
29=item B<-c> 36=item B<-c>
30 37
31print out the digest in two digit groups separated by colons. 38print out the digest in two digit groups separated by colons, only relevant if
39B<hex> format output is used.
32 40
33=item B<-d> 41=item B<-d>
34 42
35print out BIO debugging information. 43print out BIO debugging information.
36 44
45=item B<-hex>
46
47digest is to be output as a hex dump. This is the default case for a "normal"
48digest as opposed to a digital signature.
49
50=item B<-binary>
51
52output the digest or signature in binary form.
53
54=item B<-out filename>
55
56filename to output to, or standard output by default.
57
58=item B<-sign filename>
59
60digitally sign the digest using the private key in "filename".
61
62=item B<-verify filename>
63
64verify the signature using the the public key in "filename".
65The output is either "Verification OK" or "Verification Failure".
66
67=item B<-prverify filename>
68
69verify the signature using the the private key in "filename".
70
71=item B<-signature filename>
72
73the actual signature to verify.
74
75=item B<-rand file(s)>
76
77a file or files containing random data used to seed the random number
78generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>).
79Multiple files can be specified separated by a OS-dependent character.
80The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
81all others.
82
37=item B<file...> 83=item B<file...>
38 84
39file or files to digest. If no files are specified then standard input is 85file or files to digest. If no files are specified then standard input is
@@ -46,4 +92,13 @@ used.
46The digest of choice for all new applications is SHA1. Other digests are 92The digest of choice for all new applications is SHA1. Other digests are
47however still widely used. 93however still widely used.
48 94
95If you wish to sign or verify data using the DSA algorithm then the dss1
96digest must be used.
97
98A source of random numbers is required for certain signing algorithms, in
99particular DSA.
100
101The signing and verify options should only be used if a single file is
102being signed or verified.
103
49=cut 104=cut
diff --git a/src/lib/libssl/src/doc/apps/dhparam.pod b/src/lib/libssl/src/doc/apps/dhparam.pod
index 15aabf4ac8..ff8a6e5e5b 100644
--- a/src/lib/libssl/src/doc/apps/dhparam.pod
+++ b/src/lib/libssl/src/doc/apps/dhparam.pod
@@ -73,7 +73,7 @@ input file is ignored and parameters are generated instead.
73a file or files containing random data used to seed the random number 73a file or files containing random data used to seed the random number
74generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>). 74generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>).
75Multiple files can be specified separated by a OS-dependent character. 75Multiple files can be specified separated by a OS-dependent character.
76The separator is B<;> for MS-Windows, B<,> for OpenVSM, and B<:> for 76The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
77all others. 77all others.
78 78
79=item I<numbits> 79=item I<numbits>
diff --git a/src/lib/libssl/src/doc/apps/dsaparam.pod b/src/lib/libssl/src/doc/apps/dsaparam.pod
index 8647f34698..50c2f61242 100644
--- a/src/lib/libssl/src/doc/apps/dsaparam.pod
+++ b/src/lib/libssl/src/doc/apps/dsaparam.pod
@@ -73,7 +73,7 @@ parameters.
73a file or files containing random data used to seed the random number 73a file or files containing random data used to seed the random number
74generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>). 74generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>).
75Multiple files can be specified separated by a OS-dependent character. 75Multiple files can be specified separated by a OS-dependent character.
76The separator is B<;> for MS-Windows, B<,> for OpenVSM, and B<:> for 76The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
77all others. 77all others.
78 78
79=item B<numbits> 79=item B<numbits>
diff --git a/src/lib/libssl/src/doc/apps/gendsa.pod b/src/lib/libssl/src/doc/apps/gendsa.pod
index 3314ace517..74318fe7fb 100644
--- a/src/lib/libssl/src/doc/apps/gendsa.pod
+++ b/src/lib/libssl/src/doc/apps/gendsa.pod
@@ -34,7 +34,7 @@ If none of these options is specified no encryption is used.
34a file or files containing random data used to seed the random number 34a file or files containing random data used to seed the random number
35generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>). 35generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>).
36Multiple files can be specified separated by a OS-dependent character. 36Multiple files can be specified separated by a OS-dependent character.
37The separator is B<;> for MS-Windows, B<,> for OpenVSM, and B<:> for 37The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
38all others. 38all others.
39 39
40=item B<paramfile> 40=item B<paramfile>
diff --git a/src/lib/libssl/src/doc/apps/genrsa.pod b/src/lib/libssl/src/doc/apps/genrsa.pod
index 70d35fef0a..cdcc03c123 100644
--- a/src/lib/libssl/src/doc/apps/genrsa.pod
+++ b/src/lib/libssl/src/doc/apps/genrsa.pod
@@ -51,7 +51,7 @@ the public exponent to use, either 65537 or 3. The default is 65537.
51a file or files containing random data used to seed the random number 51a file or files containing random data used to seed the random number
52generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>). 52generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>).
53Multiple files can be specified separated by a OS-dependent character. 53Multiple files can be specified separated by a OS-dependent character.
54The separator is B<;> for MS-Windows, B<,> for OpenVSM, and B<:> for 54The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
55all others. 55all others.
56 56
57=item B<numbits> 57=item B<numbits>
diff --git a/src/lib/libssl/src/doc/apps/openssl.pod b/src/lib/libssl/src/doc/apps/openssl.pod
index 2fc61b6c21..0cbd199d79 100644
--- a/src/lib/libssl/src/doc/apps/openssl.pod
+++ b/src/lib/libssl/src/doc/apps/openssl.pod
@@ -83,9 +83,10 @@ CRL to PKCS#7 Conversion.
83 83
84Message Digest Calculation. 84Message Digest Calculation.
85 85
86=item L<B<dh>|dh(1)> 86=item B<dh>
87 87
88Diffie-Hellman Data Management. 88Diffie-Hellman Parameter Management.
89Obsoleted by L<B<dhparam>|dhparam(1)>.
89 90
90=item L<B<dsa>|dsa(1)> 91=item L<B<dsa>|dsa(1)>
91 92
@@ -103,9 +104,14 @@ Encoding with Ciphers.
103 104
104Error Number to Error String Conversion. 105Error Number to Error String Conversion.
105 106
106=item L<B<gendh>|gendh(1)> 107=item L<B<dhparam>|dhparam(1)>
108
109Generation and Management of Diffie-Hellman Parameters.
110
111=item B<gendh>
107 112
108Generation of Diffie-Hellman Parameters. 113Generation of Diffie-Hellman Parameters.
114Obsoleted by L<B<dhparam>|dhparam(1)>.
109 115
110=item L<B<gendsa>|gendsa(1)> 116=item L<B<gendsa>|gendsa(1)>
111 117
@@ -135,6 +141,10 @@ X.509 Certificate Signing Request (CSR) Management.
135 141
136RSA Data Management. 142RSA Data Management.
137 143
144=item L<B<rsautl>|rsautl(1)>
145
146RSA utility for signing, verification, encryption, and decryption.
147
138=item L<B<s_client>|s_client(1)> 148=item L<B<s_client>|s_client(1)>
139 149
140This implements a generic SSL/TLS client which can establish a transparent 150This implements a generic SSL/TLS client which can establish a transparent
@@ -309,7 +319,8 @@ L<enc(1)|enc(1)>, L<gendsa(1)|gendsa(1)>,
309L<genrsa(1)|genrsa(1)>, L<nseq(1)|nseq(1)>, L<openssl(1)|openssl(1)>, 319L<genrsa(1)|genrsa(1)>, L<nseq(1)|nseq(1)>, L<openssl(1)|openssl(1)>,
310L<passwd(1)|passwd(1)>, 320L<passwd(1)|passwd(1)>,
311L<pkcs12(1)|pkcs12(1)>, L<pkcs7(1)|pkcs7(1)>, L<pkcs8(1)|pkcs8(1)>, 321L<pkcs12(1)|pkcs12(1)>, L<pkcs7(1)|pkcs7(1)>, L<pkcs8(1)|pkcs8(1)>,
312L<rand(1)|rand(1)>, L<req(1)|req(1)>, L<rsa(1)|rsa(1)>, L<s_client(1)|s_client(1)>, 322L<rand(1)|rand(1)>, L<req(1)|req(1)>, L<rsa(1)|rsa(1)>,
323L<rsautl(1)|rsautl(1)>, L<s_client(1)|s_client(1)>,
313L<s_server(1)|s_server(1)>, L<smime(1)|smime(1)>, L<spkac(1)|spkac(1)>, 324L<s_server(1)|s_server(1)>, L<smime(1)|smime(1)>, L<spkac(1)|spkac(1)>,
314L<verify(1)|verify(1)>, L<version(1)|version(1)>, L<x509(1)|x509(1)>, 325L<verify(1)|verify(1)>, L<version(1)|version(1)>, L<x509(1)|x509(1)>,
315L<crypto(3)|crypto(3)>, L<ssl(3)|ssl(3)> 326L<crypto(3)|crypto(3)>, L<ssl(3)|ssl(3)>
diff --git a/src/lib/libssl/src/doc/apps/passwd.pod b/src/lib/libssl/src/doc/apps/passwd.pod
index cee6a2f172..6e098940c7 100644
--- a/src/lib/libssl/src/doc/apps/passwd.pod
+++ b/src/lib/libssl/src/doc/apps/passwd.pod
@@ -8,6 +8,7 @@ passwd - compute password hashes
8 8
9B<openssl passwd> 9B<openssl passwd>
10[B<-crypt>] 10[B<-crypt>]
11[B<-1>]
11[B<-apr1>] 12[B<-apr1>]
12[B<-salt> I<string>] 13[B<-salt> I<string>]
13[B<-in> I<file>] 14[B<-in> I<file>]
@@ -22,8 +23,8 @@ The B<passwd> command computes the hash of a password typed at
22run-time or the hash of each password in a list. The password list is 23run-time or the hash of each password in a list. The password list is
23taken from the named file for option B<-in file>, from stdin for 24taken from the named file for option B<-in file>, from stdin for
24option B<-stdin>, and from the command line otherwise. 25option B<-stdin>, and from the command line otherwise.
25The Unix standard algorithm B<crypt> and the MD5-based B<apr1> algorithm 26The Unix standard algorithm B<crypt> and the MD5-based BSD password
26are available. 27algorithm B<1> and its Apache variant B<apr1> are available.
27 28
28=head1 OPTIONS 29=head1 OPTIONS
29 30
@@ -33,9 +34,13 @@ are available.
33 34
34Use the B<crypt> algorithm (default). 35Use the B<crypt> algorithm (default).
35 36
37=item B<-1>
38
39Use the MD5 based BSD password algorithm B<1>.
40
36=item B<-apr1> 41=item B<-apr1>
37 42
38Use the B<apr1> algorithm. 43Use the B<apr1> algorithm (Apache variant of the BSD algorithm).
39 44
40=item B<-salt> I<string> 45=item B<-salt> I<string>
41 46
@@ -64,6 +69,8 @@ to each password hash.
64 69
65B<openssl passwd -crypt -salt xx password> prints B<xxj31ZMTZzkVA>. 70B<openssl passwd -crypt -salt xx password> prints B<xxj31ZMTZzkVA>.
66 71
72B<openssl passwd -1 -salt xxxxxxxx password> prints B<$1$xxxxxxxx$8XJIcl6ZXqBMCK0qFevqT1>.
73
67B<openssl passwd -apr1 -salt xxxxxxxx password> prints B<$apr1$xxxxxxxx$dxHfLAsjHkDRmG83UXe8K0>. 74B<openssl passwd -apr1 -salt xxxxxxxx password> prints B<$apr1$xxxxxxxx$dxHfLAsjHkDRmG83UXe8K0>.
68 75
69=cut 76=cut
diff --git a/src/lib/libssl/src/doc/apps/pkcs12.pod b/src/lib/libssl/src/doc/apps/pkcs12.pod
index 241f9c4a8b..c4009998b8 100644
--- a/src/lib/libssl/src/doc/apps/pkcs12.pod
+++ b/src/lib/libssl/src/doc/apps/pkcs12.pod
@@ -244,7 +244,7 @@ to be needed to use MAC iterations counts but they are now used by default.
244a file or files containing random data used to seed the random number 244a file or files containing random data used to seed the random number
245generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>). 245generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>).
246Multiple files can be specified separated by a OS-dependent character. 246Multiple files can be specified separated by a OS-dependent character.
247The separator is B<;> for MS-Windows, B<,> for OpenVSM, and B<:> for 247The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
248all others. 248all others.
249 249
250=back 250=back
diff --git a/src/lib/libssl/src/doc/apps/rand.pod b/src/lib/libssl/src/doc/apps/rand.pod
index f81eab0457..cbf8768801 100644
--- a/src/lib/libssl/src/doc/apps/rand.pod
+++ b/src/lib/libssl/src/doc/apps/rand.pod
@@ -34,7 +34,7 @@ Write to I<file> instead of standard output.
34Use specified file or files or EGD socket (see L<RAND_egd(3)|RAND_egd(3)>) 34Use specified file or files or EGD socket (see L<RAND_egd(3)|RAND_egd(3)>)
35for seeding the random number generator. 35for seeding the random number generator.
36Multiple files can be specified separated by a OS-dependent character. 36Multiple files can be specified separated by a OS-dependent character.
37The separator is B<;> for MS-Windows, B<,> for OpenVSM, and B<:> for 37The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
38all others. 38all others.
39 39
40=item B<-base64> 40=item B<-base64>
diff --git a/src/lib/libssl/src/doc/apps/req.pod b/src/lib/libssl/src/doc/apps/req.pod
index fde6ff2e9f..a3f54f45a3 100644
--- a/src/lib/libssl/src/doc/apps/req.pod
+++ b/src/lib/libssl/src/doc/apps/req.pod
@@ -19,6 +19,7 @@ B<openssl> B<req>
19[B<-verify>] 19[B<-verify>]
20[B<-modulus>] 20[B<-modulus>]
21[B<-new>] 21[B<-new>]
22[B<-rand file(s)>]
22[B<-newkey rsa:bits>] 23[B<-newkey rsa:bits>]
23[B<-newkey dsa:file>] 24[B<-newkey dsa:file>]
24[B<-nodes>] 25[B<-nodes>]
@@ -104,6 +105,14 @@ in the configuration file and any requested extensions.
104If the B<-key> option is not used it will generate a new RSA private 105If the B<-key> option is not used it will generate a new RSA private
105key using information specified in the configuration file. 106key using information specified in the configuration file.
106 107
108=item B<-rand file(s)>
109
110a file or files containing random data used to seed the random number
111generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>).
112Multiple files can be specified separated by a OS-dependent character.
113The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
114all others.
115
107=item B<-newkey arg> 116=item B<-newkey arg>
108 117
109this option creates a new certificate request and a new private 118this option creates a new certificate request and a new private
@@ -158,6 +167,7 @@ when the B<-x509> option is being used this specifies the number of
158days to certify the certificate for. The default is 30 days. 167days to certify the certificate for. The default is 30 days.
159 168
160=item B<-extensions section> 169=item B<-extensions section>
170
161=item B<-reqexts section> 171=item B<-reqexts section>
162 172
163these options specify alternative sections to include certificate 173these options specify alternative sections to include certificate
diff --git a/src/lib/libssl/src/doc/apps/rsa.pod b/src/lib/libssl/src/doc/apps/rsa.pod
index 62ad62e23d..f0e613ed05 100644
--- a/src/lib/libssl/src/doc/apps/rsa.pod
+++ b/src/lib/libssl/src/doc/apps/rsa.pod
@@ -14,6 +14,7 @@ B<openssl> B<rsa>
14[B<-passin arg>] 14[B<-passin arg>]
15[B<-out filename>] 15[B<-out filename>]
16[B<-passout arg>] 16[B<-passout arg>]
17[B<-sgckey>]
17[B<-des>] 18[B<-des>]
18[B<-des3>] 19[B<-des3>]
19[B<-idea>] 20[B<-idea>]
@@ -42,9 +43,8 @@ This specifies the input format. The B<DER> option uses an ASN1 DER encoded
42form compatible with the PKCS#1 RSAPrivateKey or SubjectPublicKeyInfo format. 43form compatible with the PKCS#1 RSAPrivateKey or SubjectPublicKeyInfo format.
43The B<PEM> form is the default format: it consists of the B<DER> format base64 44The B<PEM> form is the default format: it consists of the B<DER> format base64
44encoded with additional header and footer lines. On input PKCS#8 format private 45encoded with additional header and footer lines. On input PKCS#8 format private
45keys are also accepted. The B<NET> form is a format compatible with older Netscape 46keys are also accepted. The B<NET> form is a format is described in the B<NOTES>
46servers and MS IIS, this uses unsalted RC4 for its encryption. It is not very 47section.
47secure and so should only be used when necessary.
48 48
49=item B<-outform DER|NET|PEM> 49=item B<-outform DER|NET|PEM>
50 50
@@ -74,6 +74,11 @@ filename.
74the output file password source. For more information about the format of B<arg> 74the output file password source. For more information about the format of B<arg>
75see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>. 75see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>.
76 76
77=item B<-sgckey>
78
79use the modified NET algorithm used with some versions of Microsoft IIS and SGC
80keys.
81
77=item B<-des|-des3|-idea> 82=item B<-des|-des3|-idea>
78 83
79These options encrypt the private key with the DES, triple DES, or the 84These options encrypt the private key with the DES, triple DES, or the
@@ -126,6 +131,18 @@ The PEM public key format uses the header and footer lines:
126 -----BEGIN PUBLIC KEY----- 131 -----BEGIN PUBLIC KEY-----
127 -----END PUBLIC KEY----- 132 -----END PUBLIC KEY-----
128 133
134The B<NET> form is a format compatible with older Netscape servers
135and Microsoft IIS .key files, this uses unsalted RC4 for its encryption.
136It is not very secure and so should only be used when necessary.
137
138Some newer version of IIS have additional data in the exported .key
139files. To use thse with the utility view the file with a binary editor
140and look for the string "private-key", then trace back to the byte
141sequence 0x30, 0x82 (this is an ASN1 SEQUENCE). Copy all the data
142from this point onwards to another file and use that as the input
143to the B<rsa> utility with the B<-inform NET> option. If you get
144an error after entering the password try the B<-sgckey> option.
145
129=head1 EXAMPLES 146=head1 EXAMPLES
130 147
131To remove the pass phrase on an RSA private key: 148To remove the pass phrase on an RSA private key:
@@ -148,6 +165,14 @@ To just output the public part of a private key:
148 165
149 openssl rsa -in key.pem -pubout -out pubkey.pem 166 openssl rsa -in key.pem -pubout -out pubkey.pem
150 167
168=head1 BUGS
169
170The command line password arguments don't currently work with
171B<NET> format.
172
173There should be an option that automatically handles .key files,
174without having to manually edit them.
175
151=head1 SEE ALSO 176=head1 SEE ALSO
152 177
153L<pkcs8(1)|pkcs8(1)>, L<dsa(1)|dsa(1)>, L<genrsa(1)|genrsa(1)>, 178L<pkcs8(1)|pkcs8(1)>, L<dsa(1)|dsa(1)>, L<genrsa(1)|genrsa(1)>,
diff --git a/src/lib/libssl/src/doc/apps/rsautl.pod b/src/lib/libssl/src/doc/apps/rsautl.pod
new file mode 100644
index 0000000000..7a334bc8d6
--- /dev/null
+++ b/src/lib/libssl/src/doc/apps/rsautl.pod
@@ -0,0 +1,183 @@
1=pod
2
3=head1 NAME
4
5rsautl - RSA utility
6
7=head1 SYNOPSIS
8
9B<openssl> B<rsautl>
10[B<-in file>]
11[B<-out file>]
12[B<-inkey file>]
13[B<-pubin>]
14[B<-certin>]
15[B<-sign>]
16[B<-verify>]
17[B<-encrypt>]
18[B<-decrypt>]
19[B<-pkcs>]
20[B<-ssl>]
21[B<-raw>]
22[B<-hexdump>]
23[B<-asn1parse>]
24
25=head1 DESCRIPTION
26
27The B<rsautl> command can be used to sign, verify, encrypt and decrypt
28data using the RSA algorithm.
29
30=head1 COMMAND OPTIONS
31
32=over 4
33
34=item B<-in filename>
35
36This specifies the input filename to read data from or standard input
37if this option is not specified.
38
39=item B<-out filename>
40
41specifies the output filename to write to or standard output by
42default.
43
44=item B<-inkey file>
45
46the input key file, by default it should be an RSA private key.
47
48=item B<-pubin>
49
50the input file is an RSA public key.
51
52=item B<-certin>
53
54the input is a certificate containing an RSA public key.
55
56=item B<-sign>
57
58sign the input data and output the signed result. This requires
59and RSA private key.
60
61=item B<-verify>
62
63verify the input data and output the recovered data.
64
65=item B<-encrypt>
66
67encrypt the input data using an RSA public key.
68
69=item B<-decrypt>
70
71decrypt the input data using an RSA private key.
72
73=item B<-pkcs, -oaep, -ssl, -raw>
74
75the padding to use: PKCS#1 v1.5 (the default), PKCS#1 OAEP,
76special padding used in SSL v2 backwards compatible handshakes,
77or no padding, respectively.
78For signatures, only B<-pkcs> and B<-raw> can be used.
79
80=item B<-hexdump>
81
82hex dump the output data.
83
84=item B<-asn1parse>
85
86asn1parse the output data, this is useful when combined with the
87B<-verify> option.
88
89=back
90
91=head1 NOTES
92
93B<rsautl> because it uses the RSA algorithm directly can only be
94used to sign or verify small pieces of data.
95
96=head1 EXAMPLES
97
98Sign some data using a private key:
99
100 openssl rsautl -sign -in file -inkey key.pem -out sig
101
102Recover the signed data
103
104 openssl rsautl -sign -in sig -inkey key.pem
105
106Examine the raw signed data:
107
108 openssl rsautl -sign -in file -inkey key.pem -raw -hexdump
109
110 0000 - 00 01 ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................
111 0010 - ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................
112 0020 - ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................
113 0030 - ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................
114 0040 - ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................
115 0050 - ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................
116 0060 - ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................
117 0070 - ff ff ff ff 00 68 65 6c-6c 6f 20 77 6f 72 6c 64 .....hello world
118
119The PKCS#1 block formatting is evident from this. If this was done using
120encrypt and decrypt the block would have been of type 2 (the second byte)
121and random padding data visible instead of the 0xff bytes.
122
123It is possible to analyse the signature of certificates using this
124utility in conjunction with B<asn1parse>. Consider the self signed
125example in certs/pca-cert.pem . Running B<asn1parse> as follows yields:
126
127 openssl asn1parse -in pca-cert.pem
128
129 0:d=0 hl=4 l= 742 cons: SEQUENCE
130 4:d=1 hl=4 l= 591 cons: SEQUENCE
131 8:d=2 hl=2 l= 3 cons: cont [ 0 ]
132 10:d=3 hl=2 l= 1 prim: INTEGER :02
133 13:d=2 hl=2 l= 1 prim: INTEGER :00
134 16:d=2 hl=2 l= 13 cons: SEQUENCE
135 18:d=3 hl=2 l= 9 prim: OBJECT :md5WithRSAEncryption
136 29:d=3 hl=2 l= 0 prim: NULL
137 31:d=2 hl=2 l= 92 cons: SEQUENCE
138 33:d=3 hl=2 l= 11 cons: SET
139 35:d=4 hl=2 l= 9 cons: SEQUENCE
140 37:d=5 hl=2 l= 3 prim: OBJECT :countryName
141 42:d=5 hl=2 l= 2 prim: PRINTABLESTRING :AU
142 ....
143 599:d=1 hl=2 l= 13 cons: SEQUENCE
144 601:d=2 hl=2 l= 9 prim: OBJECT :md5WithRSAEncryption
145 612:d=2 hl=2 l= 0 prim: NULL
146 614:d=1 hl=3 l= 129 prim: BIT STRING
147
148
149The final BIT STRING contains the actual signature. It can be extracted with:
150
151 openssl asn1parse -in pca-cert.pem -out sig -noout -strparse 614
152
153The certificate public key can be extracted with:
154
155 openssl x509 -in test/testx509.pem -pubout -noout >pubkey.pem
156
157The signature can be analysed with:
158
159 openssl rsautl -in sig -verify -asn1parse -inkey pubkey.pem -pubin
160
161 0:d=0 hl=2 l= 32 cons: SEQUENCE
162 2:d=1 hl=2 l= 12 cons: SEQUENCE
163 4:d=2 hl=2 l= 8 prim: OBJECT :md5
164 14:d=2 hl=2 l= 0 prim: NULL
165 16:d=1 hl=2 l= 16 prim: OCTET STRING
166 0000 - f3 46 9e aa 1a 4a 73 c9-37 ea 93 00 48 25 08 b5 .F...Js.7...H%..
167
168This is the parsed version of an ASN1 DigestInfo structure. It can be seen that
169the digest used was md5. The actual part of the certificate that was signed can
170be extracted with:
171
172 openssl asn1parse -in pca-cert.pem -out tbs -noout -strparse 4
173
174and its digest computed with:
175
176 openssl md5 -c tbs
177 MD5(tbs)= f3:46:9e:aa:1a:4a:73:c9:37:ea:93:00:48:25:08:b5
178
179which it can be seen agrees with the recovered value above.
180
181=head1 SEE ALSO
182
183L<dgst(1)|dgst(1)>, L<rsa(1)|rsa(1)>, L<genrsa(1)|genrsa(1)>
diff --git a/src/lib/libssl/src/doc/apps/s_client.pod b/src/lib/libssl/src/doc/apps/s_client.pod
index 2f80375319..9df1c07fb7 100644
--- a/src/lib/libssl/src/doc/apps/s_client.pod
+++ b/src/lib/libssl/src/doc/apps/s_client.pod
@@ -32,6 +32,7 @@ B<openssl> B<s_client>
32[B<-no_tls1>] 32[B<-no_tls1>]
33[B<-bugs>] 33[B<-bugs>]
34[B<-cipher cipherlist>] 34[B<-cipher cipherlist>]
35[B<-engine id>]
35 36
36=head1 DESCRIPTION 37=head1 DESCRIPTION
37 38
@@ -156,6 +157,13 @@ the server determines which cipher suite is used it should take the first
156supported cipher in the list sent by the client. See the B<ciphers> 157supported cipher in the list sent by the client. See the B<ciphers>
157command for more information. 158command for more information.
158 159
160=item B<-engine id>
161
162specifying an engine (by it's unique B<id> string) will cause B<s_client>
163to attempt to obtain a functional reference to the specified engine,
164thus initialising it if needed. The engine will then be set as the default
165for all available algorithms.
166
159=back 167=back
160 168
161=head1 CONNECTED COMMANDS 169=head1 CONNECTED COMMANDS
diff --git a/src/lib/libssl/src/doc/apps/s_server.pod b/src/lib/libssl/src/doc/apps/s_server.pod
index 0f29c361d9..3a5bf46e28 100644
--- a/src/lib/libssl/src/doc/apps/s_server.pod
+++ b/src/lib/libssl/src/doc/apps/s_server.pod
@@ -39,6 +39,7 @@ B<openssl> B<s_client>
39[B<-hack>] 39[B<-hack>]
40[B<-www>] 40[B<-www>]
41[B<-WWW>] 41[B<-WWW>]
42[B<-engine id>]
42 43
43=head1 DESCRIPTION 44=head1 DESCRIPTION
44 45
@@ -186,6 +187,13 @@ emulates a simple web server. Pages will be resolved relative to the
186current directory, for example if the URL https://myhost/page.html is 187current directory, for example if the URL https://myhost/page.html is
187requested the file ./page.html will be loaded. 188requested the file ./page.html will be loaded.
188 189
190=item B<-engine id>
191
192specifying an engine (by it's unique B<id> string) will cause B<s_server>
193to attempt to obtain a functional reference to the specified engine,
194thus initialising it if needed. The engine will then be set as the default
195for all available algorithms.
196
189=back 197=back
190 198
191=head1 CONNECTED COMMANDS 199=head1 CONNECTED COMMANDS
diff --git a/src/lib/libssl/src/doc/apps/smime.pod b/src/lib/libssl/src/doc/apps/smime.pod
index 631ecdc241..ce99b5c345 100644
--- a/src/lib/libssl/src/doc/apps/smime.pod
+++ b/src/lib/libssl/src/doc/apps/smime.pod
@@ -22,8 +22,12 @@ B<openssl> B<smime>
22[B<-signer file>] 22[B<-signer file>]
23[B<-recip file>] 23[B<-recip file>]
24[B<-in file>] 24[B<-in file>]
25[B<-inform SMIME|PEM|DER>]
26[B<-passin arg>]
25[B<-inkey file>] 27[B<-inkey file>]
26[B<-out file>] 28[B<-out file>]
29[B<-outform SMIME|PEM|DER>]
30[B<-content file>]
27[B<-to addr>] 31[B<-to addr>]
28[B<-from ad>] 32[B<-from ad>]
29[B<-subject s>] 33[B<-subject s>]
@@ -74,11 +78,37 @@ takes an input message and writes out a PEM encoded PKCS#7 structure.
74the input message to be encrypted or signed or the MIME message to 78the input message to be encrypted or signed or the MIME message to
75be decrypted or verified. 79be decrypted or verified.
76 80
81=item B<-inform SMIME|PEM|DER>
82
83this specifies the input format for the PKCS#7 structure. The default
84is B<SMIME> which reads an S/MIME format message. B<PEM> and B<DER>
85format change this to expect PEM and DER format PKCS#7 structures
86instead. This currently only affects the input format of the PKCS#7
87structure, if no PKCS#7 structure is being input (for example with
88B<-encrypt> or B<-sign>) this option has no effect.
89
77=item B<-out filename> 90=item B<-out filename>
78 91
79the message text that has been decrypted or verified or the output MIME 92the message text that has been decrypted or verified or the output MIME
80format message that has been signed or verified. 93format message that has been signed or verified.
81 94
95=item B<-outform SMIME|PEM|DER>
96
97this specifies the output format for the PKCS#7 structure. The default
98is B<SMIME> which write an S/MIME format message. B<PEM> and B<DER>
99format change this to write PEM and DER format PKCS#7 structures
100instead. This currently only affects the output format of the PKCS#7
101structure, if no PKCS#7 structure is being output (for example with
102B<-verify> or B<-decrypt>) this option has no effect.
103
104=item B<-content filename>
105
106This specifies a file containing the detached content, this is only
107useful with the B<-verify> command. This is only usable if the PKCS#7
108structure is using the detached signature form where the content is
109not included. This option will override any content if the input format
110is S/MIME and it uses the multipart/signed MIME content type.
111
82=item B<-text> 112=item B<-text>
83 113
84this option adds plain text (text/plain) MIME headers to the supplied 114this option adds plain text (text/plain) MIME headers to the supplied
@@ -174,12 +204,17 @@ corresponding certificate. If this option is not specified then the
174private key must be included in the certificate file specified with 204private key must be included in the certificate file specified with
175the B<-recip> or B<-signer> file. 205the B<-recip> or B<-signer> file.
176 206
207=item B<-passin arg>
208
209the private key password source. For more information about the format of B<arg>
210see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>.
211
177=item B<-rand file(s)> 212=item B<-rand file(s)>
178 213
179a file or files containing random data used to seed the random number 214a file or files containing random data used to seed the random number
180generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>). 215generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>).
181Multiple files can be specified separated by a OS-dependent character. 216Multiple files can be specified separated by a OS-dependent character.
182The separator is B<;> for MS-Windows, B<,> for OpenVSM, and B<:> for 217The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
183all others. 218all others.
184 219
185=item B<cert.pem...> 220=item B<cert.pem...>
@@ -204,7 +239,7 @@ a blank line. Piping the mail directly to sendmail is one way to
204achieve the correct format. 239achieve the correct format.
205 240
206The supplied message to be signed or encrypted must include the 241The supplied message to be signed or encrypted must include the
207necessary MIME headers: or many S/MIME clients wont display it 242necessary MIME headers or many S/MIME clients wont display it
208properly (if at all). You can use the B<-text> option to automatically 243properly (if at all). You can use the B<-text> option to automatically
209add plain text headers. 244add plain text headers.
210 245
@@ -290,7 +325,7 @@ Send encrypted mail using triple DES:
290Sign and encrypt mail: 325Sign and encrypt mail:
291 326
292 openssl smime -sign -in ml.txt -signer my.pem -text \ 327 openssl smime -sign -in ml.txt -signer my.pem -text \
293 | openssl -encrypt -out mail.msg \ 328 | openssl smime -encrypt -out mail.msg \
294 -from steve@openssl.org -to someone@somewhere \ 329 -from steve@openssl.org -to someone@somewhere \
295 -subject "Signed and Encrypted message" -des3 user.pem 330 -subject "Signed and Encrypted message" -des3 user.pem
296 331
@@ -301,6 +336,22 @@ Decrypt mail:
301 336
302 openssl smime -decrypt -in mail.msg -recip mycert.pem -inkey key.pem 337 openssl smime -decrypt -in mail.msg -recip mycert.pem -inkey key.pem
303 338
339The output from Netscape form signing is a PKCS#7 structure with the
340detached signature format. You can use this program to verify the
341signature by line wrapping the base64 encoded structure and surrounding
342it with:
343
344 -----BEGIN PKCS7----
345 -----END PKCS7----
346
347and using the command,
348
349 openssl smime -verify -inform PEM -in signature.pem -content content.txt
350
351alternatively you can base64 decode the signature and use
352
353 openssl smime -verify -inform DER -in signature.der -content content.txt
354
304=head1 BUGS 355=head1 BUGS
305 356
306The MIME parser isn't very clever: it seems to handle most messages that I've thrown 357The MIME parser isn't very clever: it seems to handle most messages that I've thrown
diff --git a/src/lib/libssl/src/doc/apps/speed.pod b/src/lib/libssl/src/doc/apps/speed.pod
index fecd9a994d..8101851ec6 100644
--- a/src/lib/libssl/src/doc/apps/speed.pod
+++ b/src/lib/libssl/src/doc/apps/speed.pod
@@ -7,6 +7,7 @@ speed - test library performance
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9B<openssl speed> 9B<openssl speed>
10[B<-engine id>]
10[B<md2>] 11[B<md2>]
11[B<mdc2>] 12[B<mdc2>]
12[B<md5>] 13[B<md5>]
@@ -39,7 +40,18 @@ This command is used to test the performance of cryptographic algorithms.
39 40
40=head1 OPTIONS 41=head1 OPTIONS
41 42
42If an option is given, B<speed> test that algorithm, otherwise all of 43=over 4
44
45=item B<-engine id>
46
47specifying an engine (by it's unique B<id> string) will cause B<speed>
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
50for all available algorithms.
51
52=item B<[zero or more test algorithms]>
53
54If any options are given, B<speed> tests those algorithms, otherwise all of
43the above are tested. 55the above are tested.
44 56
45=cut 57=cut
diff --git a/src/lib/libssl/src/doc/apps/verify.pod b/src/lib/libssl/src/doc/apps/verify.pod
index 4a6572d3b8..90455525d1 100644
--- a/src/lib/libssl/src/doc/apps/verify.pod
+++ b/src/lib/libssl/src/doc/apps/verify.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5pkcs7 - PKCS#7 utility 5verify - Utility to verify certificates.
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
@@ -12,6 +12,7 @@ B<openssl> B<verify>
12[B<-purpose purpose>] 12[B<-purpose purpose>]
13[B<-untrusted file>] 13[B<-untrusted file>]
14[B<-help>] 14[B<-help>]
15[B<-issuer_checks>]
15[B<-verbose>] 16[B<-verbose>]
16[B<->] 17[B<->]
17[certificates] 18[certificates]
@@ -57,6 +58,14 @@ prints out a usage message.
57 58
58print extra information about the operations being performed. 59print extra information about the operations being performed.
59 60
61=item B<-issuer_checks>
62
63print out diagnostics relating to searches for the issuer certificate
64of the current certificate. This shows why each candidate issuer
65certificate was rejected. However the presence of rejection messages
66does not itself imply that anything is wrong: during the normal
67verify process several rejections may take place.
68
60=item B<-> 69=item B<->
61 70
62marks the last option. All arguments following this are assumed to be 71marks the last option. All arguments following this are assumed to be
@@ -88,9 +97,21 @@ The verify operation consists of a number of separate steps.
88 97
89Firstly a certificate chain is built up starting from the supplied certificate 98Firstly a certificate chain is built up starting from the supplied certificate
90and ending in the root CA. It is an error if the whole chain cannot be built 99and ending in the root CA. It is an error if the whole chain cannot be built
91up. The chain is built up by looking up a certificate whose subject name 100up. The chain is built up by looking up the issuers certificate of the current
92matches the issuer name of the current certificate. If a certificate is found 101certificate. If a certificate is found which is its own issuer it is assumed
93whose subject and issuer names are identical it is assumed to be the root CA. 102to be the root CA.
103
104The process of 'looking up the issuers certificate' itself involves a number
105of steps. In versions of OpenSSL before 0.9.5a the first certificate whose
106subject name matched the issuer of the current certificate was assumed to be
107the issuers certificate. In OpenSSL 0.9.6 and later all certificates
108whose subject name matches the issuer name of the current certificate are
109subject to further tests. The relevant authority key identifier components
110of the current certificate (if present) must match the subject key identifier
111(if present) and issuer and serial number of the candidate issuer, in addition
112the keyUsage extension of the candidate issuer (if present) must permit
113certificate signing.
114
94The lookup first looks in the list of untrusted certificates and if no match 115The lookup first looks in the list of untrusted certificates and if no match
95is found the remaining lookups are from the trusted certificates. The root CA 116is found the remaining lookups are from the trusted certificates. The root CA
96is always looked up in the trusted certificate list: if the certificate to 117is always looked up in the trusted certificate list: if the certificate to
@@ -260,12 +281,46 @@ the root CA is not marked as trusted for the specified purpose.
260 281
261the root CA is marked to reject the specified purpose. 282the root CA is marked to reject the specified purpose.
262 283
284=item B<29 X509_V_ERR_SUBJECT_ISSUER_MISMATCH: subject issuer mismatch>
285
286the current candidate issuer certificate was rejected because its subject name
287did not match the issuer name of the current certificate. Only displayed when
288the B<-issuer_checks> option is set.
289
290=item B<30 X509_V_ERR_AKID_SKID_MISMATCH: authority and subject key identifier mismatch>
291
292the current candidate issuer certificate was rejected because its subject key
293identifier was present and did not match the authority key identifier current
294certificate. Only displayed when the B<-issuer_checks> option is set.
295
296=item B<31 X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH: authority and issuer serial number mismatch>
297
298the current candidate issuer certificate was rejected because its issuer name
299and serial number was present and did not match the authority key identifier
300of the current certificate. Only displayed when the B<-issuer_checks> option is set.
301
302=item B<32 X509_V_ERR_KEYUSAGE_NO_CERTSIGN:key usage does not include certificate signing>
303
304the current candidate issuer certificate was rejected because its keyUsage extension
305does not permit certificate signing.
306
263=item B<50 X509_V_ERR_APPLICATION_VERIFICATION: application verification failure> 307=item B<50 X509_V_ERR_APPLICATION_VERIFICATION: application verification failure>
264 308
265an application specific error. Unused. 309an application specific error. Unused.
266 310
267=back 311=back
268 312
313=head1 BUGS
314
315Although the issuer checks are a considerably improvement over the old technique they still
316suffer from limitations in the underlying X509_LOOKUP API. One consequence of this is that
317trusted certificates with matching subject name must either appear in a file (as specified by the
318B<-CAfile> option) or a directory (as specified by B<-CApath>. If they occur in both then only
319the certificates in the file will be recognised.
320
321Previous versions of OpenSSL assume certificates with matching subject name are identical and
322mishandled them.
323
269=head1 SEE ALSO 324=head1 SEE ALSO
270 325
271L<x509(1)|x509(1)> 326L<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 e4ae5468da..84f76cb421 100644
--- a/src/lib/libssl/src/doc/apps/x509.pod
+++ b/src/lib/libssl/src/doc/apps/x509.pod
@@ -19,6 +19,8 @@ B<openssl> B<x509>
19[B<-hash>] 19[B<-hash>]
20[B<-subject>] 20[B<-subject>]
21[B<-issuer>] 21[B<-issuer>]
22[B<-nameopt option>]
23[B<-email>]
22[B<-startdate>] 24[B<-startdate>]
23[B<-enddate>] 25[B<-enddate>]
24[B<-purpose>] 26[B<-purpose>]
@@ -137,6 +139,16 @@ outputs the subject name.
137 139
138outputs the issuer name. 140outputs the issuer name.
139 141
142=item B<-nameopt option>
143
144option which determine how the subject or issuer names are displayed. This
145option may be used more than once to set multiple options. See the B<NAME
146OPTIONS> section for more information.
147
148=item B<-email>
149
150outputs the email address(es) if any.
151
140=item B<-startdate> 152=item B<-startdate>
141 153
142prints out the start date of the certificate, that is the notBefore date. 154prints out the start date of the certificate, that is the notBefore date.
@@ -330,6 +342,138 @@ specified then the extensions should either be contained in the unnamed
330 342
331=back 343=back
332 344
345=head1 NAME OPTIONS
346
347The B<nameopt> command line switch determines how the subject and issuer
348names are displayed. If no B<nameopt> switch is present the default "oneline"
349format is used which is compatible with previous versions of OpenSSL.
350Each option is described in detail below, all options can be preceded by
351a B<-> to turn the option off. Only the first four will normally be used.
352
353=over 4
354
355=item B<compat>
356
357use the old format. This is equivalent to specifying no name options at all.
358
359=item B<RFC2253>
360
361displays names compatible with RFC2253 equivalent to B<esc_2253>, B<esc_ctrl>,
362B<esc_msb>, B<utf8>, B<dump_nostr>, B<dump_unknown>, B<dump_der>,
363B<sep_comma_plus>, B<dn_rev> and B<sname>.
364
365=item B<oneline>
366
367a oneline format which is more readable than RFC2253. It is equivalent to
368specifying the B<esc_2253>, B<esc_ctrl>, B<esc_msb>, B<utf8>, B<dump_nostr>,
369B<dump_der>, B<use_quote>, B<sep_comma_plus_spc>, B<spc_eq> and B<sname>
370options.
371
372=item B<multiline>
373
374a multiline format. It is equivalent B<esc_ctrl>, B<esc_msb>, B<sep_multiline>,
375B<spc_eq> and B<lname>.
376
377=item B<esc_2253>
378
379escape the "special" characters required by RFC2253 in a field That is
380B<,+"E<lt>E<gt>;>. Additionally B<#> is escaped at the beginnging of a string
381and a space character at the beginning or end of a string.
382
383=item B<esc_ctrl>
384
385escape control characters. That is those with ASCII values less than
3860x20 (space) and the delete (0x7f) character. They are escaped using the
387RFC2253 \XX notation (where XX are two hex digits representing the
388character value).
389
390=item B<esc_msb>
391
392escape characters with the MSB set, that is with ASCII values larger than
393127.
394
395=item B<use_quote>
396
397escapes some characters by surrounding the whole string with B<"> characters,
398without the option all escaping is done with the B<\> character.
399
400=item B<utf8>
401
402convert all strings to UTF8 format first. This is required by RFC2253. If
403you are lucky enough to have a UTF8 compatible terminal then the use
404of this option (and B<not> setting B<esc_msb>) may result in the correct
405display of multibyte (international) characters. Is this option is not
406present then multibyte characters larger than 0xff will be represented
407using the format \UXXXX for 16 bits and \WXXXXXXXX for 32 bits.
408Also if this option is off any UTF8Strings will be converted to their
409character form first.
410
411=item B<no_type>
412
413this option does not attempt to interpret multibyte characters in any
414way. That is their content octets are merely dumped as though one octet
415represents each character. This is useful for diagnostic purposes but
416will result in rather odd looking output.
417
418=item B<show_type>
419
420show the type of the ASN1 character string. The type precedes the
421field contents. For example "BMPSTRING: Hello World".
422
423=item B<dump_der>
424
425when this option is set any fields that need to be hexdumped will
426be dumped using the DER encoding of the field. Otherwise just the
427content octets will be displayed. Both options use the RFC2253
428B<#XXXX...> format.
429
430=item B<dump_nostr>
431
432dump non character string types (for example OCTET STRING) if this
433option is not set then non character string types will be displayed
434as though each content octet repesents a single character.
435
436=item B<dump_all>
437
438dump all fields. This option when used with B<dump_der> allows the
439DER encoding of the structure to be unambiguously determined.
440
441=item B<dump_unknown>
442
443dump any field whose OID is not recognised by OpenSSL.
444
445=item B<sep_comma_plus>, B<sep_comma_plus_space>, B<sep_semi_plus_space>,
446B<sep_multiline>
447
448these options determine the field separators. The first character is
449between RDNs and the second between multiple AVAs (multiple AVAs are
450very rare and their use is discouraged). The options ending in
451"space" additionally place a space after the separator to make it
452more readable. The B<sep_multiline> uses a linefeed character for
453the RDN separator and a spaced B<+> for the AVA separator. It also
454indents the fields by four characters.
455
456=item B<dn_rev>
457
458reverse the fields of the DN. This is required by RFC2253. As a side
459effect this also reverses the order of multiple AVAs but this is
460permissible.
461
462=item B<nofname>, B<sname>, B<lname>, B<oid>
463
464these options alter how the field name is displayed. B<nofname> does
465not display the field at all. B<sname> uses the "short name" form
466(CN for commonName for example). B<lname> uses the long form.
467B<oid> represents the OID in numerical form and is useful for
468diagnostic purpose.
469
470=item B<spc_eq>
471
472places spaces round the B<=> character which follows the field
473name.
474
475=back
476
333=head1 EXAMPLES 477=head1 EXAMPLES
334 478
335Note: in these examples the '\' means the example should be all on one 479Note: in these examples the '\' means the example should be all on one
@@ -343,6 +487,19 @@ Display the certificate serial number:
343 487
344 openssl x509 -in cert.pem -noout -serial 488 openssl x509 -in cert.pem -noout -serial
345 489
490Display the certificate subject name:
491
492 openssl x509 -in cert.pem -noout -subject
493
494Display the certificate subject name in RFC2253 form:
495
496 openssl x509 -in cert.pem -noout -subject -nameopt RFC2253
497
498Display the certificate subject name in oneline form on a terminal
499supporting UTF8:
500
501 openssl x509 -in cert.pem -noout -subject -nameopt oneline -nameopt -escmsb
502
346Display the certificate MD5 fingerprint: 503Display the certificate MD5 fingerprint:
347 504
348 openssl x509 -in cert.pem -noout -fingerprint 505 openssl x509 -in cert.pem -noout -fingerprint
@@ -362,13 +519,13 @@ Convert a certificate to a certificate request:
362Convert a certificate request into a self signed certificate using 519Convert a certificate request into a self signed certificate using
363extensions for a CA: 520extensions for a CA:
364 521
365 openssl x509 -req -in careq.pem -config openssl.cnf -extensions v3_ca \ 522 openssl x509 -req -in careq.pem -extfile openssl.cnf -extensions v3_ca \
366 -signkey key.pem -out cacert.pem 523 -signkey key.pem -out cacert.pem
367 524
368Sign a certificate request using the CA certificate above and add user 525Sign a certificate request using the CA certificate above and add user
369certificate extensions: 526certificate extensions:
370 527
371 openssl x509 -req -in req.pem -config openssl.cnf -extensions v3_usr \ 528 openssl x509 -req -in req.pem -extfile openssl.cnf -extensions v3_usr \
372 -CA cacert.pem -CAkey key.pem -CAcreateserial 529 -CA cacert.pem -CAkey key.pem -CAcreateserial
373 530
374 531
@@ -395,6 +552,11 @@ Trusted certificates have the lines
395 -----BEGIN TRUSTED CERTIFICATE---- 552 -----BEGIN TRUSTED CERTIFICATE----
396 -----END TRUSTED CERTIFICATE---- 553 -----END TRUSTED CERTIFICATE----
397 554
555The conversion to UTF8 format used with the name options assumes that
556T61Strings use the ISO8859-1 character set. This is wrong but Netscape
557and MSIE do this as do many certificates. So although this is incorrect
558it is more likely to display the majority of certificates correctly.
559
398The B<-fingerprint> option takes the digest of the DER encoded certificate. 560The B<-fingerprint> option takes the digest of the DER encoded certificate.
399This is commonly called a "fingerprint". Because of the nature of message 561This is commonly called a "fingerprint". Because of the nature of message
400digests the fingerprint of a certificate is unique to that certificate and 562digests the fingerprint of a certificate is unique to that certificate and
@@ -402,6 +564,10 @@ two certificates with the same fingerprint can be considered to be the same.
402 564
403The Netscape fingerprint uses MD5 whereas MSIE uses SHA1. 565The Netscape fingerprint uses MD5 whereas MSIE uses SHA1.
404 566
567The B<-email> option searches the subject name and the subject alternative
568name extension. Only unique email addresses will be printed out: it will
569not print the same address more than once.
570
405=head1 CERTIFICATE EXTENSIONS 571=head1 CERTIFICATE EXTENSIONS
406 572
407The B<-purpose> option checks the certificate extensions and determines 573The B<-purpose> option checks the certificate extensions and determines
@@ -517,10 +683,6 @@ must be present.
517 683
518=head1 BUGS 684=head1 BUGS
519 685
520The way DNs are printed is in a "historical SSLeay" format which doesn't
521follow any published standard. It should follow some standard like RFC2253
522or RFC1779 with options to make the stuff more readable.
523
524Extensions in certificates are not transferred to certificate requests and 686Extensions in certificates are not transferred to certificate requests and
525vice versa. 687vice versa.
526 688
@@ -532,7 +694,7 @@ There should be options to explicitly set such things as start and end
532dates rather than an offset from the current time. 694dates rather than an offset from the current time.
533 695
534The code to implement the verify behaviour described in the B<TRUST SETTINGS> 696The code to implement the verify behaviour described in the B<TRUST SETTINGS>
535is currently being developed. It thus describes the intended behavior rather 697is currently being developed. It thus describes the intended behaviour rather
536than the current behaviour. It is hoped that it will represent reality in 698than the current behaviour. It is hoped that it will represent reality in
537OpenSSL 0.9.5 and later. 699OpenSSL 0.9.5 and later.
538 700
diff --git a/src/lib/libssl/src/doc/c-indentation.el b/src/lib/libssl/src/doc/c-indentation.el
index 9111450915..48ca3cf69b 100644
--- a/src/lib/libssl/src/doc/c-indentation.el
+++ b/src/lib/libssl/src/doc/c-indentation.el
@@ -39,7 +39,8 @@
39 (label . -) 39 (label . -)
40 (arglist-cont-nonempty . +) 40 (arglist-cont-nonempty . +)
41 (topmost-intro . -) 41 (topmost-intro . -)
42 (brace-list-close . +) 42 (brace-list-close . 0)
43 (brace-list-intro . +) 43 (brace-list-intro . 0)
44 (brace-list-open . +)
44 )))) 45 ))))
45 46
diff --git a/src/lib/libssl/src/doc/crypto/BIO_ctrl.pod b/src/lib/libssl/src/doc/crypto/BIO_ctrl.pod
new file mode 100644
index 0000000000..722e8b8f46
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_ctrl.pod
@@ -0,0 +1,128 @@
1=pod
2
3=head1 NAME
4
5BIO_ctrl, BIO_callback_ctrl, BIO_ptr_ctrl, BIO_int_ctrl, BIO_reset,
6BIO_seek, BIO_tell, BIO_flush, BIO_eof, BIO_set_close, BIO_get_close,
7BIO_pending, BIO_wpending, BIO_ctrl_pending, BIO_ctrl_wpending,
8BIO_get_info_callback, BIO_set_info_callback - BIO control operations
9
10=head1 SYNOPSIS
11
12 #include <openssl/bio.h>
13
14 long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg);
15 long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)(struct bio_st *, int, const char *, int, long, long));
16 char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg);
17 long BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg);
18
19 int BIO_reset(BIO *b);
20 int BIO_seek(BIO *b, int ofs);
21 int BIO_tell(BIO *b);
22 int BIO_flush(BIO *b);
23 int BIO_eof(BIO *b);
24 int BIO_set_close(BIO *b,long flag);
25 int BIO_get_close(BIO *b);
26 int BIO_pending(BIO *b);
27 int BIO_wpending(BIO *b);
28 size_t BIO_ctrl_pending(BIO *b);
29 size_t BIO_ctrl_wpending(BIO *b);
30
31 int BIO_get_info_callback(BIO *b,bio_info_cb **cbp);
32 int BIO_set_info_callback(BIO *b,bio_info_cb *cb);
33
34 typedef void bio_info_cb(BIO *b, int oper, const char *ptr, int arg1, long arg2, long arg3);
35
36=head1 DESCRIPTION
37
38BIO_ctrl(), BIO_callback_ctrl(), BIO_ptr_ctrl() and BIO_int_ctrl()
39are BIO "control" operations taking arguments of various types.
40These functions are not normally called directly, various macros
41are used instead. The standard macros are described below, macros
42specific to a particular type of BIO are described in the specific
43BIOs manual page as well as any special features of the standard
44calls.
45
46BIO_reset() typically resets a BIO to some initial state, in the case
47of file related BIOs for example it rewinds the file pointer to the
48start of the file.
49
50BIO_seek() resets a file related BIO's (that is file descriptor and
51FILE BIOs) file position pointer to B<ofs> bytes from start of file.
52
53BIO_tell() returns the current file position of a file related BIO.
54
55BIO_flush() normally writes out any internally buffered data, in some
56cases it is used to signal EOF and that no more data will be written.
57
58BIO_eof() returns 1 if the BIO has read EOF, the precise meaning of
59"EOF" varies according to the BIO type.
60
61BIO_set_close() sets the BIO B<b> close flag to B<flag>. B<flag> can
62take the value BIO_CLOSE or BIO_NOCLOSE. Typically BIO_CLOSE is used
63in a source/sink BIO to indicate that the underlying I/O stream should
64be closed when the BIO is freed.
65
66BIO_get_close() returns the BIOs close flag.
67
68BIO_pending(), BIO_ctrl_pending(), BIO_wpending() and BIO_ctrl_wpending()
69return the number of pending characters in the BIOs read and write buffers.
70Not all BIOs support these calls. BIO_ctrl_pending() and BIO_ctrl_wpending()
71return a size_t type and are functions, BIO_pending() and BIO_wpending() are
72macros which call BIO_ctrl().
73
74=head1 RETURN VALUES
75
76BIO_reset() normally returns 1 for success and 0 or -1 for failure. File
77BIOs are an exception, they return 0 for success and -1 for failure.
78
79BIO_seek() and BIO_tell() both return the current file position on success
80and -1 for failure, except file BIOs which for BIO_seek() always return 0
81for success and -1 for failure.
82
83BIO_flush() returns 1 for success and 0 or -1 for failure.
84
85BIO_eof() returns 1 if EOF has been reached 0 otherwise.
86
87BIO_set_close() always returns 1.
88
89BIO_get_close() returns the close flag value: BIO_CLOSE or BIO_NOCLOSE.
90
91BIO_pending(), BIO_ctrl_pending(), BIO_wpending() and BIO_ctrl_wpending()
92return the amount of pending data.
93
94=head1 NOTES
95
96BIO_flush(), because it can write data may return 0 or -1 indicating
97that the call should be retried later in a similar manner to BIO_write().
98The BIO_should_retry() call should be used and appropriate action taken
99is the call fails.
100
101The return values of BIO_pending() and BIO_wpending() may not reliably
102determine the amount of pending data in all cases. For example in the
103case of a file BIO some data may be available in the FILE structures
104internal buffers but it is not possible to determine this in a
105portably way. For other types of BIO they may not be supported.
106
107Filter BIOs if they do not internally handle a particular BIO_ctrl()
108operation usually pass the operation to the next BIO in the chain.
109This often means there is no need to locate the required BIO for
110a particular operation, it can be called on a chain and it will
111be automatically passed to the relevant BIO. However this can cause
112unexpected results: for example no current filter BIOs implement
113BIO_seek(), but this may still succeed if the chain ends in a FILE
114or file descriptor BIO.
115
116Source/sink BIOs return an 0 if they do not recognize the BIO_ctrl()
117operation.
118
119=head1 BUGS
120
121Some of the return values are ambiguous and care should be taken. In
122particular a return value of 0 can be returned if an operation is not
123supported, if an error occurred, if EOF has not been reached and in
124the case of BIO_seek() on a file BIO for a successful operation.
125
126=head1 SEE ALSO
127
128TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_f_base64.pod b/src/lib/libssl/src/doc/crypto/BIO_f_base64.pod
new file mode 100644
index 0000000000..fdb603b38e
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_f_base64.pod
@@ -0,0 +1,82 @@
1=pod
2
3=head1 NAME
4
5BIO_f_base64 - base64 BIO filter
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10 #include <openssl/evp.h>
11
12 BIO_METHOD * BIO_f_base64(void);
13
14=head1 DESCRIPTION
15
16BIO_f_base64() returns the base64 BIO method. This is a filter
17BIO that base64 encodes any data written through it and decodes
18any data read through it.
19
20Base64 BIOs do not support BIO_gets() or BIO_puts().
21
22BIO_flush() on a base64 BIO that is being written through is
23used to signal that no more data is to be encoded: this is used
24to flush the final block through the BIO.
25
26The flag BIO_FLAGS_BASE64_NO_NL can be set with BIO_set_flags()
27to encode the data all on one line or expect the data to be all
28on one line.
29
30=head1 NOTES
31
32Because of the format of base64 encoding the end of the encoded
33block cannot always be reliably determined.
34
35=head1 RETURN VALUES
36
37BIO_f_base64() returns the base64 BIO method.
38
39=head1 EXAMPLES
40
41Base64 encode the string "Hello World\n" and write the result
42to standard output:
43
44 BIO *bio, *b64;
45 char message[] = "Hello World \n";
46
47 b64 = BIO_new(BIO_f_base64());
48 bio = BIO_new_fp(stdout, BIO_NOCLOSE);
49 bio = BIO_push(b64, bio);
50 BIO_write(bio, message, strlen(message));
51 BIO_flush(bio);
52
53 BIO_free_all(bio);
54
55Read Base64 encoded data from standard input and write the decoded
56data to standard output:
57
58 BIO *bio, *b64, bio_out;
59 char inbuf[512];
60 int inlen;
61 char message[] = "Hello World \n";
62
63 b64 = BIO_new(BIO_f_base64());
64 bio = BIO_new_fp(stdin, BIO_NOCLOSE);
65 bio_out = BIO_new_fp(stdout, BIO_NOCLOSE);
66 bio = BIO_push(b64, bio);
67 while((inlen = BIO_read(bio, inbuf, strlen(message))) > 0)
68 BIO_write(bio_out, inbuf, inlen);
69
70 BIO_free_all(bio);
71
72=head1 BUGS
73
74The ambiguity of EOF in base64 encoded data can cause additional
75data following the base64 encoded block to be misinterpreted.
76
77There should be some way of specifying a test that the BIO can perform
78to reliably determine EOF (for example a MIME boundary).
79
80=head1 SEE ALSO
81
82TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_f_buffer.pod b/src/lib/libssl/src/doc/crypto/BIO_f_buffer.pod
new file mode 100644
index 0000000000..c9093c6a57
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_f_buffer.pod
@@ -0,0 +1,69 @@
1=pod
2
3=head1 NAME
4
5BIO_f_buffer - buffering BIO
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10
11 BIO_METHOD * BIO_f_buffer(void);
12
13 #define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL)
14 #define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0)
15 #define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1)
16 #define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL)
17 #define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf)
18
19=head1 DESCRIPTION
20
21BIO_f_buffer() returns the buffering BIO method.
22
23Data written to a buffering BIO is buffered and periodically written
24to the next BIO in the chain. Data read from a buffering BIO comes from
25an internal buffer which is filled from the next BIO in the chain.
26Both BIO_gets() and BIO_puts() are supported.
27
28Calling BIO_reset() on a buffering BIO clears any buffered data.
29
30BIO_get_buffer_num_lines() returns the number of lines currently buffered.
31
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
34buffer size is DEFAULT_BUFFER_SIZE, currently 1024. Any attempt to reduce the
35buffer size below DEFAULT_BUFFER_SIZE is ignored. Any buffered data is cleared
36when the buffer is resized.
37
38BIO_set_buffer_read_data() clears the read buffer and fills it with B<num>
39bytes of B<buf>. If B<num> is larger than the current buffer size the buffer
40is expanded.
41
42=head1 NOTES
43
44Buffering BIOs implement BIO_gets() by using BIO_read() operations on the
45next BIO in the chain. By prepending a buffering BIO to a chain it is therefore
46possible to provide BIO_gets() functionality if the following BIOs do not
47support it (for example SSL BIOs).
48
49Data is only written to the next BIO in the chain when the write buffer fills
50or when BIO_flush() is called. It is therefore important to call BIO_flush()
51whenever any pending data should be written such as when removing a buffering
52BIO using BIO_pop(). BIO_flush() may need to be retried if the ultimate
53source/sink BIO is non blocking.
54
55=head1 RETURN VALUES
56
57BIO_f_buffer() returns the buffering BIO method.
58
59BIO_get_buffer_num_lines() returns the number of lines buffered (may be 0).
60
61BIO_set_read_buffer_size(), BIO_set_write_buffer_size() and BIO_set_buffer_size()
62return 1 if the buffer was successfully resized or 0 for failure.
63
64BIO_set_buffer_read_data() returns 1 if the data was set correctly or 0 if
65there was an error.
66
67=head1 SEE ALSO
68
69TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_f_cipher.pod b/src/lib/libssl/src/doc/crypto/BIO_f_cipher.pod
new file mode 100644
index 0000000000..4182f2c309
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_f_cipher.pod
@@ -0,0 +1,76 @@
1=pod
2
3=head1 NAME
4
5BIO_f_cipher, BIO_set_cipher, BIO_get_cipher_status, BIO_get_cipher_ctx - cipher BIO filter
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10 #include <openssl/evp.h>
11
12 BIO_METHOD * BIO_f_cipher(void);
13 void BIO_set_cipher(BIO *b,const EVP_CIPHER *cipher,
14 unsigned char *key, unsigned char *iv, int enc);
15 int BIO_get_cipher_status(BIO *b)
16 int BIO_get_cipher_ctx(BIO *b, EVP_CIPHER_CTX **pctx)
17
18=head1 DESCRIPTION
19
20BIO_f_cipher() returns the cipher BIO method. This is a filter
21BIO that encrypts any data written through it, and decrypts any data
22read from it. It is a BIO wrapper for the cipher routines
23EVP_CipherInit(), EVP_CipherUpdate() and EVP_CipherFinal().
24
25Cipher BIOs do not support BIO_gets() or BIO_puts().
26
27BIO_flush() on an encryption BIO that is being written through is
28used to signal that no more data is to be encrypted: this is used
29to flush and possibly pad the final block through the BIO.
30
31BIO_set_cipher() sets the cipher of BIO <b> to B<cipher> using key B<key>
32and IV B<iv>. B<enc> should be set to 1 for encryption and zero for
33decryption.
34
35When reading from an encryption BIO the final block is automatically
36decrypted and checked when EOF is detected. BIO_get_cipher_status()
37is a BIO_ctrl() macro which can be called to determine whether the
38decryption operation was successful.
39
40BIO_get_cipher_ctx() is a BIO_ctrl() macro which retrieves the internal
41BIO cipher context. The retrieved context can be used in conjunction
42with the standard cipher routines to set it up. This is useful when
43BIO_set_cipher() is not flexible enough for the applications needs.
44
45=head1 NOTES
46
47When encrypting BIO_flush() B<must> be called to flush the final block
48through the BIO. If it is not then the final block will fail a subsequent
49decrypt.
50
51When decrypting an error on the final block is signalled by a zero
52return value from the read operation. A successful decrypt followed
53by EOF will also return zero for the final read. BIO_get_cipher_status()
54should be called to determine if the decrypt was successful.
55
56As always, if BIO_gets() or BIO_puts() support is needed then it can
57be achieved by preceding the cipher BIO with a buffering BIO.
58
59=head1 RETURN VALUES
60
61BIO_f_cipher() returns the cipher BIO method.
62
63BIO_set_cipher() does not return a value.
64
65BIO_get_cipher_status() returns 1 for a successful decrypt and 0
66for failure.
67
68BIO_get_cipher_ctx() currently always returns 1.
69
70=head1 EXAMPLES
71
72TBA
73
74=head1 SEE ALSO
75
76TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_f_md.pod b/src/lib/libssl/src/doc/crypto/BIO_f_md.pod
new file mode 100644
index 0000000000..c32504dfb1
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_f_md.pod
@@ -0,0 +1,138 @@
1=pod
2
3=head1 NAME
4
5BIO_f_md, BIO_set_md, BIO_get_md, BIO_get_md_ctx - message digest BIO filter
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10 #include <openssl/evp.h>
11
12 BIO_METHOD * BIO_f_md(void);
13 int BIO_set_md(BIO *b,EVP_MD *md);
14 int BIO_get_md(BIO *b,EVP_MD **mdp);
15 int BIO_get_md_ctx(BIO *b,EVP_MD_CTX **mdcp);
16
17=head1 DESCRIPTION
18
19BIO_f_md() returns the message digest BIO method. This is a filter
20BIO that digests any data passed through it, it is a BIO wrapper
21for the digest routines EVP_DigestInit(), EVP_DigestUpdate()
22and EVP_DigestFinal().
23
24Any data written or read through a digest BIO using BIO_read() and
25BIO_write() is digested.
26
27BIO_gets(), if its B<size> parameter is large enough finishes the
28digest calculation and returns the digest value. BIO_puts() is
29not supported.
30
31BIO_reset() reinitializes a digest BIO.
32
33BIO_set_md() sets the message digest of BIO B<b> to B<md>: this
34must be called to initialize a digest BIO before any data is
35passed through it. It is a BIO_ctrl() macro.
36
37BIO_get_md() places the a pointer to the digest BIOs digest method
38in B<mdp>, it is a BIO_ctrl() macro.
39
40BIO_get_md_ctx() returns the digest BIOs context into B<mdcp>.
41
42=head1 NOTES
43
44The context returned by BIO_get_md_ctx() can be used in calls
45to EVP_DigestFinal() and also the signature routines EVP_SignFinal()
46and EVP_VerifyFinal().
47
48The context returned by BIO_get_md_ctx() is an internal context
49structure. Changes made to this context will affect the digest
50BIO itself and the context pointer will become invalid when the digest
51BIO is freed.
52
53After the digest has been retrieved from a digest BIO it must be
54reinitialized by calling BIO_reset(), or BIO_set_md() before any more
55data is passed through it.
56
57If an application needs to call BIO_gets() or BIO_puts() through
58a chain containing digest BIOs then this can be done by prepending
59a buffering BIO.
60
61=head1 RETURN VALUES
62
63BIO_f_md() returns the digest BIO method.
64
65BIO_set_md(), BIO_get_md() and BIO_md_ctx() return 1 for success and
660 for failure.
67
68=head1 EXAMPLES
69
70The following example creates a BIO chain containing an SHA1 and MD5
71digest BIO and passes the string "Hello World" through it. Error
72checking has been omitted for clarity.
73
74 BIO *bio, *mdtmp;
75 char message[] = "Hello World";
76 bio = BIO_new(BIO_s_null());
77 mdtmp = BIO_new(BIO_f_md());
78 BIO_set_md(mdtmp, EVP_sha1());
79 /* For BIO_push() we want to append the sink BIO and keep a note of
80 * the start of the chain.
81 */
82 bio = BIO_push(mdtmp, bio);
83 mdtmp = BIO_new(BIO_f_md());
84 BIO_set_md(mdtmp, EVP_md5());
85 bio = BIO_push(mdtmp, bio);
86 /* Note: mdtmp can now be discarded */
87 BIO_write(bio, message, strlen(message));
88
89The next example digests data by reading through a chain instead:
90
91 BIO *bio, *mdtmp;
92 char buf[1024];
93 int rdlen;
94 bio = BIO_new_file(file, "rb");
95 mdtmp = BIO_new(BIO_f_md());
96 BIO_set_md(mdtmp, EVP_sha1());
97 bio = BIO_push(mdtmp, bio);
98 mdtmp = BIO_new(BIO_f_md());
99 BIO_set_md(mdtmp, EVP_md5());
100 bio = BIO_push(mdtmp, bio);
101 do {
102 rdlen = BIO_read(bio, buf, sizeof(buf));
103 /* Might want to do something with the data here */
104 } while(rdlen > 0);
105
106This next example retrieves the message digests from a BIO chain and
107outputs them. This could be used with the examples above.
108
109 BIO *mdtmp;
110 unsigned char mdbuf[EVP_MAX_MD_SIZE];
111 int mdlen;
112 int i;
113 mdtmp = bio; /* Assume bio has previously been set up */
114 do {
115 EVP_MD *md;
116 mdtmp = BIO_find_type(mdtmp, BIO_TYPE_MD);
117 if(!mdtmp) break;
118 BIO_get_md(mdtmp, &md);
119 printf("%s digest", OBJ_nid2sn(EVP_MD_type(md)));
120 mdlen = BIO_gets(mdtmp, mdbuf, EVP_MAX_MD_SIZE);
121 for(i = 0; i < mdlen; i++) printf(":%02X", mdbuf[i]);
122 printf("\n");
123 mdtmp = BIO_next(mdtmp);
124 } while(mdtmp);
125
126 BIO_free_all(bio);
127
128=head1 BUGS
129
130The lack of support for BIO_puts() and the non standard behaviour of
131BIO_gets() could be regarded as anomalous. It could be argued that BIO_gets()
132and BIO_puts() should be passed to the next BIO in the chain and digest
133the data passed through and that digests should be retrieved using a
134separate BIO_ctrl() call.
135
136=head1 SEE ALSO
137
138TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_f_null.pod b/src/lib/libssl/src/doc/crypto/BIO_f_null.pod
new file mode 100644
index 0000000000..b057c18408
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_f_null.pod
@@ -0,0 +1,32 @@
1=pod
2
3=head1 NAME
4
5BIO_f_null - null filter
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10
11 BIO_METHOD * BIO_f_null(void);
12
13=head1 DESCRIPTION
14
15BIO_f_null() returns the null filter BIO method. This is a filter BIO
16that does nothing.
17
18All requests to a null filter BIO are passed through to the next BIO in
19the chain: this means that a BIO chain containing a null filter BIO
20behaves just as though the BIO was not there.
21
22=head1 NOTES
23
24As may be apparent a null filter BIO is not particularly useful.
25
26=head1 RETURN VALUES
27
28BIO_f_null() returns the null filter BIO method.
29
30=head1 SEE ALSO
31
32TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_f_ssl.pod b/src/lib/libssl/src/doc/crypto/BIO_f_ssl.pod
new file mode 100644
index 0000000000..a56ee2b92f
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_f_ssl.pod
@@ -0,0 +1,313 @@
1=pod
2
3=head1 NAME
4
5BIO_f_ssl, BIO_set_ssl, BIO_get_ssl, BIO_set_ssl_mode, BIO_set_ssl_renegotiate_bytes,
6BIO_get_num_renegotiates, BIO_set_ssl_renegotiate_timeout, BIO_new_ssl,
7BIO_new_ssl_connect, BIO_new_buffer_ssl_connect, BIO_ssl_copy_session_id,
8BIO_ssl_shutdown - SSL BIO
9
10=head1 SYNOPSIS
11
12 #include <openssl/bio.h>
13 #include <openssl/ssl.h>
14
15 BIO_METHOD *BIO_f_ssl(void);
16
17 #define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char *)ssl)
18 #define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp)
19 #define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL)
20 #define BIO_set_ssl_renegotiate_bytes(b,num) \
21 BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL);
22 #define BIO_set_ssl_renegotiate_timeout(b,seconds) \
23 BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL);
24 #define BIO_get_num_renegotiates(b) \
25 BIO_ctrl(b,BIO_C_SET_SSL_NUM_RENEGOTIATES,0,NULL);
26
27 BIO *BIO_new_ssl(SSL_CTX *ctx,int client);
28 BIO *BIO_new_ssl_connect(SSL_CTX *ctx);
29 BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx);
30 int BIO_ssl_copy_session_id(BIO *to,BIO *from);
31 void BIO_ssl_shutdown(BIO *bio);
32
33 #define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)
34
35=head1 DESCRIPTION
36
37BIO_f_ssl() returns the SSL BIO method. This is a filter BIO which
38is a wrapper round the OpenSSL SSL routines adding a BIO "flavour" to
39SSL I/O.
40
41I/O performed on an SSL BIO communicates using the SSL protocol with
42the SSLs read and write BIOs. If an SSL connection is not established
43then an attempt is made to establish one on the first I/O call.
44
45If a BIO is appended to an SSL BIO using BIO_push() it is automatically
46used as the SSL BIOs read and write BIOs.
47
48Calling BIO_reset() on an SSL BIO closes down any current SSL connection
49by calling SSL_shutdown(). BIO_reset() is then sent to the next BIO in
50the chain: this will typically disconnect the underlying transport.
51The SSL BIO is then reset to the initial accept or connect state.
52
53If the close flag is set when an SSL BIO is freed then the internal
54SSL structure is also freed using SSL_free().
55
56BIO_set_ssl() sets the internal SSL pointer of BIO B<b> to B<ssl> using
57the close flag B<c>.
58
59BIO_get_ssl() retrieves the SSL pointer of BIO B<b>, it can then be
60manipulated using the standard SSL library functions.
61
62BIO_set_ssl_mode() sets the SSL BIO mode to B<client>. If B<client>
63is 1 client mode is set. If B<client> is 0 server mode is set.
64
65BIO_set_ssl_renegotiate_bytes() sets the renegotiate byte count
66to B<num>. When set after every B<num> bytes of I/O (read and write)
67the SSL session is automatically renegotiated. B<num> must be at
68least 512 bytes.
69
70BIO_set_ssl_renegotiate_timeout() sets the renegotiate timeout to
71B<seconds>. When the renegotiate timeout elapses the session is
72automatically renegotiated.
73
74BIO_get_num_renegotiates() returns the total number of session
75renegotiations due to I/O or timeout.
76
77BIO_new_ssl() allocates an SSL BIO using SSL_CTX B<ctx> and using
78client mode if B<client> is non zero.
79
80BIO_new_ssl_connect() creates a new BIO chain consisting of an
81SSL BIO (using B<ctx>) followed by a connect BIO.
82
83BIO_new_buffer_ssl_connect() creates a new BIO chain consisting
84of a buffering BIO, an SSL BIO (using B<ctx>) and a connect
85BIO.
86
87BIO_ssl_copy_session_id() copies an SSL session id between
88BIO chains B<from> and B<to>. It does this by locating the
89SSL BIOs in each chain and calling SSL_copy_session_id() on
90the internal SSL pointer.
91
92BIO_ssl_shutdown() closes down an SSL connection on BIO
93chain B<bio>. It does this by locating the SSL BIO in the
94chain and calling SSL_shutdown() on its internal SSL
95pointer.
96
97BIO_do_handshake() attempts to complete an SSL handshake on the
98supplied BIO and establish the SSL connection. It returns 1
99if the connection was established successfully. A zero or negative
100value is returned if the connection could not be established, the
101call BIO_should_retry() should be used for non blocking connect BIOs
102to determine if the call should be retried. If an SSL connection has
103already been established this call has no effect.
104
105=head1 NOTES
106
107SSL BIOs are exceptional in that if the underlying transport
108is non blocking they can still request a retry in exceptional
109circumstances. Specifically this will happen if a session
110renegotiation takes place during a BIO_read() operation, one
111case where this happens is when SGC or step up occurs.
112
113In OpenSSL 0.9.6 and later the SSL flag SSL_AUTO_RETRY can be
114set to disable this behaviour. That is when this flag is set
115an SSL BIO using a blocking transport will never request a
116retry.
117
118Since unknown BIO_ctrl() operations are sent through filter
119BIOs the servers name and port can be set using BIO_set_host()
120on the BIO returned by BIO_new_ssl_connect() without having
121to locate the connect BIO first.
122
123Applications do not have to call BIO_do_handshake() but may wish
124to do so to separate the handshake process from other I/O
125processing.
126
127=head1 RETURN VALUES
128
129TBA
130
131=head1 EXAMPLE
132
133This SSL/TLS client example, attempts to retrieve a page from an
134SSL/TLS web server. The I/O routines are identical to those of the
135unencrypted example in L<BIO_s_connect(3)|BIO_s_connect(3)>.
136
137 BIO *sbio, *out;
138 int len;
139 char tmpbuf[1024];
140 SSL_CTX *ctx;
141 SSL *ssl;
142
143 ERR_load_crypto_strings();
144 ERR_load_SSL_strings();
145 OpenSSL_add_all_algorithms();
146
147 /* We would seed the PRNG here if the platform didn't
148 * do it automatically
149 */
150
151 ctx = SSL_CTX_new(SSLv23_client_method());
152
153 /* We'd normally set some stuff like the verify paths and
154 * mode here because as things stand this will connect to
155 * any server whose certificate is signed by any CA.
156 */
157
158 sbio = BIO_new_ssl_connect(ctx);
159
160 BIO_get_ssl(sbio, &ssl);
161
162 if(!ssl) {
163 fprintf(stderr, "Can't locate SSL pointer\n");
164 /* whatever ... */
165 }
166
167 /* Don't want any retries */
168 SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
169
170 /* We might want to do other things with ssl here */
171
172 BIO_set_conn_hostname(sbio, "localhost:https");
173
174 out = BIO_new_fp(stdout, BIO_NOCLOSE);
175 if(BIO_do_connect(sbio) <= 0) {
176 fprintf(stderr, "Error connecting to server\n");
177 ERR_print_errors_fp(stderr);
178 /* whatever ... */
179 }
180
181 if(BIO_do_handshake(sbio) <= 0) {
182 fprintf(stderr, "Error establishing SSL connection\n");
183 ERR_print_errors_fp(stderr);
184 /* whatever ... */
185 }
186
187 /* Could examine ssl here to get connection info */
188
189 BIO_puts(sbio, "GET / HTTP/1.0\n\n");
190 for(;;) {
191 len = BIO_read(sbio, tmpbuf, 1024);
192 if(len <= 0) break;
193 BIO_write(out, tmpbuf, len);
194 }
195 BIO_free_all(sbio);
196 BIO_free(out);
197
198Here is a simple server example. It makes use of a buffering
199BIO to allow lines to be read from the SSL BIO using BIO_gets.
200It creates a pseudo web page containing the actual request from
201a client and also echoes the request to standard output.
202
203 BIO *sbio, *bbio, *acpt, *out;
204 int len;
205 char tmpbuf[1024];
206 SSL_CTX *ctx;
207 SSL *ssl;
208
209 ERR_load_crypto_strings();
210 ERR_load_SSL_strings();
211 OpenSSL_add_all_algorithms();
212
213 /* Might seed PRNG here */
214
215 ctx = SSL_CTX_new(SSLv23_server_method());
216
217 if (!SSL_CTX_use_certificate_file(ctx,"server.pem",SSL_FILETYPE_PEM)
218 || !SSL_CTX_use_PrivateKey_file(ctx,"server.pem",SSL_FILETYPE_PEM)
219 || !SSL_CTX_check_private_key(ctx)) {
220
221 fprintf(stderr, "Error setting up SSL_CTX\n");
222 ERR_print_errors_fp(stderr);
223 return 0;
224 }
225
226 /* Might do other things here like setting verify locations and
227 * DH and/or RSA temporary key callbacks
228 */
229
230 /* New SSL BIO setup as server */
231 sbio=BIO_new_ssl(ctx,0);
232
233 BIO_get_ssl(sbio, &ssl);
234
235 if(!ssl) {
236 fprintf(stderr, "Can't locate SSL pointer\n");
237 /* whatever ... */
238 }
239
240 /* Don't want any retries */
241 SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
242
243 /* Create the buffering BIO */
244
245 bbio = BIO_new(BIO_f_buffer());
246
247 /* Add to chain */
248 sbio = BIO_push(bbio, sbio);
249
250 acpt=BIO_new_accept("4433");
251
252 /* By doing this when a new connection is established
253 * we automatically have sbio inserted into it. The
254 * BIO chain is now 'swallowed' by the accept BIO and
255 * will be freed when the accept BIO is freed.
256 */
257
258 BIO_set_accept_bios(acpt,sbio);
259
260 out = BIO_new_fp(stdout, BIO_NOCLOSE);
261
262 /* Setup accept BIO */
263 if(BIO_do_accept(acpt) <= 0) {
264 fprintf(stderr, "Error setting up accept BIO\n");
265 ERR_print_errors_fp(stderr);
266 return 0;
267 }
268
269 /* Now wait for incoming connection */
270 if(BIO_do_accept(acpt) <= 0) {
271 fprintf(stderr, "Error in connection\n");
272 ERR_print_errors_fp(stderr);
273 return 0;
274 }
275
276 /* We only want one connection so remove and free
277 * accept BIO
278 */
279
280 sbio = BIO_pop(acpt);
281
282 BIO_free_all(acpt);
283
284 if(BIO_do_handshake(sbio) <= 0) {
285 fprintf(stderr, "Error in SSL handshake\n");
286 ERR_print_errors_fp(stderr);
287 return 0;
288 }
289
290 BIO_puts(sbio, "HTTP/1.0 200 OK\r\nContent-type: text/html\r\n\r\n");
291 BIO_puts(sbio, "<pre>\r\nConnection Established\r\nRequest headers:\r\n");
292 BIO_puts(sbio, "--------------------------------------------------\r\n");
293
294 for(;;) {
295 len = BIO_gets(sbio, tmpbuf, 1024);
296 if(len <= 0) break;
297 BIO_write(sbio, tmpbuf, len);
298 BIO_write(out, tmpbuf, len);
299 /* Look for blank line signifying end of headers*/
300 if((tmpbuf[0] == '\r') || (tmpbuf[0] == '\n')) break;
301 }
302
303 BIO_puts(sbio, "--------------------------------------------------\r\n");
304 BIO_puts(sbio, "</pre>\r\n");
305
306 /* Since there is a buffering BIO present we had better flush it */
307 BIO_flush(sbio);
308
309 BIO_free_all(sbio);
310
311=head1 SEE ALSO
312
313TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_find_type.pod b/src/lib/libssl/src/doc/crypto/BIO_find_type.pod
new file mode 100644
index 0000000000..bd3b256196
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_find_type.pod
@@ -0,0 +1,98 @@
1=pod
2
3=head1 NAME
4
5BIO_find_type, BIO_next - BIO chain traversal
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10
11 BIO * BIO_find_type(BIO *b,int bio_type);
12 BIO * BIO_next(BIO *b);
13
14 #define BIO_method_type(b) ((b)->method->type)
15
16 #define BIO_TYPE_NONE 0
17 #define BIO_TYPE_MEM (1|0x0400)
18 #define BIO_TYPE_FILE (2|0x0400)
19
20 #define BIO_TYPE_FD (4|0x0400|0x0100)
21 #define BIO_TYPE_SOCKET (5|0x0400|0x0100)
22 #define BIO_TYPE_NULL (6|0x0400)
23 #define BIO_TYPE_SSL (7|0x0200)
24 #define BIO_TYPE_MD (8|0x0200)
25 #define BIO_TYPE_BUFFER (9|0x0200)
26 #define BIO_TYPE_CIPHER (10|0x0200)
27 #define BIO_TYPE_BASE64 (11|0x0200)
28 #define BIO_TYPE_CONNECT (12|0x0400|0x0100)
29 #define BIO_TYPE_ACCEPT (13|0x0400|0x0100)
30 #define BIO_TYPE_PROXY_CLIENT (14|0x0200)
31 #define BIO_TYPE_PROXY_SERVER (15|0x0200)
32 #define BIO_TYPE_NBIO_TEST (16|0x0200)
33 #define BIO_TYPE_NULL_FILTER (17|0x0200)
34 #define BIO_TYPE_BER (18|0x0200)
35 #define BIO_TYPE_BIO (19|0x0400)
36
37 #define BIO_TYPE_DESCRIPTOR 0x0100
38 #define BIO_TYPE_FILTER 0x0200
39 #define BIO_TYPE_SOURCE_SINK 0x0400
40
41=head1 DESCRIPTION
42
43The BIO_find_type() searches for a BIO of a given type in a chain, starting
44at BIO B<b>. If B<type> is a specific type (such as BIO_TYPE_MEM) then a search
45is made for a BIO of that type. If B<type> is a general type (such as
46B<BIO_TYPE_SOURCE_SINK>) then the next matching BIO of the given general type is
47searched for. BIO_find_type() returns the next matching BIO or NULL if none is
48found.
49
50Note: not all the B<BIO_TYPE_*> types above have corresponding BIO implementations.
51
52BIO_next() returns the next BIO in a chain. It can be used to traverse all BIOs
53in a chain or used in conjunction with BIO_find_type() to find all BIOs of a
54certain type.
55
56BIO_method_type() returns the type of a BIO.
57
58=head1 RETURN VALUES
59
60BIO_find_type() returns a matching BIO or NULL for no match.
61
62BIO_next() returns the next BIO in a chain.
63
64BIO_method_type() returns the type of the BIO B<b>.
65
66=head1 NOTES
67
68BIO_next() was added to OpenSSL 0.9.6 to provide a 'clean' way to traverse a BIO
69chain or find multiple matches using BIO_find_type(). Previous versions had to
70use:
71
72 next = bio->next_bio;
73
74=head1 BUGS
75
76BIO_find_type() in OpenSSL 0.9.5a and earlier could not be safely passed a
77NULL pointer for the B<b> argument.
78
79=head1 EXAMPLE
80
81Traverse a chain looking for digest BIOs:
82
83 BIO *btmp;
84 btmp = in_bio; /* in_bio is chain to search through */
85
86 do {
87 btmp = BIO_find_type(btmp, BIO_TYPE_MD);
88 if(btmp == NULL) break; /* Not found */
89 /* btmp is a digest BIO, do something with it ...*/
90 ...
91
92 btmp = BIO_next(btmp);
93 } while(btmp);
94
95
96=head1 SEE ALSO
97
98TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_new.pod b/src/lib/libssl/src/doc/crypto/BIO_new.pod
new file mode 100644
index 0000000000..2a245fc8de
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_new.pod
@@ -0,0 +1,65 @@
1=pod
2
3=head1 NAME
4
5BIO_new, BIO_set, BIO_free, BIO_vfree, BIO_free_all - BIO allocation and freeing functions
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10
11 BIO * BIO_new(BIO_METHOD *type);
12 int BIO_set(BIO *a,BIO_METHOD *type);
13 int BIO_free(BIO *a);
14 void BIO_vfree(BIO *a);
15 void BIO_free_all(BIO *a);
16
17=head1 DESCRIPTION
18
19The BIO_new() function returns a new BIO using method B<type>.
20
21BIO_set() sets the method of an already existing BIO.
22
23BIO_free() frees up a single BIO, BIO_vfree() also frees up a single BIO
24but it does not return a value. Calling BIO_free() may also have some effect
25on the underlying I/O structure, for example it may close the file being
26referred to under certain circumstances. For more details see the individual
27BIO_METHOD descriptions.
28
29BIO_free_all() frees up an entire BIO chain, it does not halt if an error
30occurs freeing up an individual BIO in the chain.
31
32=head1 RETURN VALUES
33
34BIO_new() returns a newly created BIO or NULL if the call fails.
35
36BIO_set(), BIO_free() return 1 for success and 0 for failure.
37
38BIO_free_all() and BIO_vfree() do not return values.
39
40=head1 NOTES
41
42Some BIOs (such as memory BIOs) can be used immediately after calling
43BIO_new(). Others (such as file BIOs) need some additional initialization,
44and frequently a utility function exists to create and initialize such BIOs.
45
46If BIO_free() is called on a BIO chain it will only free one BIO resulting
47in a memory leak.
48
49Calling BIO_free_all() a single BIO has the same effect as calling BIO_free()
50on it other than the discarded return value.
51
52Normally the B<type> argument is supplied by a function which returns a
53pointer to a BIO_METHOD. There is a naming convention for such functions:
54a source/sink BIO is normally called BIO_s_*() and a filter BIO
55BIO_f_*();
56
57=head1 EXAMPLE
58
59Create a memory BIO:
60
61 BIO *mem = BIO_new(BIO_s_mem());
62
63=head1 SEE ALSO
64
65TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_new_bio_pair.pod b/src/lib/libssl/src/doc/crypto/BIO_new_bio_pair.pod
new file mode 100644
index 0000000000..2256ba9d34
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_new_bio_pair.pod
@@ -0,0 +1,102 @@
1=pod
2
3=head1 NAME
4
5BIO_new_bio_pair - create a new BIO pair
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10
11 int BIO_new_bio_pair(BIO **bio1, size_t writebuf1, BIO **bio2, size_t writebuf2);
12
13=head1 DESCRIPTION
14
15BIO_new_bio_pair() creates a buffering BIO pair. It has two endpoints between
16data can be buffered. Its typical use is to connect one endpoint as underlying
17input/output BIO to an SSL and access the other one controlled by the program
18instead of accessing the network connection directly.
19
20The two new BIOs B<bio1> and B<bio2> are symmetric with respect to their
21functionality. The size of their buffers is determined by B<writebuf1> and
22B<writebuf2>. If the size give is 0, the default size is used.
23
24BIO_new_bio_pair() does not check whether B<bio1> or B<bio2> do point to
25some other BIO, the values are overwritten, BIO_free() is not called.
26
27The two BIOs, even though forming a BIO pair and must be BIO_free()'ed
28separately. This can be of importance, as some SSL-functions like SSL_set_bio()
29or SSL_free() call BIO_free() implicitly, so that the peer-BIO is left
30untouched and must also be BIO_free()'ed.
31
32=head1 EXAMPLE
33
34The BIO pair can be used to have full control over the network access of an
35application. The application can call select() on the socket as required
36without having to go through the SSL-interface.
37
38 BIO *internal_bio, *network_bio;
39 ...
40 BIO_new_bio_pair(internal_bio, 0, network_bio, 0);
41 SSL_set_bio(ssl, internal_bio);
42 SSL_operations();
43 ...
44
45 application | TLS-engine
46 | |
47 +----------> SSL_operations()
48 | /\ ||
49 | || \/
50 | BIO-pair (internal_bio)
51 +----------< BIO-pair (network_bio)
52 | |
53 socket |
54
55 ...
56 SSL_free(ssl); /* implicitly frees internal_bio */
57 BIO_free(network_bio);
58 ...
59
60As the BIO pair will only buffer the data and never directly access the
61connection, it behaves non-blocking and will return as soon as the write
62buffer is full or the read buffer is drained. Then the application has to
63flush the write buffer and/or fill the read buffer.
64
65Use the BIO_ctrl_pending(), to find out whether data is buffered in the BIO
66and must be transfered to the network. Use BIO_ctrl_get_read_request() to
67find out, how many bytes must be written into the buffer before the
68SSL_operation() can successfully be continued.
69
70=head1 IMPORTANT
71
72As the data is buffered, SSL_operation() may return with a ERROR_SSL_WANT_READ
73condition, but there is still data in the write buffer. An application must
74not rely on the error value of SSL_operation() but must assure that the
75write buffer is always flushed first. Otherwise a deadlock may occur as
76the peer might be waiting for the data before being able to continue.
77
78=head1 RETURN VALUES
79
80The following return values can occur:
81
82=over 4
83
84=item 1
85
86The BIO pair was created successfully. The new BIOs are available in
87B<bio1> and B<bio2>.
88
89=item 0
90
91The operation failed. The NULL pointer is stored into the locations for
92B<bio1> and B<bio2>. Check the error stack for more information.
93
94=back
95
96=head1 SEE ALSO
97
98L<SSL_set_bio(3)|SSL_set_bio(3)>, L<ssl(3)|ssl(3)>, L<bio(3)|bio(3)>,
99L<BIO_ctrl_pending(3)|BIO_ctrl_pending(3)>,
100L<BIO_ctrl_get_read_request(3)|BIO_ctrl_get_read_request(3)>
101
102=cut
diff --git a/src/lib/libssl/src/doc/crypto/BIO_push.pod b/src/lib/libssl/src/doc/crypto/BIO_push.pod
new file mode 100644
index 0000000000..8af1d3c097
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_push.pod
@@ -0,0 +1,69 @@
1=pod
2
3=head1 NAME
4
5BIO_push, BIO_pop - add and remove BIOs from a chain.
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10
11 BIO * BIO_push(BIO *b,BIO *append);
12 BIO * BIO_pop(BIO *b);
13
14=head1 DESCRIPTION
15
16The BIO_push() function appends the BIO B<append> to B<b>, it returns
17B<b>.
18
19BIO_pop() removes the BIO B<b> from a chain and returns the next BIO
20in the chain, or NULL if there is no next BIO. The removed BIO then
21becomes a single BIO with no association with the original chain,
22it can thus be freed or attached to a different chain.
23
24=head1 NOTES
25
26The names of these functions are perhaps a little misleading. BIO_push()
27joins two BIO chains whereas BIO_pop() deletes a single BIO from a chain,
28the deleted BIO does not need to be at the end of a chain.
29
30The process of calling BIO_push() and BIO_pop() on a BIO may have additional
31consequences (a control call is made to the affected BIOs) any effects will
32be noted in the descriptions of individual BIOs.
33
34=head1 EXAMPLES
35
36For these examples suppose B<md1> and B<md2> are digest BIOs, B<b64> is
37a base64 BIO and B<f> is a file BIO.
38
39If the call:
40
41 BIO_push(b64, f);
42
43is made then the new chain will be B<b64-chain>. After making the calls
44
45 BIO_push(md2, b64);
46 BIO_push(md1, md2);
47
48the new chain is B<md1-md2-b64-f>. Data written to B<md1> will be digested
49by B<md1> and B<md2>, B<base64> encoded and written to B<f>.
50
51It should be noted that reading causes data to pass in the reverse
52direction, that is data is read from B<f>, base64 B<decoded> and digested
53by B<md1> and B<md2>. If the call:
54
55 BIO_pop(md2);
56
57The call will return B<b64> and the new chain will be B<md1-b64-f> data can
58be written to B<md1> as before.
59
60=head1 RETURN VALUES
61
62BIO_push() returns the end of the chain, B<b>.
63
64BIO_pop() returns the next BIO in the chain, or NULL if there is no next
65BIO.
66
67=head1 SEE ALSO
68
69TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_read.pod b/src/lib/libssl/src/doc/crypto/BIO_read.pod
new file mode 100644
index 0000000000..b34528104d
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_read.pod
@@ -0,0 +1,66 @@
1=pod
2
3=head1 NAME
4
5BIO_read, BIO_write, BIO_gets, BIO_puts - BIO I/O functions
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10
11 int BIO_read(BIO *b, void *buf, int len);
12 int BIO_gets(BIO *b,char *buf, int size);
13 int BIO_write(BIO *b, const void *buf, int len);
14 int BIO_puts(BIO *b,const char *buf);
15
16=head1 DESCRIPTION
17
18BIO_read() attempts to read B<len> bytes from BIO B<b> and places
19the data in B<buf>.
20
21BIO_gets() performs the BIOs "gets" operation and places the data
22in B<buf>. Usually this operation will attempt to read a line of data
23from the BIO of maximum length B<len>. There are exceptions to this
24however, for example BIO_gets() on a digest BIO will calculate and
25return the digest and other BIOs may not support BIO_gets() at all.
26
27BIO_write() attempts to write B<len> bytes from B<buf> to BIO B<b>.
28
29BIO_puts() attempts to write a null terminated string B<buf> to BIO B<b>
30
31=head1 RETURN VALUES
32
33All these functions return either the amount of data successfully read or
34written (if the return value is positive) or that no data was successfully
35read or written if the result is 0 or -1. If the return value is -2 then
36the operation is not implemented in the specific BIO type.
37
38=head1 NOTES
39
40A 0 or -1 return is not necessarily an indication of an error. In
41particular when the source/sink is non-blocking or of a certain type
42it may merely be an indication that no data is currently available and that
43the application should retry the operation later.
44
45One technique sometimes used with blocking sockets is to use a system call
46(such as select(), poll() or equivalent) to determine when data is available
47and then call read() to read the data. The equivalent with BIOs (that is call
48select() on the underlying I/O structure and then call BIO_read() to
49read the data) should B<not> be used because a single call to BIO_read()
50can cause several reads (and writes in the case of SSL BIOs) on the underlying
51I/O structure and may block as a result. Instead select() (or equivalent)
52should be combined with non blocking I/O so successive reads will request
53a retry instead of blocking.
54
55See L<BIO_should_retry(3)|BIO_should_retry(3)> for details of how to
56determine the cause of a retry and other I/O issues.
57
58If the BIO_gets() function is not supported by a BIO then it possible to
59work around this by adding a buffering BIO L<BIO_f_buffer(3)|BIO_f_buffer(3)>
60to the chain.
61
62=head1 SEE ALSO
63
64L<BIO_should_retry(3)|BIO_should_retry(3)>
65
66TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_s_accept.pod b/src/lib/libssl/src/doc/crypto/BIO_s_accept.pod
new file mode 100644
index 0000000000..c49da7fb02
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_s_accept.pod
@@ -0,0 +1,184 @@
1=pod
2
3=head1 NAME
4
5BIO_s_accept, BIO_set_nbio, BIO_set_accept_port, BIO_get_accept_port,
6BIO_set_nbio_accept, BIO_set_accept_bios, BIO_set_bind_mode,
7BIO_get_bind_mode, BIO_do_accept - accept BIO
8
9=head1 SYNOPSIS
10
11 #include <openssl/bio.h>
12
13 BIO_METHOD * BIO_s_accept(void);
14
15 #define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name)
16 #define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0)
17
18 BIO *BIO_new_accept(char *host_port);
19
20 #define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(n)?"a":NULL)
21 #define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(char *)bio)
22
23 #define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL)
24 #define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)
25
26 #define BIO_BIND_NORMAL 0
27 #define BIO_BIND_REUSEADDR_IF_UNUSED 1
28 #define BIO_BIND_REUSEADDR 2
29
30 #define BIO_do_accept(b) BIO_do_handshake(b)
31
32=head1 DESCRIPTION
33
34BIO_s_accept() returns the accept BIO method. This is a wrapper
35round the platform's TCP/IP socket accept routines.
36
37Using accept BIOs TCP/IP connections can be accepted and data
38transferred using only BIO routines. In this way any platform
39specific operations are hidden by the BIO abstraction.
40
41Read and write operations on an accept BIO will perform I/O
42on the underlying connection. If no connection is established
43and the port (see below) is set up properly then the BIO
44waits for an incoming connection.
45
46Accept BIOs support BIO_puts() but not BIO_gets().
47
48If the close flag is set on an accept BIO then any active
49connection on that chain is shutdown and the socket closed when
50the BIO is freed.
51
52Calling BIO_reset() on a accept BIO will close any active
53connection and reset the BIO into a state where it awaits another
54incoming connection.
55
56BIO_get_fd() and BIO_set_fd() can be called to retrieve or set
57the accept socket. See L<BIO_s_fd(3)|BIO_s_fd(3)>
58
59BIO_set_accept_port() uses the string B<name> to set the accept
60port. The port is represented as a string of the form "host:port",
61where "host" is the interface to use and "port" is the port.
62Either or both values can be "*" which is interpreted as meaning
63any interface or port respectively. "port" has the same syntax
64as the port specified in BIO_set_conn_port() for connect BIOs,
65that is it can be a numerical port string or a string to lookup
66using getservbyname() and a string table.
67
68BIO_new_accept() combines BIO_new() and BIO_set_accept_port() into
69a single call: that is it creates a new accept BIO with port
70B<host_port>.
71
72BIO_set_nbio_accept() sets the accept socket to blocking mode
73(the default) if B<n> is 0 or non blocking mode if B<n> is 1.
74
75BIO_set_accept_bios() can be used to set a chain of BIOs which
76will be duplicated and prepended to the chain when an incoming
77connection is received. This is useful if, for example, a
78buffering or SSL BIO is required for each connection. The
79chain of BIOs must not be freed after this call, they will
80be automatically freed when the accept BIO is freed.
81
82BIO_set_bind_mode() and BIO_get_bind_mode() set and retrieve
83the current bind mode. If BIO_BIND_NORMAL (the default) is set
84then another socket cannot be bound to the same port. If
85BIO_BIND_REUSEADDR is set then other sockets can bind to the
86same port. If BIO_BIND_REUSEADDR_IF_UNUSED is set then and
87attempt is first made to use BIO_BIN_NORMAL, if this fails
88and the port is not in use then a second attempt is made
89using BIO_BIND_REUSEADDR.
90
91BIO_do_accept() serves two functions. When it is first
92called, after the accept BIO has been setup, it will attempt
93to create the accept socket and bind an address to it. Second
94and subsequent calls to BIO_do_accept() will await an incoming
95connection.
96
97=head1 NOTES
98
99When an accept BIO is at the end of a chain it will await an
100incoming connection before processing I/O calls. When an accept
101BIO is not at then end of a chain it passes I/O calls to the next
102BIO in the chain.
103
104When a connection is established a new socket BIO is created for
105the connection and appended to the chain. That is the chain is now
106accept->socket. This effectively means that attempting I/O on
107an initial accept socket will await an incoming connection then
108perform I/O on it.
109
110If any additional BIOs have been set using BIO_set_accept_bios()
111then they are placed between the socket and the accept BIO,
112that is the chain will be accept->otherbios->socket.
113
114If a server wishes to process multiple connections (as is normally
115the case) then the accept BIO must be made available for further
116incoming connections. This can be done by waiting for a connection and
117then calling:
118
119 connection = BIO_pop(accept);
120
121After this call B<connection> will contain a BIO for the recently
122established connection and B<accept> will now be a single BIO
123again which can be used to await further incoming connections.
124If no further connections will be accepted the B<accept> can
125be freed using BIO_free().
126
127If only a single connection will be processed it is possible to
128perform I/O using the accept BIO itself. This is often undesirable
129however because the accept BIO will still accept additional incoming
130connections. This can be resolved by using BIO_pop() (see above)
131and freeing up the accept BIO after the initial connection.
132
133=head1 RETURN VALUES
134
135TBA
136
137=head1 EXAMPLE
138
139This example accepts two connections on port 4444, sends messages
140down each and finally closes both down.
141
142 BIO *abio, *cbio, *cbio2;
143 ERR_load_crypto_strings();
144 abio = BIO_new_accept("4444");
145
146 /* First call to BIO_accept() sets up accept BIO */
147 if(BIO_do_accept(abio) <= 0) {
148 fprintf(stderr, "Error setting up accept\n");
149 ERR_print_errors_fp(stderr);
150 exit(0);
151 }
152
153 /* Wait for incoming connection */
154 if(BIO_do_accept(abio) <= 0) {
155 fprintf(stderr, "Error accepting connection\n");
156 ERR_print_errors_fp(stderr);
157 exit(0);
158 }
159 fprintf(stderr, "Connection 1 established\n");
160 /* Retrieve BIO for connection */
161 cbio = BIO_pop(abio);
162 BIO_puts(cbio, "Connection 1: Sending out Data on initial connection\n");
163 fprintf(stderr, "Sent out data on connection 1\n");
164 /* Wait for another connection */
165 if(BIO_do_accept(abio) <= 0) {
166 fprintf(stderr, "Error accepting connection\n");
167 ERR_print_errors_fp(stderr);
168 exit(0);
169 }
170 fprintf(stderr, "Connection 2 established\n");
171 /* Close accept BIO to refuse further connections */
172 cbio2 = BIO_pop(abio);
173 BIO_free(abio);
174 BIO_puts(cbio2, "Connection 2: Sending out Data on second\n");
175 fprintf(stderr, "Sent out data on connection 2\n");
176
177 BIO_puts(cbio, "Connection 1: Second connection established\n");
178 /* Close the two established connections */
179 BIO_free(cbio);
180 BIO_free(cbio2);
181
182=head1 SEE ALSO
183
184TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_s_bio.pod b/src/lib/libssl/src/doc/crypto/BIO_s_bio.pod
new file mode 100644
index 0000000000..95ae802e47
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_s_bio.pod
@@ -0,0 +1,130 @@
1=pod
2
3=head1 NAME
4
5BIO_s_bio, BIO_make_bio_pair, BIO_destroy_bio_pair, BIO_shutdown_wr,
6BIO_set_write_buf_size, BIO_get_write_buf_size, BIO_new_bio_pair,
7BIO_get_write_guarantee, BIO_ctrl_get_write_guarantee, BIO_get_read_request,
8BIO_ctrl_get_read_request, BIO_ctrl_reset_read_request - BIO pair BIO
9
10=head1 SYNOPSIS
11
12 #include <openssl/bio.h>
13
14 BIO_METHOD *BIO_s_bio(void);
15
16 #define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2)
17 #define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL)
18
19 #define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL)
20
21 #define BIO_set_write_buf_size(b,size) (int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL)
22 #define BIO_get_write_buf_size(b,size) (size_t)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL)
23
24 int BIO_new_bio_pair(BIO **bio1, size_t writebuf1, BIO **bio2, size_t writebuf2);
25
26 #define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL)
27 size_t BIO_ctrl_get_write_guarantee(BIO *b);
28
29 #define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL)
30 size_t BIO_ctrl_get_read_request(BIO *b);
31
32 int BIO_ctrl_reset_read_request(BIO *b);
33
34=head1 DESCRIPTION
35
36BIO_s_bio() returns the method for a BIO pair. A BIO pair is a pair of source/sink
37BIOs where data written to either half of the pair is buffered and can be read from
38the other half. Both halves must usually by handled by the same application thread
39since no locking is done on the internal data structures.
40
41Since BIO chains typically end in a source/sink BIO it is possible to make this
42one half of a BIO pair and have all the data processed by the chain under application
43control.
44
45One typical use of BIO pairs is to place TLS/SSL I/O under application control, this
46can be used when the application wishes to use a non standard transport for
47TLS/SSL or the normal socket routines are inappropriate.
48
49Calls to BIO_read() will read data from the buffer or request a retry if no
50data is available.
51
52Calls to BIO_write() will place data in the buffer or request a retry if the
53buffer is full.
54
55The standard calls BIO_ctrl_pending() and BIO_ctrl_wpending() can be used to
56determine the amount of pending data in the read or write buffer.
57
58BIO_reset() clears any data in the write buffer.
59
60BIO_make_bio_pair() joins two separate BIOs into a connected pair.
61
62BIO_destroy_pair() destroys the association between two connected BIOs. Freeing
63up any half of the pair will automatically destroy the association.
64
65BIO_shutdown_wr() is used to close down a BIO B<b>. After this call no further
66writes on BIO B<b> are allowed (they will return an error). Reads on the other
67half of the pair will return any pending data or EOF when all pending data has
68been read.
69
70BIO_set_write_buf_size() sets the write buffer size of BIO B<b> to B<size>.
71If the size is not initialized a default value is used. This is currently
7217K, sufficient for a maximum size TLS record.
73
74BIO_get_write_buf_size() returns the size of the write buffer.
75
76BIO_new_bio_pair() combines the calls to BIO_new(), BIO_make_bio_pair() and
77BIO_set_write_buf_size() to create a connected pair of BIOs B<bio1>, B<bio2>
78with write buffer sizes B<writebuf1> and B<writebuf2>. If either size is
79zero then the default size is used.
80
81BIO_get_write_guarantee() and BIO_ctrl_get_write_guarantee() return the maximum
82length of data that can be currently written to the BIO. Writes larger than this
83value will return a value from BIO_write() less than the amount requested or if the
84buffer is full request a retry. BIO_ctrl_get_write_guarantee() is a function
85whereas BIO_get_write_guarantee() is a macro.
86
87BIO_get_read_request() and BIO_ctrl_get_read_request() return the
88amount of data requested, or the buffer size if it is less, if the
89last read attempt at the other half of the BIO pair failed due to an
90empty buffer. This can be used to determine how much data should be
91written to the BIO so the next read will succeed: this is most useful
92in TLS/SSL applications where the amount of data read is usually
93meaningful rather than just a buffer size. After a successful read
94this call will return zero. It also will return zero once new data
95has been written satisfying the read request or part of it.
96Note that BIO_get_read_request() never returns an amount larger
97than that returned by BIO_get_write_guarantee().
98
99BIO_ctrl_reset_read_request() can also be used to reset the value returned by
100BIO_get_read_request() to zero.
101
102=head1 NOTES
103
104Both halves of a BIO pair should be freed. That is even if one half is implicit
105freed due to a BIO_free_all() or SSL_free() call the other half needs to be freed.
106
107When used in bidirectional applications (such as TLS/SSL) care should be taken to
108flush any data in the write buffer. This can be done by calling BIO_pending()
109on the other half of the pair and, if any data is pending, reading it and sending
110it to the underlying transport. This must be done before any normal processing
111(such as calling select() ) due to a request and BIO_should_read() being true.
112
113To see why this is important consider a case where a request is sent using
114BIO_write() and a response read with BIO_read(), this can occur during an
115TLS/SSL handshake for example. BIO_write() will succeed and place data in the write
116buffer. BIO_read() will initially fail and BIO_should_read() will be true. If
117the application then waits for data to be available on the underlying transport
118before flushing the write buffer it will never succeed because the request was
119never sent!
120
121=head1 EXAMPLE
122
123TBA
124
125=head1 SEE ALSO
126
127L<SSL_set_bio(3)|SSL_set_bio(3)>, L<ssl(3)|ssl(3)>, L<bio(3)|bio(3)>,
128L<BIO_should_retry(3)|BIO_should_retry(3)>, L<BIO_read(3)|BIO_read(3)>
129
130=cut
diff --git a/src/lib/libssl/src/doc/crypto/BIO_s_connect.pod b/src/lib/libssl/src/doc/crypto/BIO_s_connect.pod
new file mode 100644
index 0000000000..fe1aa679d4
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_s_connect.pod
@@ -0,0 +1,182 @@
1=pod
2
3=head1 NAME
4
5BIO_s_connect, BIO_set_conn_hostname, BIO_set_conn_port,
6BIO_set_conn_ip, BIO_set_conn_int_port, BIO_get_conn_hostname,
7BIO_get_conn_port, BIO_get_conn_ip, BIO_get_conn_int_port,
8BIO_set_nbio, BIO_do_connect - connect BIO
9
10=head1 SYNOPSIS
11
12 #include <openssl/bio.h>
13
14 BIO_METHOD * BIO_s_connect(void);
15
16 #define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0,(char *)name)
17 #define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1,(char *)port)
18 #define BIO_set_conn_ip(b,ip) BIO_ctrl(b,BIO_C_SET_CONNECT,2,(char *)ip)
19 #define BIO_set_conn_int_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,3,(char *)port)
20 #define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0)
21 #define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1)
22 #define BIO_get_conn_ip(b,ip) BIO_ptr_ctrl(b,BIO_C_SET_CONNECT,2)
23 #define BIO_get_conn_int_port(b,port) BIO_int_ctrl(b,BIO_C_SET_CONNECT,3,port)
24
25 #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
26
27 #define BIO_do_connect(b) BIO_do_handshake(b)
28
29=head1 DESCRIPTION
30
31BIO_s_connect() returns the connect BIO method. This is a wrapper
32round the platform's TCP/IP socket connection routines.
33
34Using connect BIOs TCP/IP connections can be made and data
35transferred using only BIO routines. In this way any platform
36specific operations are hidden by the BIO abstraction.
37
38Read and write operations on a connect BIO will perform I/O
39on the underlying connection. If no connection is established
40and the port and hostname (see below) is set up properly then
41a connection is established first.
42
43Connect BIOs support BIO_puts() but not BIO_gets().
44
45If the close flag is set on a connect BIO then any active
46connection is shutdown and the socket closed when the BIO
47is freed.
48
49Calling BIO_reset() on a connect BIO will close any active
50connection and reset the BIO into a state where it can connect
51to the same host again.
52
53BIO_get_fd() places the underlying socket in B<c> if it is not NULL,
54it also returns the socket . If B<c> is not NULL it should be of
55type (int *).
56
57BIO_set_conn_hostname() uses the string B<name> to set the hostname
58The hostname can be an IP address. The hostname can also include the
59port in the form hostname:port . It is also acceptable to use the
60form "hostname/any/other/path" or "hostname:port/any/other/path".
61
62BIO_set_conn_port() sets the port to B<port>. B<port> can be the
63numerical form or a string such as "http". A string will be looked
64up first using getservbyname() on the host platform but if that
65fails a standard table of port names will be used. Currently the
66list is http, telnet, socks, https, ssl, ftp, gopher and wais.
67
68BIO_set_conn_ip() sets the IP address to B<ip> using binary form,
69that is four bytes specifying the IP address in big-endian form.
70
71BIO_set_conn_int_port() sets the port using B<port>. B<port> should
72be of type (int *).
73
74BIO_get_conn_hostname() returns the hostname of the connect BIO or
75NULL if the BIO is initialized but no hostname is set.
76This return value is an internal pointer which should not be modified.
77
78BIO_get_conn_port() returns the port as a string.
79
80BIO_get_conn_ip() returns the IP address in binary form.
81
82BIO_get_conn_int_port() returns the port as an int.
83
84BIO_set_nbio() sets the non blocking I/O flag to B<n>. If B<n> is
85zero then blocking I/O is set. If B<n> is 1 then non blocking I/O
86is set. Blocking I/O is the default. The call to BIO_set_nbio()
87should be made before the connection is established because
88non blocking I/O is set during the connect process.
89
90BIO_do_connect() attempts to connect the supplied BIO. It returns 1
91if the connection was established successfully. A zero or negative
92value is returned if the connection could not be established, the
93call BIO_should_retry() should be used for non blocking connect BIOs
94to determine if the call should be retried.
95
96=head1 NOTES
97
98If blocking I/O is set then a non positive return value from any
99I/O call is caused by an error condition, although a zero return
100will normally mean that the connection was closed.
101
102If the port name is supplied as part of the host name then this will
103override any value set with BIO_set_conn_port(). This may be undesirable
104if the application does not wish to allow connection to arbitrary
105ports. This can be avoided by checking for the presence of the ':'
106character in the passed hostname and either indicating an error or
107truncating the string at that point.
108
109The values returned by BIO_get_conn_hostname(), BIO_get_conn_port(),
110BIO_get_conn_ip() and BIO_get_conn_int_port() are updated when a
111connection attempt is made. Before any connection attempt the values
112returned are those set by the application itself.
113
114Applications do not have to call BIO_do_connect() but may wish to do
115so to separate the connection process from other I/O processing.
116
117If non blocking I/O is set then retries will be requested as appropriate.
118
119It addition to BIO_should_read() and BIO_should_write() it is also
120possible for BIO_should_io_special() to be true during the initial
121connection process with the reason BIO_RR_CONNECT. If this is returned
122then this is an indication that a connection attempt would block,
123the application should then take appropriate action to wait until
124the underlying socket has connected and retry the call.
125
126=head1 RETURN VALUES
127
128BIO_s_connect() returns the connect BIO method.
129
130BIO_get_fd() returns the socket or -1 if the BIO has not
131been initialized.
132
133BIO_set_conn_hostname(), BIO_set_conn_port(), BIO_set_conn_ip() and
134BIO_set_conn_int_port() always return 1.
135
136BIO_get_conn_hostname() returns the connected hostname or NULL is
137none was set.
138
139BIO_get_conn_port() returns a string representing the connected
140port or NULL if not set.
141
142BIO_get_conn_ip() returns a pointer to the connected IP address in
143binary form or all zeros if not set.
144
145BIO_get_conn_int_port() returns the connected port or 0 if none was
146set.
147
148BIO_set_nbio() always returns 1.
149
150BIO_do_connect() returns 1 if the connection was successfully
151established and 0 or -1 if the connection failed.
152
153=head1 EXAMPLE
154
155This is example connects to a webserver on the local host and attempts
156to retrieve a page and copy the result to standard output.
157
158
159 BIO *cbio, *out;
160 int len;
161 char tmpbuf[1024];
162 ERR_load_crypto_strings();
163 cbio = BIO_new_connect("localhost:http");
164 out = BIO_new_fp(stdout, BIO_NOCLOSE);
165 if(BIO_do_connect(cbio) <= 0) {
166 fprintf(stderr, "Error connecting to server\n");
167 ERR_print_errors_fp(stderr);
168 /* whatever ... */
169 }
170 BIO_puts(cbio, "GET / HTTP/1.0\n\n");
171 for(;;) {
172 len = BIO_read(cbio, tmpbuf, 1024);
173 if(len <= 0) break;
174 BIO_write(out, tmpbuf, len);
175 }
176 BIO_free(cbio);
177 BIO_free(out);
178
179
180=head1 SEE ALSO
181
182TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_s_fd.pod b/src/lib/libssl/src/doc/crypto/BIO_s_fd.pod
new file mode 100644
index 0000000000..b1de1d1015
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_s_fd.pod
@@ -0,0 +1,89 @@
1=pod
2
3=head1 NAME
4
5BIO_s_fd, BIO_set_fd, BIO_get_fd, BIO_new_fd - file descriptor BIO
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10
11 BIO_METHOD * BIO_s_fd(void);
12
13 #define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)
14 #define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c)
15
16 BIO *BIO_new_fd(int fd, int close_flag);
17
18=head1 DESCRIPTION
19
20BIO_s_fd() returns the file descriptor BIO method. This is a wrapper
21round the platforms file descriptor routines such as read() and write().
22
23BIO_read() and BIO_write() read or write the underlying descriptor.
24BIO_puts() is supported but BIO_gets() is not.
25
26If the close flag is set then then close() is called on the underlying
27file descriptor when the BIO is freed.
28
29BIO_reset() attempts to change the file pointer to the start of file
30using lseek(fd, 0, 0).
31
32BIO_seek() sets the file pointer to position B<ofs> from start of file
33using lseek(fd, ofs, 0).
34
35BIO_tell() returns the current file position by calling lseek(fd, 0, 1).
36
37BIO_set_fd() sets the file descriptor of BIO B<b> to B<fd> and the close
38flag to B<c>.
39
40BIO_get_fd() places the file descriptor in B<c> if it is not NULL, it also
41returns the file descriptor. If B<c> is not NULL it should be of type
42(int *).
43
44BIO_new_fd() returns a file descriptor BIO using B<fd> and B<close_flag>.
45
46=head1 NOTES
47
48The behaviour of BIO_read() and BIO_write() depends on the behavior of the
49platforms read() and write() calls on the descriptor. If the underlying
50file descriptor is in a non blocking mode then the BIO will behave in the
51manner described in the L<BIO_read(3)|BIO_read(3)> and L<BIO_should_retry(3)|BIO_should_retry(3)>
52manual pages.
53
54File descriptor BIOs should not be used for socket I/O. Use socket BIOs
55instead.
56
57=head1 RETURN VALUES
58
59BIO_s_fd() returns the file descriptor BIO method.
60
61BIO_reset() returns zero for success and -1 if an error occurred.
62BIO_seek() and BIO_tell() return the current file position or -1
63is an error occurred. These values reflect the underlying lseek()
64behaviour.
65
66BIO_set_fd() always returns 1.
67
68BIO_get_fd() returns the file descriptor or -1 if the BIO has not
69been initialized.
70
71BIO_new_fd() returns the newly allocated BIO or NULL is an error
72occurred.
73
74=head1 EXAMPLE
75
76This is a file descriptor BIO version of "Hello World":
77
78 BIO *out;
79 out = BIO_new_fd(fileno(stdout), BIO_NOCLOSE);
80 BIO_printf(out, "Hello World\n");
81 BIO_free(out);
82
83=head1 SEE ALSO
84
85L<BIO_seek(3)|BIO_seek(3)>, L<BIO_tell(3)|BIO_tell(3)>,
86L<BIO_reset(3)|BIO_reset(3)>, L<BIO_read(3)|BIO_read(3)>,
87L<BIO_write(3)|BIO_write(3)>, L<BIO_puts(3)|BIO_puts(3)>,
88L<BIO_gets(3)|BIO_gets(3)>, L<BIO_printf(3)|BIO_printf(3)>,
89L<BIO_set_close(3)|BIO_set_close(3)>, L<BIO_get_close(3)|BIO_get_close(3)>
diff --git a/src/lib/libssl/src/doc/crypto/BIO_s_file.pod b/src/lib/libssl/src/doc/crypto/BIO_s_file.pod
new file mode 100644
index 0000000000..b2a29263f4
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_s_file.pod
@@ -0,0 +1,144 @@
1=pod
2
3=head1 NAME
4
5BIO_s_file, BIO_new_file, BIO_new_fp, BIO_set_fp, BIO_get_fp,
6BIO_read_filename, BIO_write_filename, BIO_append_filename,
7BIO_rw_filename - FILE bio
8
9=head1 SYNOPSIS
10
11 #include <openssl/bio.h>
12
13 BIO_METHOD * BIO_s_file(void);
14 BIO *BIO_new_file(const char *filename, const char *mode);
15 BIO *BIO_new_fp(FILE *stream, int flags);
16
17 BIO_set_fp(BIO *b,FILE *fp, int flags);
18 BIO_get_fp(BIO *b,FILE **fpp);
19
20 int BIO_read_filename(BIO *b, char *name)
21 int BIO_write_filename(BIO *b, char *name)
22 int BIO_append_filename(BIO *b, char *name)
23 int BIO_rw_filename(BIO *b, char *name)
24
25=head1 DESCRIPTION
26
27BIO_s_file() returns the BIO file method. As its name implies it
28is a wrapper round the stdio FILE structure and it is a
29source/sink BIO.
30
31Calls to BIO_read() and BIO_write() read and write data to the
32underlying stream. BIO_gets() and BIO_puts() are supported on file BIOs.
33
34BIO_flush() on a file BIO calls the fflush() function on the wrapped
35stream.
36
37BIO_reset() attempts to change the file pointer to the start of file
38using fseek(stream, 0, 0).
39
40BIO_seek() sets the file pointer to position B<ofs> from start of file
41using fseek(stream, ofs, 0).
42
43BIO_eof() calls feof().
44
45Setting the BIO_CLOSE flag calls fclose() on the stream when the BIO
46is freed.
47
48BIO_new_file() creates a new file BIO with mode B<mode> the meaning
49of B<mode> is the same as the stdio function fopen(). The BIO_CLOSE
50flag is set on the returned BIO.
51
52BIO_new_fp() creates a file BIO wrapping B<stream>. Flags can be:
53BIO_CLOSE, BIO_NOCLOSE (the close flag) BIO_FP_TEXT (sets the underlying
54stream to text mode, default is binary: this only has any effect under
55Win32).
56
57BIO_set_fp() set the fp of a file BIO to B<fp>. B<flags> has the same
58meaning as in BIO_new_fp(), it is a macro.
59
60BIO_get_fp() retrieves the fp of a file BIO, it is a macro.
61
62BIO_seek() is a macro that sets the position pointer to B<offset> bytes
63from the start of file.
64
65BIO_tell() returns the value of the position pointer.
66
67BIO_read_filename(), BIO_write_filename(), BIO_append_filename() and
68BIO_rw_filename() set the file BIO B<b> to use file B<name> for
69reading, writing, append or read write respectively.
70
71=head1 NOTES
72
73When wrapping stdout, stdin or stderr the underlying stream should not
74normally be closed so the BIO_NOCLOSE flag should be set.
75
76Because the file BIO calls the underlying stdio functions any quirks
77in stdio behaviour will be mirrored by the corresponding BIO.
78
79=head1 EXAMPLES
80
81File BIO "hello world":
82
83 BIO *bio_out;
84 bio_out = BIO_new_fp(stdout, BIO_NOCLOSE);
85 BIO_printf(bio_out, "Hello World\n");
86
87Alternative technique:
88
89 BIO *bio_out;
90 bio_out = BIO_new(BIO_s_file());
91 if(bio_out == NULL) /* Error ... */
92 if(!BIO_set_fp(bio_out, stdout, BIO_NOCLOSE)) /* Error ... */
93 BIO_printf(bio_out, "Hello World\n");
94
95Write to a file:
96
97 BIO *out;
98 out = BIO_new_file("filename.txt", "w");
99 if(!out) /* Error occurred */
100 BIO_printf(out, "Hello World\n");
101 BIO_free(out);
102
103Alternative technique:
104
105 BIO *out;
106 out = BIO_new(BIO_s_file());
107 if(out == NULL) /* Error ... */
108 if(!BIO_write_filename(out, "filename.txt")) /* Error ... */
109 BIO_printf(out, "Hello World\n");
110 BIO_free(out);
111
112=head1 RETURN VALUES
113
114BIO_s_file() returns the file BIO method.
115
116BIO_new_file() and BIO_new_fp() return a file BIO or NULL if an error
117occurred.
118
119BIO_set_fp() and BIO_get_fp() return 1 for success or 0 for failure
120(although the current implementation never return 0).
121
122BIO_seek() returns the same value as the underlying fseek() function:
1230 for success or -1 for failure.
124
125BIO_tell() returns the current file position.
126
127BIO_read_filename(), BIO_write_filename(), BIO_append_filename() and
128BIO_rw_filename() return 1 for success or 0 for failure.
129
130=head1 BUGS
131
132BIO_reset() and BIO_seek() are implemented using fseek() on the underlying
133stream. The return value for fseek() is 0 for success or -1 if an error
134occurred this differs from other types of BIO which will typically return
1351 for success and a non positive value if an error occurred.
136
137=head1 SEE ALSO
138
139L<BIO_seek(3)|BIO_seek(3)>, L<BIO_tell(3)|BIO_tell(3)>,
140L<BIO_reset(3)|BIO_reset(3)>, L<BIO_flush(3)|BIO_flush(3)>,
141L<BIO_read(3)|BIO_read(3)>,
142L<BIO_write(3)|BIO_write(3)>, L<BIO_puts(3)|BIO_puts(3)>,
143L<BIO_gets(3)|BIO_gets(3)>, L<BIO_printf(3)|BIO_printf(3)>,
144L<BIO_set_close(3)|BIO_set_close(3)>, L<BIO_get_close(3)|BIO_get_close(3)>
diff --git a/src/lib/libssl/src/doc/crypto/BIO_s_mem.pod b/src/lib/libssl/src/doc/crypto/BIO_s_mem.pod
new file mode 100644
index 0000000000..19648acfae
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_s_mem.pod
@@ -0,0 +1,115 @@
1=pod
2
3=head1 NAME
4
5BIO_s_mem, BIO_set_mem_eof_return, BIO_get_mem_data, BIO_set_mem_buf,
6BIO_get_mem_ptr, BIO_new_mem_buf - memory BIO
7
8=head1 SYNOPSIS
9
10 #include <openssl/bio.h>
11
12 BIO_METHOD * BIO_s_mem(void);
13
14 BIO_set_mem_eof_return(BIO *b,int v)
15 long BIO_get_mem_data(BIO *b, char **pp)
16 BIO_set_mem_buf(BIO *b,BUF_MEM *bm,int c)
17 BIO_get_mem_ptr(BIO *b,BUF_MEM **pp)
18
19 BIO *BIO_new_mem_buf(void *buf, int len);
20
21=head1 DESCRIPTION
22
23BIO_s_mem() return the memory BIO method function.
24
25A memory BIO is a source/sink BIO which uses memory for its I/O. Data
26written to a memory BIO is stored in a BUF_MEM structure which is extended
27as appropriate to accommodate the stored data.
28
29Any data written to a memory BIO can be recalled by reading from it.
30Unless the memory BIO is read only any data read from it is deleted from
31the BIO.
32
33Memory BIOs support BIO_gets() and BIO_puts().
34
35If the BIO_CLOSE flag is set when a memory BIO is freed then the underlying
36BUF_MEM structure is also freed.
37
38Calling BIO_reset() on a read write memory BIO clears any data in it. On a
39read only BIO it restores the BIO to its original state and the read only
40data can be read again.
41
42BIO_eof() is true if no data is in the BIO.
43
44BIO_ctrl_pending() returns the number of bytes currently stored.
45
46BIO_set_mem_eof_return() sets the behaviour of memory BIO B<b> when it is
47empty. If the B<v> is zero then an empty memory BIO will return EOF (that is
48it will return zero and BIO_should_retry(b) will be false. If B<v> is non
49zero then it will return B<v> when it is empty and it will set the read retry
50flag (that is BIO_read_retry(b) is true). To avoid ambiguity with a normal
51positive return value B<v> should be set to a negative value, typically -1.
52
53BIO_get_mem_data() sets B<pp> to a pointer to the start of the memory BIOs data
54and returns the total amount of data available. It is implemented as a macro.
55
56BIO_set_mem_buf() sets the internal BUF_MEM structure to B<bm> and sets the
57close flag to B<c>, that is B<c> should be either BIO_CLOSE or BIO_NOCLOSE.
58It is a macro.
59
60BIO_get_mem_ptr() places the underlying BUF_MEM structure in B<pp>. It is
61a macro.
62
63BIO_new_mem_buf() creates a memory BIO using B<len> bytes of data at B<buf>,
64if B<len> is -1 then the B<buf> is assumed to be null terminated and its
65length is determined by B<strlen>. The BIO is set to a read only state and
66as a result cannot be written to. This is useful when some data needs to be
67made available from a static area of memory in the form of a BIO. The
68supplied data is read directly from the supplied buffer: it is B<not> copied
69first, so the supplied area of memory must be unchanged until the BIO is freed.
70
71=head1 NOTES
72
73Writes to memory BIOs will always succeed if memory is available: that is
74their size can grow indefinitely.
75
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
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
80a buffering BIO to the chain will speed up the process.
81
82=head1 BUGS
83
84There should be an option to set the maximum size of a memory BIO.
85
86There should be a way to "rewind" a read write BIO without destroying
87its contents.
88
89The copying operation should not occur after every small read of a large BIO
90to improve efficiency.
91
92=head1 EXAMPLE
93
94Create a memory BIO and write some data to it:
95
96 BIO *mem = BIO_new(BIO_s_mem());
97 BIO_puts(mem, "Hello World\n");
98
99Create a read only memory BIO:
100
101 char data[] = "Hello World";
102 BIO *mem;
103 mem = BIO_new_mem_buf(data, -1);
104
105Extract the BUF_MEM structure from a memory BIO and then free up the BIO:
106
107 BUF_MEM *bptr;
108 BIO_get_mem_ptr(mem, &bptr);
109 BIO_set_close(mem, BIO_NOCLOSE); /* So BIO_free() leaves BUF_MEM alone */
110 BIO_free(mem);
111
112
113=head1 SEE ALSO
114
115TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_s_null.pod b/src/lib/libssl/src/doc/crypto/BIO_s_null.pod
new file mode 100644
index 0000000000..e5514f7238
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_s_null.pod
@@ -0,0 +1,37 @@
1=pod
2
3=head1 NAME
4
5BIO_s_null - null data sink
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10
11 BIO_METHOD * BIO_s_null(void);
12
13=head1 DESCRIPTION
14
15BIO_s_null() returns the null sink BIO method. Data written to
16the null sink is discarded, reads return EOF.
17
18=head1 NOTES
19
20A null sink BIO behaves in a similar manner to the Unix /dev/null
21device.
22
23A null bio can be placed on the end of a chain to discard any data
24passed through it.
25
26A null sink is useful if, for example, an application wishes to digest some
27data by writing through a digest bio but not send the digested data anywhere.
28Since a BIO chain must normally include a source/sink BIO this can be achieved
29by adding a null sink BIO to the end of the chain
30
31=head1 RETURN VALUES
32
33BIO_s_null() returns the null sink BIO method.
34
35=head1 SEE ALSO
36
37TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_s_socket.pod b/src/lib/libssl/src/doc/crypto/BIO_s_socket.pod
new file mode 100644
index 0000000000..253185185c
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_s_socket.pod
@@ -0,0 +1,61 @@
1=pod
2
3=head1 NAME
4
5BIO_s_socket, BIO_new_socket - socket BIO
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10
11 BIO_METHOD * BIO_s_socket(void);
12
13 #define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)
14 #define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c)
15
16 BIO *BIO_new_socket(int sock, int close_flag);
17
18=head1 DESCRIPTION
19
20BIO_s_socket() returns the socket BIO method. This is a wrapper
21round the platform's socket routines.
22
23BIO_read() and BIO_write() read or write the underlying socket.
24BIO_puts() is supported but BIO_gets() is not.
25
26If the close flag is set then the socket is shut down and closed
27when the BIO is freed.
28
29BIO_set_fd() sets the socket of BIO B<b> to B<fd> and the close
30flag to B<c>.
31
32BIO_get_fd() places the socket in B<c> if it is not NULL, it also
33returns the socket . If B<c> is not NULL it should be of type (int *).
34
35BIO_new_socket() returns a socket BIO using B<sock> and B<close_flag>.
36
37=head1 NOTES
38
39Socket BIOs also support any relevant functionality of file descriptor
40BIOs.
41
42The reason for having separate file descriptor and socket BIOs is that on some
43platforms sockets are not file descriptors and use distinct I/O routines,
44Windows is one such platform. Any code mixing the two will not work on
45all platforms.
46
47=head1 RETURN VALUES
48
49BIO_s_socket() returns the socket BIO method.
50
51BIO_set_fd() always returns 1.
52
53BIO_get_fd() returns the socket or -1 if the BIO has not been
54initialized.
55
56BIO_new_socket() returns the newly allocated BIO or NULL is an error
57occurred.
58
59=head1 SEE ALSO
60
61TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_set_callback.pod b/src/lib/libssl/src/doc/crypto/BIO_set_callback.pod
new file mode 100644
index 0000000000..9b6961ca8d
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_set_callback.pod
@@ -0,0 +1,108 @@
1=pod
2
3=head1 NAME
4
5BIO_set_callback, BIO_get_callback, BIO_set_callback_arg, BIO_get_callback_arg,
6BIO_debug_callback - BIO callback functions
7
8=head1 SYNOPSIS
9
10 #include <openssl/bio.h>
11
12 #define BIO_set_callback(b,cb) ((b)->callback=(cb))
13 #define BIO_get_callback(b) ((b)->callback)
14 #define BIO_set_callback_arg(b,arg) ((b)->cb_arg=(char *)(arg))
15 #define BIO_get_callback_arg(b) ((b)->cb_arg)
16
17 long BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi,
18 long argl,long ret);
19
20 typedef long callback(BIO *b, int oper, const char *argp,
21 int argi, long argl, long retvalue);
22
23=head1 DESCRIPTION
24
25BIO_set_callback() and BIO_get_callback() set and retrieve the BIO callback,
26they are both macros. The callback is called during most high level BIO
27operations. It can be used for debugging purposes to trace operations on
28a BIO or to modify its operation.
29
30BIO_set_callback_arg() and BIO_get_callback_arg() are macros which can be
31used to set and retrieve an argument for use in the callback.
32
33BIO_debug_callback() is a standard debugging callback which prints
34out information relating to each BIO operation. If the callback
35argument is set if is interpreted as a BIO to send the information
36to, otherwise stderr is used.
37
38callback() is the callback function itself. The meaning of each
39argument is described below.
40
41The BIO the callback is attached to is passed in B<b>.
42
43B<oper> is set to the operation being performed. For some operations
44the callback is called twice, once before and once after the actual
45operation, the latter case has B<oper> or'ed with BIO_CB_RETURN.
46
47The meaning of the arguments B<argp>, B<argi> and B<argl> depends on
48the value of B<oper>, that is the operation being performed.
49
50B<retvalue> is the return value that would be returned to the
51application if no callback were present. The actual value returned
52is the return value of the callback itself. In the case of callbacks
53called before the actual BIO operation 1 is placed in retvalue, if
54the return value is not positive it will be immediately returned to
55the application and the BIO operation will not be performed.
56
57The callback should normally simply return B<retvalue> when it has
58finished processing, unless if specifically wishes to modify the
59value returned to the application.
60
61=head1 CALLBACK OPERATIONS
62
63=over 4
64
65=item B<BIO_free(b)>
66
67callback(b, BIO_CB_FREE, NULL, 0L, 0L, 1L) is called before the
68free operation.
69
70=item B<BIO_read(b, out, outl)>
71
72callback(b, BIO_CB_READ, out, outl, 0L, 1L) is called before
73the read and callback(b, BIO_CB_READ|BIO_CB_RETURN, out, outl, 0L, retvalue)
74after.
75
76=item B<BIO_write(b, in, inl)>
77
78callback(b, BIO_CB_WRITE, in, inl, 0L, 1L) is called before
79the write and callback(b, BIO_CB_WRITE|BIO_CB_RETURN, in, inl, 0L, retvalue)
80after.
81
82=item B<BIO_gets(b, out, outl)>
83
84callback(b, BIO_CB_GETS, out, outl, 0L, 1L) is called before
85the operation and callback(b, BIO_CB_GETS|BIO_CB_RETURN, out, outl, 0L, retvalue)
86after.
87
88=item B<BIO_puts(b, in)>
89
90callback(b, BIO_CB_WRITE, in, 0, 0L, 1L) is called before
91the operation and callback(b, BIO_CB_WRITE|BIO_CB_RETURN, in, 0, 0L, retvalue)
92after.
93
94=item B<BIO_ctrl(BIO *b, int cmd, long larg, void *parg)>
95
96callback(b,BIO_CB_CTRL,parg,cmd,larg,1L) is called before the call and
97callback(b,BIO_CB_CTRL|BIO_CB_RETURN,parg,cmd, larg,ret) after.
98
99=back
100
101=head1 EXAMPLE
102
103The BIO_debug_callback() function is a good example, its source is
104in crypto/bio/bio_cb.c
105
106=head1 SEE ALSO
107
108TBA
diff --git a/src/lib/libssl/src/doc/crypto/BIO_should_retry.pod b/src/lib/libssl/src/doc/crypto/BIO_should_retry.pod
new file mode 100644
index 0000000000..539c391272
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/BIO_should_retry.pod
@@ -0,0 +1,114 @@
1=pod
2
3=head1 NAME
4
5BIO_should_retry, BIO_should_read, BIO_should_write,
6BIO_should_io_special, BIO_retry_type, BIO_should_retry,
7BIO_get_retry_BIO, BIO_get_retry_reason - BIO retry functions
8
9=head1 SYNOPSIS
10
11 #include <openssl/bio.h>
12
13 #define BIO_should_read(a) ((a)->flags & BIO_FLAGS_READ)
14 #define BIO_should_write(a) ((a)->flags & BIO_FLAGS_WRITE)
15 #define BIO_should_io_special(a) ((a)->flags & BIO_FLAGS_IO_SPECIAL)
16 #define BIO_retry_type(a) ((a)->flags & BIO_FLAGS_RWS)
17 #define BIO_should_retry(a) ((a)->flags & BIO_FLAGS_SHOULD_RETRY)
18
19 #define BIO_FLAGS_READ 0x01
20 #define BIO_FLAGS_WRITE 0x02
21 #define BIO_FLAGS_IO_SPECIAL 0x04
22 #define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
23 #define BIO_FLAGS_SHOULD_RETRY 0x08
24
25 BIO * BIO_get_retry_BIO(BIO *bio, int *reason);
26 int BIO_get_retry_reason(BIO *bio);
27
28=head1 DESCRIPTION
29
30These functions determine why a BIO is not able to read or write data.
31They will typically be called after a failed BIO_read() or BIO_write()
32call.
33
34BIO_should_retry() is true if the call that produced this condition
35should then be retried at a later time.
36
37If BIO_should_retry() is false then the cause is an error condition.
38
39BIO_should_read() is true if the cause of the condition is that a BIO
40needs to read data.
41
42BIO_should_write() is true if the cause of the condition is that a BIO
43needs to read data.
44
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.
47
48BIO_get_retry_reason() returns a mask of the cause of a retry condition
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
51these.
52
53BIO_get_retry_BIO() determines the precise reason for the special
54condition, it returns the BIO that caused this condition and if
55B<reason> is not NULL it contains the reason code. The meaning of
56the reason code and the action that should be taken depends on
57the type of BIO that resulted in this condition.
58
59BIO_get_retry_reason() returns the reason for a special condition if
60passed the relevant BIO, for example as returned by BIO_get_retry_BIO().
61
62=head1 NOTES
63
64If BIO_should_retry() returns false then the precise "error condition"
65depends on the BIO type that caused it and the return code of the BIO
66operation. For example if a call to BIO_read() on a socket BIO returns
670 and BIO_should_retry() is false then the cause will be that the
68connection closed. A similar condition on a file BIO will mean that it
69has reached EOF. Some BIO types may place additional information on
70the error queue. For more details see the individual BIO type manual
71pages.
72
73If the underlying I/O structure is in a blocking mode almost all current
74BIO types will not request a retry, because the underlying I/O
75calls will not. If the application knows that the BIO type will never
76signal a retry then it need not call BIO_should_retry() after a failed
77BIO I/O call. This is typically done with file BIOs.
78
79SSL BIOs are the only current exception to this rule: they can request a
80retry even if the underlying I/O structure is blocking, if a handshake
81occurs during a call to BIO_read(). An application can retry the failed
82call immediately or avoid this situation by setting SSL_MODE_AUTO_RETRY
83on the underlying SSL structure.
84
85While an application may retry a failed non blocking call immediately
86this is likely to be very inefficient because the call will fail
87repeatedly until data can be processed or is available. An application
88will normally wait until the necessary condition is satisfied. How
89this is done depends on the underlying I/O structure.
90
91For example if the cause is ultimately a socket and BIO_should_read()
92is true then a call to select() may be made to wait until data is
93available and then retry the BIO operation. By combining the retry
94conditions of several non blocking BIOs in a single select() call
95it is possible to service several BIOs in a single thread, though
96the performance may be poor if SSL BIOs are present because long delays
97can occur during the initial handshake process.
98
99It is possible for a BIO to block indefinitely if the underlying I/O
100structure cannot process or return any data. This depends on the behaviour of
101the platforms I/O functions. This is often not desirable: one solution
102is to use non blocking I/O and use a timeout on the select() (or
103equivalent) call.
104
105=head1 BUGS
106
107The OpenSSL ASN1 functions cannot gracefully deal with non blocking I/O:
108that is they cannot retry after a partial read or write. This is usually
109worked around by only passing the relevant data to ASN1 functions when
110the entire structure can be read or written.
111
112=head1 SEE ALSO
113
114TBA
diff --git a/src/lib/libssl/src/doc/crypto/BN_CTX_start.pod b/src/lib/libssl/src/doc/crypto/BN_CTX_start.pod
index c30552b122..dfcefe1a88 100644
--- a/src/lib/libssl/src/doc/crypto/BN_CTX_start.pod
+++ b/src/lib/libssl/src/doc/crypto/BN_CTX_start.pod
@@ -17,7 +17,8 @@ BN_CTX_start, BN_CTX_get, BN_CTX_end - use temporary BIGNUM variables
17=head1 DESCRIPTION 17=head1 DESCRIPTION
18 18
19These functions are used to obtain temporary B<BIGNUM> variables from 19These functions are used to obtain temporary B<BIGNUM> variables from
20a B<BN_CTX> in order to save the overhead of repeatedly creating and 20a B<BN_CTX> (which can been created by using L<BN_CTX_new(3)|BN_CTX_new(3)>)
21in order to save the overhead of repeatedly creating and
21freeing B<BIGNUM>s in functions that are called from inside a loop. 22freeing B<BIGNUM>s in functions that are called from inside a loop.
22 23
23A function must call BN_CTX_start() first. Then, BN_CTX_get() may be 24A function must call BN_CTX_start() first. Then, BN_CTX_get() may be
diff --git a/src/lib/libssl/src/doc/crypto/BN_bn2bin.pod b/src/lib/libssl/src/doc/crypto/BN_bn2bin.pod
index ca77f0d61b..4f78574ed0 100644
--- a/src/lib/libssl/src/doc/crypto/BN_bn2bin.pod
+++ b/src/lib/libssl/src/doc/crypto/BN_bn2bin.pod
@@ -36,7 +36,7 @@ NULL, a new B<BIGNUM> is created.
36BN_bn2hex() and BN_bn2dec() return printable strings containing the 36BN_bn2hex() and BN_bn2dec() return printable strings containing the
37hexadecimal and decimal encoding of B<a> respectively. For negative 37hexadecimal and decimal encoding of B<a> respectively. For negative
38numbers, the string is prefaced with a leading '-'. The string must be 38numbers, the string is prefaced with a leading '-'. The string must be
39Free()d later. 39freed later using OPENSSL_free().
40 40
41BN_hex2bn() converts the string B<str> containing a hexadecimal number 41BN_hex2bn() converts the string B<str> containing a hexadecimal number
42to a B<BIGNUM> and stores it in **B<bn>. If *B<bn> is NULL, a new 42to a B<BIGNUM> and stores it in **B<bn>. If *B<bn> is NULL, a new
diff --git a/src/lib/libssl/src/doc/crypto/BN_mod_mul_montgomery.pod b/src/lib/libssl/src/doc/crypto/BN_mod_mul_montgomery.pod
index 3ec6f6172b..f3cee924b9 100644
--- a/src/lib/libssl/src/doc/crypto/BN_mod_mul_montgomery.pod
+++ b/src/lib/libssl/src/doc/crypto/BN_mod_mul_montgomery.pod
@@ -39,7 +39,7 @@ BN_MONT_CTX_init() initializes an existing uninitialized B<BN_MONT_CTX>.
39BN_MONT_CTX_set() sets up the B<mont> structure from the modulus B<m> 39BN_MONT_CTX_set() sets up the B<mont> structure from the modulus B<m>
40by precomputing its inverse and a value R. 40by precomputing its inverse and a value R.
41 41
42BN_MONT_CTX_copy() copies the B<N_MONT_CTX> B<from> to B<to>. 42BN_MONT_CTX_copy() copies the B<BN_MONT_CTX> B<from> to B<to>.
43 43
44BN_MONT_CTX_free() frees the components of the B<BN_MONT_CTX>, and, if 44BN_MONT_CTX_free() frees the components of the B<BN_MONT_CTX>, and, if
45it was created by BN_MONT_CTX_new(), also the structure itself. 45it was created by BN_MONT_CTX_new(), also the structure itself.
@@ -49,7 +49,7 @@ the result in B<r>.
49 49
50BN_from_montgomery() performs the Montgomery reduction B<r> = B<a>*R^-1. 50BN_from_montgomery() performs the Montgomery reduction B<r> = B<a>*R^-1.
51 51
52BN_to_montgomery() computes Mont(B<a>,R^2). 52BN_to_montgomery() computes Mont(B<a>,R^2), i.e. B<a>*R.
53 53
54For all functions, B<ctx> is a previously allocated B<BN_CTX> used for 54For all functions, B<ctx> is a previously allocated B<BN_CTX> used for
55temporary variables. 55temporary variables.
diff --git a/src/lib/libssl/src/doc/crypto/BN_mod_mul_reciprocal.pod b/src/lib/libssl/src/doc/crypto/BN_mod_mul_reciprocal.pod
index 38034bba14..74a216ddc2 100644
--- a/src/lib/libssl/src/doc/crypto/BN_mod_mul_reciprocal.pod
+++ b/src/lib/libssl/src/doc/crypto/BN_mod_mul_reciprocal.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5BN_mod_mul_reciprocal, BN_RECP_CTX_new, BN_RECP_CTX_init, 5BN_mod_mul_reciprocal, BN_div_recp, BN_RECP_CTX_new, BN_RECP_CTX_init,
6BN_RECP_CTX_free, BN_RECP_CTX_set - modular multiplication using 6BN_RECP_CTX_free, BN_RECP_CTX_set - modular multiplication using
7reciprocal 7reciprocal
8 8
diff --git a/src/lib/libssl/src/doc/crypto/BN_zero.pod b/src/lib/libssl/src/doc/crypto/BN_zero.pod
index 165fd9a228..2f33876498 100644
--- a/src/lib/libssl/src/doc/crypto/BN_zero.pod
+++ b/src/lib/libssl/src/doc/crypto/BN_zero.pod
@@ -2,7 +2,8 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5BN_zero, BN_one, BN_set_word, BN_get_word - BIGNUM assignment operations 5BN_zero, BN_one, BN_value_one, BN_set_word, BN_get_word - BIGNUM assignment
6operations
6 7
7=head1 SYNOPSIS 8=head1 SYNOPSIS
8 9
diff --git a/src/lib/libssl/src/doc/crypto/DH_set_method.pod b/src/lib/libssl/src/doc/crypto/DH_set_method.pod
index a8f75bdd9d..62088eea1b 100644
--- a/src/lib/libssl/src/doc/crypto/DH_set_method.pod
+++ b/src/lib/libssl/src/doc/crypto/DH_set_method.pod
@@ -2,20 +2,21 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5DH_set_default_method, DH_get_default_method, DH_set_method, 5DH_set_default_openssl_method, DH_get_default_openssl_method,
6DH_new_method, DH_OpenSSL - select DH method 6DH_set_method, DH_new_method, DH_OpenSSL - select DH method
7 7
8=head1 SYNOPSIS 8=head1 SYNOPSIS
9 9
10 #include <openssl/dh.h> 10 #include <openssl/dh.h>
11 #include <openssl/engine.h>
11 12
12 void DH_set_default_method(DH_METHOD *meth); 13 void DH_set_default_openssl_method(DH_METHOD *meth);
13 14
14 DH_METHOD *DH_get_default_method(void); 15 DH_METHOD *DH_get_default_openssl_method(void);
15 16
16 DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth); 17 int DH_set_method(DH *dh, ENGINE *engine);
17 18
18 DH *DH_new_method(DH_METHOD *meth); 19 DH *DH_new_method(ENGINE *engine);
19 20
20 DH_METHOD *DH_OpenSSL(void); 21 DH_METHOD *DH_OpenSSL(void);
21 22
@@ -28,20 +29,26 @@ such as hardware accelerators may be used.
28Initially, the default is to use the OpenSSL internal implementation. 29Initially, the default is to use the OpenSSL internal implementation.
29DH_OpenSSL() returns a pointer to that method. 30DH_OpenSSL() returns a pointer to that method.
30 31
31DH_set_default_method() makes B<meth> the default method for all B<DH> 32DH_set_default_openssl_method() makes B<meth> the default method for all DH
32structures created later. 33structures created later. B<NB:> This is true only whilst the default engine
34for Diffie-Hellman operations remains as "openssl". ENGINEs provide an
35encapsulation for implementations of one or more algorithms, and all the DH
36functions mentioned here operate within the scope of the default
37"openssl" engine.
33 38
34DH_get_default_method() returns a pointer to the current default 39DH_get_default_openssl_method() returns a pointer to the current default
35method. 40method for the "openssl" engine.
36 41
37DH_set_method() selects B<meth> for all operations using the structure B<dh>. 42DH_set_method() selects B<engine> as the engine that will be responsible for
43all operations using the structure B<dh>. If this function completes successfully,
44then the B<dh> structure will have its own functional reference of B<engine>, so
45the caller should remember to free their own reference to B<engine> when they are
46finished with it. NB: An ENGINE's DH_METHOD can be retrieved (or set) by
47ENGINE_get_DH() or ENGINE_set_DH().
38 48
39DH_get_method() returns a pointer to the method currently selected 49DH_new_method() allocates and initializes a DH structure so that
40for B<dh>. 50B<engine> will be used for the DH operations. If B<engine> is NULL,
41 51the default engine for Diffie-Hellman opertaions is used.
42DH_new_method() allocates and initializes a B<DH> structure so that
43B<method> will be used for the DH operations. If B<method> is B<NULL>,
44the default method is used.
45 52
46=head1 THE DH_METHOD STRUCTURE 53=head1 THE DH_METHOD STRUCTURE
47 54
@@ -75,17 +82,17 @@ the default method is used.
75 82
76=head1 RETURN VALUES 83=head1 RETURN VALUES
77 84
78DH_OpenSSL(), DH_get_default_method() and DH_get_method() return 85DH_OpenSSL() and DH_get_default_method() return pointers to the respective
79pointers to the respective B<DH_METHOD>s. 86DH_METHODs.
80 87
81DH_set_default_method() returns no value. 88DH_set_default_openssl_method() returns no value.
82 89
83DH_set_method() returns a pointer to the B<DH_METHOD> previously 90DH_set_method() returns non-zero if the ENGINE associated with B<dh>
84associated with B<dh>. 91was successfully changed to B<engine>.
85 92
86DH_new_method() returns B<NULL> and sets an error code that can be 93DH_new_method() returns NULL and sets an error code that can be
87obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise it 94obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails.
88returns a pointer to the newly allocated structure. 95Otherwise it returns a pointer to the newly allocated structure.
89 96
90=head1 SEE ALSO 97=head1 SEE ALSO
91 98
@@ -96,4 +103,9 @@ L<dh(3)|dh(3)>, L<DH_new(3)|DH_new(3)>
96DH_set_default_method(), DH_get_default_method(), DH_set_method(), 103DH_set_default_method(), DH_get_default_method(), DH_set_method(),
97DH_new_method() and DH_OpenSSL() were added in OpenSSL 0.9.4. 104DH_new_method() and DH_OpenSSL() were added in OpenSSL 0.9.4.
98 105
106DH_set_default_openssl_method() and DH_get_default_openssl_method()
107replaced DH_set_default_method() and DH_get_default_method() respectively,
108and DH_set_method() and DH_new_method() were altered to use B<ENGINE>s
109rather than B<DH_METHOD>s during development of OpenSSL 0.9.6.
110
99=cut 111=cut
diff --git a/src/lib/libssl/src/doc/crypto/DSA_set_method.pod b/src/lib/libssl/src/doc/crypto/DSA_set_method.pod
index edec46413d..c56dfd0f47 100644
--- a/src/lib/libssl/src/doc/crypto/DSA_set_method.pod
+++ b/src/lib/libssl/src/doc/crypto/DSA_set_method.pod
@@ -2,20 +2,21 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5DSA_set_default_method, DSA_get_default_method, DSA_set_method, 5DSA_set_default_openssl_method, DSA_get_default_openssl_method,
6DSA_new_method, DSA_OpenSSL - select RSA method 6DSA_set_method, DSA_new_method, DSA_OpenSSL - select DSA method
7 7
8=head1 SYNOPSIS 8=head1 SYNOPSIS
9 9
10 #include <openssl/DSA.h> 10 #include <openssl/dsa.h>
11 #include <openssl/engine.h>
11 12
12 void DSA_set_default_method(DSA_METHOD *meth); 13 void DSA_set_default_openssl_method(DSA_METHOD *meth);
13 14
14 DSA_METHOD *DSA_get_default_method(void); 15 DSA_METHOD *DSA_get_default_openssl_method(void);
15 16
16 DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth); 17 int DSA_set_method(DSA *dsa, ENGINE *engine);
17 18
18 DSA *DSA_new_method(DSA_METHOD *meth); 19 DSA *DSA_new_method(ENGINE *engine);
19 20
20 DSA_METHOD *DSA_OpenSSL(void); 21 DSA_METHOD *DSA_OpenSSL(void);
21 22
@@ -28,20 +29,21 @@ such as hardware accelerators may be used.
28Initially, the default is to use the OpenSSL internal implementation. 29Initially, the default is to use the OpenSSL internal implementation.
29DSA_OpenSSL() returns a pointer to that method. 30DSA_OpenSSL() returns a pointer to that method.
30 31
31DSA_set_default_method() makes B<meth> the default method for all B<DSA> 32DSA_set_default_openssl_method() makes B<meth> the default method for
32structures created later. 33all DSA structures created later. B<NB:> This is true only whilst the
34default engine for DSA operations remains as "openssl". ENGINEs
35provide an encapsulation for implementations of one or more algorithms at a
36time, and all the DSA functions mentioned here operate within the scope
37of the default "openssl" engine.
33 38
34DSA_get_default_method() returns a pointer to the current default 39DSA_get_default_openssl_method() returns a pointer to the current default
35method. 40method for the "openssl" engine.
36 41
37DSA_set_method() selects B<meth> for all operations using the structure B<DSA>. 42DSA_set_method() selects B<engine> for all operations using the structure B<dsa>.
38 43
39DSA_get_method() returns a pointer to the method currently selected 44DSA_new_method() allocates and initializes a DSA structure so that
40for B<DSA>. 45B<engine> will be used for the DSA operations. If B<engine> is NULL,
41 46the default engine for DSA operations is used.
42DSA_new_method() allocates and initializes a B<DSA> structure so that
43B<method> will be used for the DSA operations. If B<method> is B<NULL>,
44the default method is used.
45 47
46=head1 THE DSA_METHOD STRUCTURE 48=head1 THE DSA_METHOD STRUCTURE
47 49
@@ -87,18 +89,17 @@ struct
87 89
88=head1 RETURN VALUES 90=head1 RETURN VALUES
89 91
90DSA_OpenSSL(), DSA_get_default_method() and DSA_get_method() return 92DSA_OpenSSL() and DSA_get_default_openssl_method() return pointers to the
91pointers to the respective B<DSA_METHOD>s. 93respective DSA_METHODs.
92 94
93DSA_set_default_method() returns no value. 95DSA_set_default_openssl_method() returns no value.
94 96
95DSA_set_method() returns a pointer to the B<DSA_METHOD> previously 97DSA_set_method() returns non-zero if the ENGINE associated with B<dsa>
96associated with B<dsa>. 98was successfully changed to B<engine>.
97 99
98DSA_new_method() returns B<NULL> and sets an error code that can be 100DSA_new_method() returns NULL and sets an error code that can be
99obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation 101obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation
100fails. Otherwise it returns a pointer to the newly allocated 102fails. Otherwise it returns a pointer to the newly allocated structure.
101structure.
102 103
103=head1 SEE ALSO 104=head1 SEE ALSO
104 105
@@ -109,4 +110,9 @@ L<dsa(3)|dsa(3)>, L<DSA_new(3)|DSA_new(3)>
109DSA_set_default_method(), DSA_get_default_method(), DSA_set_method(), 110DSA_set_default_method(), DSA_get_default_method(), DSA_set_method(),
110DSA_new_method() and DSA_OpenSSL() were added in OpenSSL 0.9.4. 111DSA_new_method() and DSA_OpenSSL() were added in OpenSSL 0.9.4.
111 112
113DSA_set_default_openssl_method() and DSA_get_default_openssl_method()
114replaced DSA_set_default_method() and DSA_get_default_method() respectively,
115and DSA_set_method() and DSA_new_method() were altered to use B<ENGINE>s
116rather than B<DSA_METHOD>s during development of OpenSSL 0.9.6.
117
112=cut 118=cut
diff --git a/src/lib/libssl/src/doc/crypto/ERR_error_string.pod b/src/lib/libssl/src/doc/crypto/ERR_error_string.pod
index 0d2417599c..e01beb817a 100644
--- a/src/lib/libssl/src/doc/crypto/ERR_error_string.pod
+++ b/src/lib/libssl/src/doc/crypto/ERR_error_string.pod
@@ -2,13 +2,16 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5ERR_error_string - obtain human-readable error message 5ERR_error_string, ERR_error_string_n, ERR_lib_error_string,
6ERR_func_error_string, ERR_reason_error_string - obtain human-readable
7error message
6 8
7=head1 SYNOPSIS 9=head1 SYNOPSIS
8 10
9 #include <openssl/err.h> 11 #include <openssl/err.h>
10 12
11 char *ERR_error_string(unsigned long e, char *buf); 13 char *ERR_error_string(unsigned long e, char *buf);
14 char *ERR_error_string_n(unsigned long e, char *buf, size_t len);
12 15
13 const char *ERR_lib_error_string(unsigned long e); 16 const char *ERR_lib_error_string(unsigned long e);
14 const char *ERR_func_error_string(unsigned long e); 17 const char *ERR_func_error_string(unsigned long e);
@@ -17,9 +20,13 @@ ERR_error_string - obtain human-readable error message
17=head1 DESCRIPTION 20=head1 DESCRIPTION
18 21
19ERR_error_string() generates a human-readable string representing the 22ERR_error_string() generates a human-readable string representing the
20error code B<e>, and places it at B<buf>. B<buf> must be at least 120 23error code I<e>, and places it at I<buf>. I<buf> must be at least 120
21bytes long. If B<buf> is B<NULL>, the error string is placed in a 24bytes long. If I<buf> is B<NULL>, the error string is placed in a
22static buffer. 25static buffer.
26ERR_error_string_n() is a variant of ERR_error_string() that writes
27at most I<len> characters (including the terminating 0)
28and truncates the string if necessary.
29For ERR_error_string_n(), I<buf> may not be B<NULL>.
23 30
24The string will have the following format: 31The string will have the following format:
25 32
@@ -45,7 +52,7 @@ all error codes currently in the queue.
45=head1 RETURN VALUES 52=head1 RETURN VALUES
46 53
47ERR_error_string() returns a pointer to a static buffer containing the 54ERR_error_string() returns a pointer to a static buffer containing the
48string if B<buf == NULL>, B<buf> otherwise. 55string if I<buf> B<== NULL>, I<buf> otherwise.
49 56
50ERR_lib_error_string(), ERR_func_error_string() and 57ERR_lib_error_string(), ERR_func_error_string() and
51ERR_reason_error_string() return the strings, and B<NULL> if 58ERR_reason_error_string() return the strings, and B<NULL> if
@@ -61,5 +68,6 @@ L<ERR_print_errors(3)|ERR_print_errors(3)>
61=head1 HISTORY 68=head1 HISTORY
62 69
63ERR_error_string() is available in all versions of SSLeay and OpenSSL. 70ERR_error_string() is available in all versions of SSLeay and OpenSSL.
71ERR_error_string_n() was added in OpenSSL 0.9.6.
64 72
65=cut 73=cut
diff --git a/src/lib/libssl/src/doc/crypto/ERR_get_error.pod b/src/lib/libssl/src/doc/crypto/ERR_get_error.pod
index 75ece00d97..3551bacb8d 100644
--- a/src/lib/libssl/src/doc/crypto/ERR_get_error.pod
+++ b/src/lib/libssl/src/doc/crypto/ERR_get_error.pod
@@ -2,7 +2,8 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5ERR_get_error, ERR_peek_error - obtain error code 5ERR_get_error, ERR_peek_error, ERR_get_error_line, ERR_peek_error_line,
6ERR_get_error_line_data, ERR_peek_error_line_data - obtain error code and data
6 7
7=head1 SYNOPSIS 8=head1 SYNOPSIS
8 9
@@ -40,7 +41,7 @@ the error occurred in *B<file> and *B<line>, unless these are B<NULL>.
40ERR_get_error_line_data() and ERR_peek_error_line_data() store 41ERR_get_error_line_data() and ERR_peek_error_line_data() store
41additional data and flags associated with the error code in *B<data> 42additional data and flags associated with the error code in *B<data>
42and *B<flags>, unless these are B<NULL>. *B<data> contains a string 43and *B<flags>, unless these are B<NULL>. *B<data> contains a string
43if *B<flags>&B<ERR_TXT_STRING>. If it has been allocated by Malloc(), 44if *B<flags>&B<ERR_TXT_STRING>. If it has been allocated by OPENSSL_malloc(),
44*B<flags>&B<ERR_TXT_MALLOCED> is true. 45*B<flags>&B<ERR_TXT_MALLOCED> is true.
45 46
46=head1 RETURN VALUES 47=head1 RETURN VALUES
diff --git a/src/lib/libssl/src/doc/crypto/ERR_remove_state.pod b/src/lib/libssl/src/doc/crypto/ERR_remove_state.pod
index ebcdc0f5a5..72925fb9f4 100644
--- a/src/lib/libssl/src/doc/crypto/ERR_remove_state.pod
+++ b/src/lib/libssl/src/doc/crypto/ERR_remove_state.pod
@@ -16,7 +16,7 @@ ERR_remove_state() frees the error queue associated with thread B<pid>.
16If B<pid> == 0, the current thread will have its error queue removed. 16If B<pid> == 0, the current thread will have its error queue removed.
17 17
18Since error queue data structures are allocated automatically for new 18Since error queue data structures are allocated automatically for new
19threads, they must be freed when threads are terminated in oder to 19threads, they must be freed when threads are terminated in order to
20avoid memory leaks. 20avoid memory leaks.
21 21
22=head1 RETURN VALUE 22=head1 RETURN VALUE
diff --git a/src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod b/src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod
index 6d4e156ae3..fefc858f7e 100644
--- a/src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod
+++ b/src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod
@@ -2,7 +2,12 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5EVP_DigestInit, EVP_DigestUpdate, EVP_DigestFinal - EVP digest routines 5EVP_DigestInit, EVP_DigestUpdate, EVP_DigestFinal, EVP_MAX_MD_SIZE,
6EVP_MD_CTX_copy, EVP_MD_type, EVP_MD_pkey_type, EVP_MD_size, EVP_MD_block_size,
7EVP_MD_CTX_md, EVP_MD_CTX_size, EVP_MD_CTX_block_size, EVP_MD_CTX_type,
8EVP_md_null, EVP_md2, EVP_md5, EVP_sha, EVP_sha1, EVP_dss, EVP_dss1, EVP_mdc2,
9EVP_ripemd160, EVP_get_digestbyname, EVP_get_digestbynid, EVP_get_digestbyobj -
10EVP digest routines
6 11
7=head1 SYNOPSIS 12=head1 SYNOPSIS
8 13
@@ -45,12 +50,12 @@ EVP_DigestInit, EVP_DigestUpdate, EVP_DigestFinal - EVP digest routines
45 50
46The EVP digest routines are a high level interface to message digests. 51The EVP digest routines are a high level interface to message digests.
47 52
48EVP_DigestInit() initialises a digest context B<ctx> to use a digest 53EVP_DigestInit() initializes a digest context B<ctx> to use a digest
49B<type>: this will typically be supplied by a function such as 54B<type>: this will typically be supplied by a function such as
50EVP_sha1(). 55EVP_sha1().
51 56
52EVP_DigestUpdate() hashes B<cnt> bytes of data at B<d> into the 57EVP_DigestUpdate() hashes B<cnt> bytes of data at B<d> into the
53digest context B<ctx>. This funtion can be called several times on the 58digest context B<ctx>. This function can be called several times on the
54same B<ctx> to hash additional data. 59same B<ctx> to hash additional data.
55 60
56EVP_DigestFinal() retrieves the digest value from B<ctx> and places 61EVP_DigestFinal() retrieves the digest value from B<ctx> and places
@@ -58,7 +63,7 @@ it in B<md>. If the B<s> parameter is not NULL then the number of
58bytes of data written (i.e. the length of the digest) will be written 63bytes of data written (i.e. the length of the digest) will be written
59to the integer at B<s>, at most B<EVP_MAX_MD_SIZE> bytes will be written. 64to the integer at B<s>, at most B<EVP_MAX_MD_SIZE> bytes will be written.
60After calling EVP_DigestFinal() no additional calls to EVP_DigestUpdate() 65After calling EVP_DigestFinal() no additional calls to EVP_DigestUpdate()
61can be made, but EVP_DigestInit() can be called to initialiase a new 66can be made, but EVP_DigestInit() can be called to initialize a new
62digest operation. 67digest operation.
63 68
64EVP_MD_CTX_copy() can be used to copy the message digest state from 69EVP_MD_CTX_copy() can be used to copy the message digest state from
@@ -97,7 +102,7 @@ returns is of zero length.
97 102
98EVP_get_digestbyname(), EVP_get_digestbynid() and EVP_get_digestbyobj() 103EVP_get_digestbyname(), EVP_get_digestbynid() and EVP_get_digestbyobj()
99return an B<EVP_MD> structure when passed a digest name, a digest NID or 104return an B<EVP_MD> structure when passed a digest name, a digest NID or
100an ASN1_OBJECT structure respectively. The digest table must be initialised 105an ASN1_OBJECT structure respectively. The digest table must be initialized
101using, for example, OpenSSL_add_all_digests() for these functions to work. 106using, for example, OpenSSL_add_all_digests() for these functions to work.
102 107
103=head1 RETURN VALUES 108=head1 RETURN VALUES
diff --git a/src/lib/libssl/src/doc/crypto/EVP_EncryptInit.pod b/src/lib/libssl/src/doc/crypto/EVP_EncryptInit.pod
index 77ed4ccdba..9afe2396e2 100644
--- a/src/lib/libssl/src/doc/crypto/EVP_EncryptInit.pod
+++ b/src/lib/libssl/src/doc/crypto/EVP_EncryptInit.pod
@@ -2,34 +2,46 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5EVP_EncryptInit, EVP_EncryptUpdate, EVP_EncryptFinal - EVP cipher routines 5EVP_EncryptInit, EVP_EncryptUpdate, EVP_EncryptFinal, EVP_DecryptInit,
6EVP_DecryptUpdate, EVP_DecryptFinal, EVP_CipherInit, EVP_CipherUpdate,
7EVP_CipherFinal, EVP_CIPHER_CTX_set_key_length, EVP_CIPHER_CTX_ctrl,
8EVP_CIPHER_CTX_cleanup, EVP_get_cipherbyname, EVP_get_cipherbynid,
9EVP_get_cipherbyobj, EVP_CIPHER_nid, EVP_CIPHER_block_size,
10EVP_CIPHER_key_length, EVP_CIPHER_iv_length, EVP_CIPHER_flags,
11EVP_CIPHER_mode, EVP_CIPHER_type, EVP_CIPHER_CTX_cipher, EVP_CIPHER_CTX_nid,
12EVP_CIPHER_CTX_block_size, EVP_CIPHER_CTX_key_length, EVP_CIPHER_CTX_iv_length,
13EVP_CIPHER_CTX_get_app_data, EVP_CIPHER_CTX_set_app_data, EVP_CIPHER_CTX_type,
14EVP_CIPHER_CTX_flags, EVP_CIPHER_CTX_mode, EVP_CIPHER_param_to_asn1,
15EVP_CIPHER_asn1_to_param - EVP cipher routines
6 16
7=head1 SYNOPSIS 17=head1 SYNOPSIS
8 18
9 #include <openssl/evp.h> 19 #include <openssl/evp.h>
10 20
11 void EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, 21 int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
12 unsigned char *key, unsigned char *iv); 22 unsigned char *key, unsigned char *iv);
13 void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 23 int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
14 int *outl, unsigned char *in, int inl); 24 int *outl, unsigned char *in, int inl);
15 void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, 25 int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out,
16 int *outl); 26 int *outl);
17 27
18 void EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, 28 int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
19 unsigned char *key, unsigned char *iv); 29 unsigned char *key, unsigned char *iv);
20 void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 30 int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
21 int *outl, unsigned char *in, int inl); 31 int *outl, unsigned char *in, int inl);
22 int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, 32 int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm,
23 int *outl); 33 int *outl);
24 34
25 void EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, 35 int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
26 unsigned char *key, unsigned char *iv, int enc); 36 unsigned char *key, unsigned char *iv, int enc);
27 void EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 37 int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
28 int *outl, unsigned char *in, int inl); 38 int *outl, unsigned char *in, int inl);
29 int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, 39 int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm,
30 int *outl); 40 int *outl);
31 41
32 void EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); 42 int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen);
43 int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr);
44 int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a);
33 45
34 const EVP_CIPHER *EVP_get_cipherbyname(const char *name); 46 const EVP_CIPHER *EVP_get_cipherbyname(const char *name);
35 #define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a)) 47 #define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a))
@@ -38,15 +50,21 @@ EVP_EncryptInit, EVP_EncryptUpdate, EVP_EncryptFinal - EVP cipher routines
38 #define EVP_CIPHER_nid(e) ((e)->nid) 50 #define EVP_CIPHER_nid(e) ((e)->nid)
39 #define EVP_CIPHER_block_size(e) ((e)->block_size) 51 #define EVP_CIPHER_block_size(e) ((e)->block_size)
40 #define EVP_CIPHER_key_length(e) ((e)->key_len) 52 #define EVP_CIPHER_key_length(e) ((e)->key_len)
41 #define EVP_CIPHER_iv_length(e) ((e)->iv_len) 53 #define EVP_CIPHER_iv_length(e) ((e)->iv_len)
42 54 #define EVP_CIPHER_flags(e) ((e)->flags)
55 #define EVP_CIPHER_mode(e) ((e)->flags) & EVP_CIPH_MODE)
43 int EVP_CIPHER_type(const EVP_CIPHER *ctx); 56 int EVP_CIPHER_type(const EVP_CIPHER *ctx);
57
44 #define EVP_CIPHER_CTX_cipher(e) ((e)->cipher) 58 #define EVP_CIPHER_CTX_cipher(e) ((e)->cipher)
45 #define EVP_CIPHER_CTX_nid(e) ((e)->cipher->nid) 59 #define EVP_CIPHER_CTX_nid(e) ((e)->cipher->nid)
46 #define EVP_CIPHER_CTX_block_size(e) ((e)->cipher->block_size) 60 #define EVP_CIPHER_CTX_block_size(e) ((e)->cipher->block_size)
47 #define EVP_CIPHER_CTX_key_length(e) ((e)->cipher->key_len) 61 #define EVP_CIPHER_CTX_key_length(e) ((e)->key_len)
48 #define EVP_CIPHER_CTX_iv_length(e) ((e)->cipher->iv_len) 62 #define EVP_CIPHER_CTX_iv_length(e) ((e)->cipher->iv_len)
63 #define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data)
64 #define EVP_CIPHER_CTX_set_app_data(e,d) ((e)->app_data=(char *)(d))
49 #define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) 65 #define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))
66 #define EVP_CIPHER_CTX_flags(e) ((e)->cipher->flags)
67 #define EVP_CIPHER_CTX_mode(e) ((e)->cipher->flags & EVP_CIPH_MODE)
50 68
51 int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type); 69 int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
52 int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); 70 int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
@@ -56,16 +74,14 @@ EVP_EncryptInit, EVP_EncryptUpdate, EVP_EncryptFinal - EVP cipher routines
56The EVP cipher routines are a high level interface to certain 74The EVP cipher routines are a high level interface to certain
57symmetric ciphers. 75symmetric ciphers.
58 76
59EVP_EncryptInit() initialises a cipher context B<ctx> for encryption 77EVP_EncryptInit() initializes a cipher context B<ctx> for encryption
60with cipher B<type>. B<type> is normally supplied by a function such 78with cipher B<type>. B<type> is normally supplied by a function such
61as EVP_des_cbc() . B<key> is the symmetric key to use and B<iv> is the 79as EVP_des_cbc() . B<key> is the symmetric key to use and B<iv> is the
62IV to use (if necessary), the actual number of bytes used for the 80IV to use (if necessary), the actual number of bytes used for the
63key and IV depends on the cipher. It is possible to set all parameters 81key and IV depends on the cipher. It is possible to set all parameters
64to NULL except B<type> in an initial call and supply the remaining 82to NULL except B<type> in an initial call and supply the remaining
65parameters in subsequent calls. This is normally done when the 83parameters in subsequent calls, all of which have B<type> set to NULL.
66EVP_CIPHER_asn1_to_param() function is called to set the cipher 84This is done when the default cipher parameters are not appropriate.
67parameters from an ASN1 AlgorithmIdentifier and the key from a
68different source.
69 85
70EVP_EncryptUpdate() encrypts B<inl> bytes from the buffer B<in> and 86EVP_EncryptUpdate() encrypts B<inl> bytes from the buffer B<in> and
71writes the encrypted version to B<out>. This function can be called 87writes the encrypted version to B<out>. This function can be called
@@ -93,7 +109,8 @@ cipher block size is 1 in which case B<inl> bytes is sufficient.
93EVP_CipherInit(), EVP_CipherUpdate() and EVP_CipherFinal() are functions 109EVP_CipherInit(), EVP_CipherUpdate() and EVP_CipherFinal() are functions
94that can be used for decryption or encryption. The operation performed 110that can be used for decryption or encryption. The operation performed
95depends on the value of the B<enc> parameter. It should be set to 1 for 111depends on the value of the B<enc> parameter. It should be set to 1 for
96encryption and 0 for decryption. 112encryption, 0 for decryption and -1 to leave the value unchanged (the
113actual value of 'enc' being supplied in a previous call).
97 114
98EVP_CIPHER_CTX_cleanup() clears all information from a cipher context. 115EVP_CIPHER_CTX_cleanup() clears all information from a cipher context.
99It should be called after all operations using a cipher are complete 116It should be called after all operations using a cipher are complete
@@ -111,7 +128,13 @@ IDENTIFIER.
111EVP_CIPHER_key_length() and EVP_CIPHER_CTX_key_length() return the key 128EVP_CIPHER_key_length() and EVP_CIPHER_CTX_key_length() return the key
112length of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX> 129length of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX>
113structure. The constant B<EVP_MAX_KEY_LENGTH> is the maximum key length 130structure. The constant B<EVP_MAX_KEY_LENGTH> is the maximum key length
114for all ciphers. 131for all ciphers. Note: although EVP_CIPHER_key_length() is fixed for a
132given cipher, the value of EVP_CIPHER_CTX_key_length() may be different
133for variable key length ciphers.
134
135EVP_CIPHER_CTX_set_key_length() sets the key length of the cipher ctx.
136If the cipher is a fixed length cipher then attempting to set the key
137length to any value other than the fixed value is an error.
115 138
116EVP_CIPHER_iv_length() and EVP_CIPHER_CTX_iv_length() return the IV 139EVP_CIPHER_iv_length() and EVP_CIPHER_CTX_iv_length() return the IV
117length of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX>. 140length of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX>.
@@ -133,6 +156,11 @@ B<NID_undef>.
133EVP_CIPHER_CTX_cipher() returns the B<EVP_CIPHER> structure when passed 156EVP_CIPHER_CTX_cipher() returns the B<EVP_CIPHER> structure when passed
134an B<EVP_CIPHER_CTX> structure. 157an B<EVP_CIPHER_CTX> structure.
135 158
159EVP_CIPHER_mode() and EVP_CIPHER_CTX_mode() return the block cipher mode:
160EVP_CIPH_ECB_MODE, EVP_CIPH_CBC_MODE, EVP_CIPH_CFB_MODE or
161EVP_CIPH_OFB_MODE. If the cipher is a stream cipher then
162EVP_CIPH_STREAM_CIPHER is returned.
163
136EVP_CIPHER_param_to_asn1() sets the AlgorithmIdentifier "parameter" based 164EVP_CIPHER_param_to_asn1() sets the AlgorithmIdentifier "parameter" based
137on the passed cipher. This will typically include any parameters and an 165on the passed cipher. This will typically include any parameters and an
138IV. The cipher IV (if any) must be set when this call is made. This call 166IV. The cipher IV (if any) must be set when this call is made. This call
@@ -149,21 +177,24 @@ key set to NULL, EVP_CIPHER_asn1_to_param() will be called and finally
149EVP_CipherInit() again with all parameters except the key set to NULL. It is 177EVP_CipherInit() again with all parameters except the key set to NULL. It is
150possible for this function to fail if the cipher does not have any ASN1 support 178possible for this function to fail if the cipher does not have any ASN1 support
151or the parameters cannot be set (for example the RC2 effective key length 179or the parameters cannot be set (for example the RC2 effective key length
152does not have an B<EVP_CIPHER> structure). 180is not supported.
181
182EVP_CIPHER_CTX_ctrl() allows various cipher specific parameters to be determined
183and set. Currently only the RC2 effective key length and the number of rounds of
184RC5 can be set.
153 185
154=head1 RETURN VALUES 186=head1 RETURN VALUES
155 187
156EVP_EncryptInit(), EVP_EncryptUpdate() and EVP_EncryptFinal() do not return 188EVP_EncryptInit(), EVP_EncryptUpdate() and EVP_EncryptFinal() return 1 for success
157values. 189and 0 for failure.
158 190
159EVP_DecryptInit() and EVP_DecryptUpdate() do not return values. 191EVP_DecryptInit() and EVP_DecryptUpdate() return 1 for success and 0 for failure.
160EVP_DecryptFinal() returns 0 if the decrypt failed or 1 for success. 192EVP_DecryptFinal() returns 0 if the decrypt failed or 1 for success.
161 193
162EVP_CipherInit() and EVP_CipherUpdate() do not return values. 194EVP_CipherInit() and EVP_CipherUpdate() return 1 for success and 0 for failure.
163EVP_CipherFinal() returns 1 for a decryption failure or 1 for success, if 195EVP_CipherFinal() returns 1 for a decryption failure or 1 for success.
164the operation is encryption then it always returns 1.
165 196
166EVP_CIPHER_CTX_cleanup() does not return a value. 197EVP_CIPHER_CTX_cleanup() returns 1 for success and 0 for failure.
167 198
168EVP_get_cipherbyname(), EVP_get_cipherbynid() and EVP_get_cipherbyobj() 199EVP_get_cipherbyname(), EVP_get_cipherbynid() and EVP_get_cipherbyobj()
169return an B<EVP_CIPHER> structure or NULL on error. 200return an B<EVP_CIPHER> structure or NULL on error.
@@ -187,6 +218,75 @@ EVP_CIPHER_CTX_cipher() returns an B<EVP_CIPHER> structure.
187EVP_CIPHER_param_to_asn1() and EVP_CIPHER_asn1_to_param() return 1 for 218EVP_CIPHER_param_to_asn1() and EVP_CIPHER_asn1_to_param() return 1 for
188success or zero for failure. 219success or zero for failure.
189 220
221=head1 CIPHER LISTING
222
223All algorithms have a fixed key length unless otherwise stated.
224
225=over 4
226
227=item EVP_enc_null()
228
229Null cipher: does nothing.
230
231=item EVP_des_cbc(void), EVP_des_ecb(void), EVP_des_cfb(void), EVP_des_ofb(void)
232
233DES in CBC, ECB, CFB and OFB modes respectively.
234
235=item EVP_des_ede_cbc(void), EVP_des_ede(), EVP_des_ede_ofb(void), EVP_des_ede_cfb(void)
236
237Two key triple DES in CBC, ECB, CFB and OFB modes respectively.
238
239=item EVP_des_ede3_cbc(void), EVP_des_ede3(), EVP_des_ede3_ofb(void), EVP_des_ede3_cfb(void)
240
241Three key triple DES in CBC, ECB, CFB and OFB modes respectively.
242
243=item EVP_desx_cbc(void)
244
245DESX algorithm in CBC mode.
246
247=item EVP_rc4(void)
248
249RC4 stream cipher. This is a variable key length cipher with default key length 128 bits.
250
251=item EVP_rc4_40(void)
252
253RC4 stream cipher with 40 bit key length. This is obsolete and new code should use EVP_rc4()
254and the EVP_CIPHER_CTX_set_key_length() function.
255
256=item EVP_idea_cbc() EVP_idea_ecb(void), EVP_idea_cfb(void), EVP_idea_ofb(void), EVP_idea_cbc(void)
257
258IDEA encryption algorithm in CBC, ECB, CFB and OFB modes respectively.
259
260=item EVP_rc2_cbc(void), EVP_rc2_ecb(void), EVP_rc2_cfb(void), EVP_rc2_ofb(void)
261
262RC2 encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key
263length cipher with an additional parameter called "effective key bits" or "effective key length".
264By default both are set to 128 bits.
265
266=item EVP_rc2_40_cbc(void), EVP_rc2_64_cbc(void)
267
268RC2 algorithm in CBC mode with a default key length and effective key length of 40 and 64 bits.
269These are obsolete and new code should use EVP_rc2_cbc(), EVP_CIPHER_CTX_set_key_length() and
270EVP_CIPHER_CTX_ctrl() to set the key length and effective key length.
271
272=item EVP_bf_cbc(void), EVP_bf_ecb(void), EVP_bf_cfb(void), EVP_bf_ofb(void);
273
274Blowfish encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key
275length cipher.
276
277=item EVP_cast5_cbc(void), EVP_cast5_ecb(void), EVP_cast5_cfb(void), EVP_cast5_ofb(void)
278
279CAST encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key
280length cipher.
281
282=item EVP_rc5_32_12_16_cbc(void), EVP_rc5_32_12_16_ecb(void), EVP_rc5_32_12_16_cfb(void), EVP_rc5_32_12_16_ofb(void)
283
284RC5 encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key length
285cipher with an additional "number of rounds" parameter. By default the key length is set to 128
286bits and 12 rounds.
287
288=back
289
190=head1 NOTES 290=head1 NOTES
191 291
192Where possible the B<EVP> interface to symmetric ciphers should be used in 292Where possible the B<EVP> interface to symmetric ciphers should be used in
@@ -206,14 +306,49 @@ test that the input data or key is correct. A random block has better than
2061 in 256 chance of being of the correct format and problems with the 3061 in 256 chance of being of the correct format and problems with the
207input data earlier on will not produce a final decrypt error. 307input data earlier on will not produce a final decrypt error.
208 308
309The functions EVP_EncryptInit(), EVP_EncryptUpdate(), EVP_EncryptFinal(),
310EVP_DecryptInit(), EVP_DecryptUpdate(), EVP_CipherInit() and EVP_CipherUpdate()
311and EVP_CIPHER_CTX_cleanup() did not return errors in OpenSSL version 0.9.5a or
312earlier. Software only versions of encryption algorithms will never return
313error codes for these functions, unless there is a programming error (for example
314and attempt to set the key before the cipher is set in EVP_EncryptInit() ).
315
209=head1 BUGS 316=head1 BUGS
210 317
211The current B<EVP> cipher interface is not as flexible as it should be. Only 318For RC5 the number of rounds can currently only be set to 8, 12 or 16. This is
212certain "spot" encryption algorithms can be used for ciphers which have various 319a limitation of the current RC5 code rather than the EVP interface.
213parameters associated with them (RC2, RC5 for example) this is inadequate. 320
321It should be possible to disable PKCS padding: currently it isn't.
322
323EVP_MAX_KEY_LENGTH and EVP_MAX_IV_LENGTH only refer to the internal ciphers with
324default key lengths. If custom ciphers exceed these values the results are
325unpredictable. This is because it has become standard practice to define a
326generic key as a fixed unsigned char array containing EVP_MAX_KEY_LENGTH bytes.
327
328The ASN1 code is incomplete (and sometimes inaccurate) it has only been tested
329for certain common S/MIME ciphers (RC2, DES, triple DES) in CBC mode.
330
331=head1 EXAMPLES
332
333Get the number of rounds used in RC5:
334
335 int nrounds;
336 EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC5_ROUNDS, 0, &i);
337
338Get the RC2 effective key length:
339
340 int key_bits;
341 EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC2_KEY_BITS, 0, &i);
342
343Set the number of rounds used in RC5:
344
345 int nrounds;
346 EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC5_ROUNDS, i, NULL);
347
348Set the number of rounds used in RC2:
214 349
215Several of the functions do not return error codes because the software versions 350 int nrounds;
216can never fail. This is not true of hardware versions. 351 EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC2_KEY_BITS, i, NULL);
217 352
218=head1 SEE ALSO 353=head1 SEE ALSO
219 354
diff --git a/src/lib/libssl/src/doc/crypto/EVP_OpenInit.pod b/src/lib/libssl/src/doc/crypto/EVP_OpenInit.pod
index 50edb124e4..2e710da945 100644
--- a/src/lib/libssl/src/doc/crypto/EVP_OpenInit.pod
+++ b/src/lib/libssl/src/doc/crypto/EVP_OpenInit.pod
@@ -10,9 +10,9 @@ EVP_OpenInit, EVP_OpenUpdate, EVP_OpenFinal - EVP envelope decryption
10 10
11 int EVP_OpenInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type,unsigned char *ek, 11 int EVP_OpenInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type,unsigned char *ek,
12 int ekl,unsigned char *iv,EVP_PKEY *priv); 12 int ekl,unsigned char *iv,EVP_PKEY *priv);
13 void EVP_OpenUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 13 int EVP_OpenUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
14 int *outl, unsigned char *in, int inl); 14 int *outl, unsigned char *in, int inl);
15 void EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, 15 int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out,
16 int *outl); 16 int *outl);
17 17
18=head1 DESCRIPTION 18=head1 DESCRIPTION
@@ -21,7 +21,7 @@ The EVP envelope routines are a high level interface to envelope
21decryption. They decrypt a public key encrypted symmetric key and 21decryption. They decrypt a public key encrypted symmetric key and
22then decrypt data using it. 22then decrypt data using it.
23 23
24EVP_OpenInit() initialises a cipher context B<ctx> for decryption 24EVP_OpenInit() initializes a cipher context B<ctx> for decryption
25with cipher B<type>. It decrypts the encrypted symmetric key of length 25with cipher B<type>. It decrypts the encrypted symmetric key of length
26B<ekl> bytes passed in the B<ek> parameter using the private key B<priv>. 26B<ekl> bytes passed in the B<ek> parameter using the private key B<priv>.
27The IV is supplied in the B<iv> parameter. 27The IV is supplied in the B<iv> parameter.
@@ -29,20 +29,32 @@ The IV is supplied in the B<iv> parameter.
29EVP_OpenUpdate() and EVP_OpenFinal() have exactly the same properties 29EVP_OpenUpdate() and EVP_OpenFinal() have exactly the same properties
30as the EVP_DecryptUpdate() and EVP_DecryptFinal() routines, as 30as the EVP_DecryptUpdate() and EVP_DecryptFinal() routines, as
31documented on the L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> manual 31documented on the L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> manual
32page. 32page.
33
34=head1 NOTES
35
36It is possible to call EVP_OpenInit() twice in the same way as
37EVP_DecryptInit(). The first call should have B<priv> set to NULL
38and (after setting any cipher parameters) it should be called again
39with B<type> set to NULL.
40
41If the cipher passed in the B<type> parameter is a variable length
42cipher then the key length will be set to the value of the recovered
43key length. If the cipher is a fixed length cipher then the recovered
44key length must match the fixed cipher length.
33 45
34=head1 RETURN VALUES 46=head1 RETURN VALUES
35 47
36EVP_OpenInit() returns -1 on error or an non zero integer (actually the 48EVP_OpenInit() returns 0 on error or a non zero integer (actually the
37recovered secret key size) if successful. 49recovered secret key size) if successful.
38 50
39EVP_SealUpdate() does not return a value. 51EVP_OpenUpdate() returns 1 for success or 0 for failure.
40 52
41EVP_SealFinal() returns 0 if the decrypt failed or 1 for success. 53EVP_OpenFinal() returns 0 if the decrypt failed or 1 for success.
42 54
43=head1 SEE ALSO 55=head1 SEE ALSO
44 56
45L<evp(3)|evp(3)>, 57L<evp(3)|evp(3)>, L<rand(3)|rand(3)>,
46L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>, 58L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>,
47L<EVP_SealInit(3)|EVP_SealInit(3)> 59L<EVP_SealInit(3)|EVP_SealInit(3)>
48 60
diff --git a/src/lib/libssl/src/doc/crypto/EVP_SealInit.pod b/src/lib/libssl/src/doc/crypto/EVP_SealInit.pod
index 42beed33bd..0451eb648a 100644
--- a/src/lib/libssl/src/doc/crypto/EVP_SealInit.pod
+++ b/src/lib/libssl/src/doc/crypto/EVP_SealInit.pod
@@ -10,9 +10,9 @@ EVP_SealInit, EVP_SealUpdate, EVP_SealFinal - EVP envelope encryption
10 10
11 int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek, 11 int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek,
12 int *ekl, unsigned char *iv,EVP_PKEY **pubk, int npubk); 12 int *ekl, unsigned char *iv,EVP_PKEY **pubk, int npubk);
13 void EVP_SealUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 13 int EVP_SealUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
14 int *outl, unsigned char *in, int inl); 14 int *outl, unsigned char *in, int inl);
15 void EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, 15 int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out,
16 int *outl); 16 int *outl);
17 17
18=head1 DESCRIPTION 18=head1 DESCRIPTION
@@ -22,7 +22,7 @@ encryption. They generate a random key and then "envelope" it by
22using public key encryption. Data can then be encrypted using this 22using public key encryption. Data can then be encrypted using this
23key. 23key.
24 24
25EVP_SealInit() initialises a cipher context B<ctx> for encryption 25EVP_SealInit() initializes a cipher context B<ctx> for encryption
26with cipher B<type> using a random secret key and IV supplied in 26with cipher B<type> using a random secret key and IV supplied in
27the B<iv> parameter. B<type> is normally supplied by a function such 27the B<iv> parameter. B<type> is normally supplied by a function such
28as EVP_des_cbc(). The secret key is encrypted using one or more public 28as EVP_des_cbc(). The secret key is encrypted using one or more public
@@ -41,9 +41,10 @@ page.
41 41
42=head1 RETURN VALUES 42=head1 RETURN VALUES
43 43
44EVP_SealInit() returns -1 on error or B<npubk> if successful. 44EVP_SealInit() returns 0 on error or B<npubk> if successful.
45 45
46EVP_SealUpdate() and EVP_SealFinal() do not return values. 46EVP_SealUpdate() and EVP_SealFinal() return 1 for success and 0 for
47failure.
47 48
48=head1 NOTES 49=head1 NOTES
49 50
@@ -59,9 +60,14 @@ but symmetric encryption is fast. So symmetric encryption is used for
59bulk encryption and the small random symmetric key used is transferred 60bulk encryption and the small random symmetric key used is transferred
60using public key encryption. 61using public key encryption.
61 62
63It is possible to call EVP_SealInit() twice in the same way as
64EVP_EncryptInit(). The first call should have B<npubk> set to 0
65and (after setting any cipher parameters) it should be called again
66with B<type> set to NULL.
67
62=head1 SEE ALSO 68=head1 SEE ALSO
63 69
64L<evp(3)|evp(3)>, 70L<evp(3)|evp(3)>, L<rand(3)|rand(3)>,
65L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>, 71L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>,
66L<EVP_OpenInit(3)|EVP_OpenInit(3)> 72L<EVP_OpenInit(3)|EVP_OpenInit(3)>
67 73
diff --git a/src/lib/libssl/src/doc/crypto/EVP_SignInit.pod b/src/lib/libssl/src/doc/crypto/EVP_SignInit.pod
index 1167cefb45..d5ce245ecd 100644
--- a/src/lib/libssl/src/doc/crypto/EVP_SignInit.pod
+++ b/src/lib/libssl/src/doc/crypto/EVP_SignInit.pod
@@ -19,12 +19,12 @@ EVP_SignInit, EVP_SignUpdate, EVP_SignFinal - EVP signing functions
19The EVP signature routines are a high level interface to digital 19The EVP signature routines are a high level interface to digital
20signatures. 20signatures.
21 21
22EVP_SignInit() initialises a signing context B<ctx> to using digest 22EVP_SignInit() initializes a signing context B<ctx> to using digest
23B<type>: this will typically be supplied by a function such as 23B<type>: this will typically be supplied by a function such as
24EVP_sha1(). 24EVP_sha1().
25 25
26EVP_SignUpdate() hashes B<cnt> bytes of data at B<d> into the 26EVP_SignUpdate() hashes B<cnt> bytes of data at B<d> into the
27signature context B<ctx>. This funtion can be called several times on the 27signature context B<ctx>. This function can be called several times on the
28same B<ctx> to include additional data. 28same B<ctx> to include additional data.
29 29
30EVP_SignFinal() signs the data in B<ctx> using the private key B<pkey> 30EVP_SignFinal() signs the data in B<ctx> using the private key B<pkey>
@@ -32,7 +32,7 @@ and places the signature in B<sig>. If the B<s> parameter is not NULL
32then the number of bytes of data written (i.e. the length of the signature) 32then the number of bytes of data written (i.e. the length of the signature)
33will be written to the integer at B<s>, at most EVP_PKEY_size(pkey) bytes 33will be written to the integer at B<s>, at most EVP_PKEY_size(pkey) bytes
34will be written. After calling EVP_SignFinal() no additional calls to 34will be written. After calling EVP_SignFinal() no additional calls to
35EVP_SignUpdate() can be made, but EVP_SignInit() can be called to initialiase 35EVP_SignUpdate() can be made, but EVP_SignInit() can be called to initialize
36a new signature operation. 36a new signature operation.
37 37
38EVP_PKEY_size() returns the maximum size of a signature in bytes. The actual 38EVP_PKEY_size() returns the maximum size of a signature in bytes. The actual
diff --git a/src/lib/libssl/src/doc/crypto/EVP_VerifyInit.pod b/src/lib/libssl/src/doc/crypto/EVP_VerifyInit.pod
index 5e74c5dcf9..736a0f4a82 100644
--- a/src/lib/libssl/src/doc/crypto/EVP_VerifyInit.pod
+++ b/src/lib/libssl/src/doc/crypto/EVP_VerifyInit.pod
@@ -17,17 +17,17 @@ EVP_VerifyInit, EVP_VerifyUpdate, EVP_VerifyFinal - EVP signature verification f
17The EVP signature verification routines are a high level interface to digital 17The EVP signature verification routines are a high level interface to digital
18signatures. 18signatures.
19 19
20EVP_VerifyInit() initialises a verification context B<ctx> to using digest 20EVP_VerifyInit() initializes a verification context B<ctx> to using digest
21B<type>: this will typically be supplied by a function such as EVP_sha1(). 21B<type>: this will typically be supplied by a function such as EVP_sha1().
22 22
23EVP_VerifyUpdate() hashes B<cnt> bytes of data at B<d> into the 23EVP_VerifyUpdate() hashes B<cnt> bytes of data at B<d> into the
24verification context B<ctx>. This funtion can be called several times on the 24verification context B<ctx>. This function can be called several times on the
25same B<ctx> to include additional data. 25same B<ctx> to include additional data.
26 26
27EVP_VerifyFinal() verifies the data in B<ctx> using the public key B<pkey> 27EVP_VerifyFinal() verifies the data in B<ctx> using the public key B<pkey>
28and against the B<siglen> bytes at B<sigbuf>. After calling EVP_VerifyFinal() 28and against the B<siglen> bytes at B<sigbuf>. After calling EVP_VerifyFinal()
29no additional calls to EVP_VerifyUpdate() can be made, but EVP_VerifyInit() 29no additional calls to EVP_VerifyUpdate() can be made, but EVP_VerifyInit()
30can be called to initialiase a new verification operation. 30can be called to initialize a new verification operation.
31 31
32=head1 RETURN VALUES 32=head1 RETURN VALUES
33 33
@@ -57,11 +57,12 @@ might.
57 57
58=head1 SEE ALSO 58=head1 SEE ALSO
59 59
60L<evp(3)|evp(3)>,
60L<EVP_SignInit(3)|EVP_SignInit(3)>, 61L<EVP_SignInit(3)|EVP_SignInit(3)>,
61L<EVP_DigestInit(3)|EVP_DigestInit(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, 62L<EVP_DigestInit(3)|EVP_DigestInit(3)>, L<err(3)|err(3)>,
62L<evp(3)|evp(3)>, L<HMAC(3)|HMAC(3)>, L<MD2(3)|MD2(3)>, 63L<evp(3)|evp(3)>, L<hmac(3)|hmac(3)>, L<md2(3)|md2(3)>,
63L<MD5(3)|MD5(3)>, L<MDC2(3)|MDC2(3)>, L<RIPEMD(3)|RIPEMD(3)>, 64L<md5(3)|md5(3)>, L<mdc2(3)|mdc2(3)>, L<ripemd(3)|ripemd(3)>,
64L<SHA1(3)|SHA1(3)>, L<digest(1)|digest(1)> 65L<sha(3)|sha(3)>, L<digest(1)|digest(1)>
65 66
66=head1 HISTORY 67=head1 HISTORY
67 68
diff --git a/src/lib/libssl/src/doc/crypto/OPENSSL_VERSION_NUMBER.pod b/src/lib/libssl/src/doc/crypto/OPENSSL_VERSION_NUMBER.pod
index b0b1058d19..68ea723259 100644
--- a/src/lib/libssl/src/doc/crypto/OPENSSL_VERSION_NUMBER.pod
+++ b/src/lib/libssl/src/doc/crypto/OPENSSL_VERSION_NUMBER.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5OPENSSL_VERSION_NUMBER, SSLeay - get OpenSSL version number 5OPENSSL_VERSION_NUMBER, SSLeay SSLeay_version - get OpenSSL version number
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
@@ -11,11 +11,27 @@ OPENSSL_VERSION_NUMBER, SSLeay - get OpenSSL version number
11 11
12 #include <openssl/crypto.h> 12 #include <openssl/crypto.h>
13 long SSLeay(void); 13 long SSLeay(void);
14 char *SSLeay_version(int t);
14 15
15=head1 DESCRIPTION 16=head1 DESCRIPTION
16 17
17OPENSSL_VERSION_NUMBER is a numeric release version identifier: 18OPENSSL_VERSION_NUMBER is a numeric release version identifier:
18 19
20 MMNNFFPPS: major minor fix patch status
21
22The status nibble has one of the values 0 for development, 1 to e for betas
231 to 14, and f for release.
24
25for example
26
27 0x000906000 == 0.9.6 dev
28 0x000906023 == 0.9.6b beta 3
29 0x00090605f == 0.9.6e release
30
31Versions prior to 0.9.3 have identifiers E<lt> 0x0930.
32Versions between 0.9.3 and 0.9.5 had a version identifier with this
33interpretation:
34
19 MMNNFFRBB major minor fix final beta/patch 35 MMNNFFRBB major minor fix final beta/patch
20 36
21for example 37for example
@@ -23,13 +39,39 @@ for example
23 0x000904100 == 0.9.4 release 39 0x000904100 == 0.9.4 release
24 0x000905000 == 0.9.5 dev 40 0x000905000 == 0.9.5 dev
25 41
26Versions prior to 0.9.3 have identifiers E<lt> 0x0930. 42Version 0.9.5a had an interim interpretation that is like the current one,
43except the patch level got the highest bit set, to keep continuity. The
44number was therefore 0x0090581f.
45
46
27For backward compatibility, SSLEAY_VERSION_NUMBER is also defined. 47For backward compatibility, SSLEAY_VERSION_NUMBER is also defined.
28 48
29SSLeay() returns this number. The return value can be compared to the 49SSLeay() returns this number. The return value can be compared to the
30macro to make sure that the correct version of the library has been 50macro to make sure that the correct version of the library has been
31loaded, especially when using DLLs on Windows systems. 51loaded, especially when using DLLs on Windows systems.
32 52
53SSLeay_version() returns different strings depending on B<t>:
54
55=over 4
56
57=item SSLEAY_VERSION
58The text variant of the version number and the release date. For example,
59"OpenSSL 0.9.5a 1 Apr 2000".
60
61=item SSLEAY_CFLAGS
62The flags given to the C compiler when compiling OpenSSL are returned in a
63string.
64
65=item SSLEAY_PLATFORM
66The platform name used when OpenSSL was configured is returned.
67
68=back
69
70If the data request isn't available, a text saying that the information is
71not available is returned.
72
73For an unknown B<t>, the text "not available" is returned.
74
33=head1 RETURN VALUE 75=head1 RETURN VALUE
34 76
35The version number. 77The version number.
diff --git a/src/lib/libssl/src/doc/crypto/OpenSSL_add_all_algorithms.pod b/src/lib/libssl/src/doc/crypto/OpenSSL_add_all_algorithms.pod
index 015d4eaf36..e63411b5bb 100644
--- a/src/lib/libssl/src/doc/crypto/OpenSSL_add_all_algorithms.pod
+++ b/src/lib/libssl/src/doc/crypto/OpenSSL_add_all_algorithms.pod
@@ -2,7 +2,8 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5OpenSSL_add_all_algorithms() - add algorithms to internal table 5OpenSSL_add_all_algorithms, OpenSSL_add_all_ciphers, OpenSSL_add_all_digests -
6add algorithms to internal table
6 7
7=head1 SYNOPSIS 8=head1 SYNOPSIS
8 9
@@ -43,7 +44,7 @@ by EVP_sha1(). It just needs to add them if it (or any of the functions it calls
43needs to lookup algorithms. 44needs to lookup algorithms.
44 45
45The cipher and digest lookup functions are used in many parts of the library. If 46The cipher and digest lookup functions are used in many parts of the library. If
46the table is not initialised several functions will misbehave and complain they 47the table is not initialized several functions will misbehave and complain they
47cannot find algorithms. This includes the PEM, PKCS#12, SSL and S/MIME libraries. 48cannot find algorithms. This includes the PEM, PKCS#12, SSL and S/MIME libraries.
48This is a common query in the OpenSSL mailing lists. 49This is a common query in the OpenSSL mailing lists.
49 50
diff --git a/src/lib/libssl/src/doc/crypto/RAND_egd.pod b/src/lib/libssl/src/doc/crypto/RAND_egd.pod
index a40bd96198..40241e2df8 100644
--- a/src/lib/libssl/src/doc/crypto/RAND_egd.pod
+++ b/src/lib/libssl/src/doc/crypto/RAND_egd.pod
@@ -21,6 +21,10 @@ RAND_egd() is called with that path as an argument, it tries to read
21random bytes that EGD has collected. The read is performed in 21random bytes that EGD has collected. The read is performed in
22non-blocking mode. 22non-blocking mode.
23 23
24Alternatively, the EGD-compatible daemon PRNGD can be used. It is
25available from
26http://www.aet.tu-cottbus.de/personen/jaenicke/postfix_tls/prngd.html .
27
24=head1 RETURN VALUE 28=head1 RETURN VALUE
25 29
26RAND_egd() returns the number of bytes read from the daemon on 30RAND_egd() returns the number of bytes read from the daemon on
diff --git a/src/lib/libssl/src/doc/crypto/RSA_get_ex_new_index.pod b/src/lib/libssl/src/doc/crypto/RSA_get_ex_new_index.pod
index 920dc76325..46cc8f5359 100644
--- a/src/lib/libssl/src/doc/crypto/RSA_get_ex_new_index.pod
+++ b/src/lib/libssl/src/doc/crypto/RSA_get_ex_new_index.pod
@@ -17,14 +17,12 @@ RSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data - add application specifi
17 17
18 void *RSA_get_ex_data(RSA *r, int idx); 18 void *RSA_get_ex_data(RSA *r, int idx);
19 19
20 int new_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad, 20 typedef int new_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
21 int idx, long argl, void *argp); 21 int idx, long argl, void *argp);
22 22 typedef void free_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
23 void free_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad, 23 int idx, long argl, void *argp);
24 int idx, long argl, void *argp); 24 typedef int dup_func(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
25 25 int idx, long argl, void *argp);
26 int dup_func(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
27 int idx, long argl, void *argp);
28 26
29=head1 DESCRIPTION 27=head1 DESCRIPTION
30 28
diff --git a/src/lib/libssl/src/doc/crypto/RSA_print.pod b/src/lib/libssl/src/doc/crypto/RSA_print.pod
index dd968a5274..67876facc5 100644
--- a/src/lib/libssl/src/doc/crypto/RSA_print.pod
+++ b/src/lib/libssl/src/doc/crypto/RSA_print.pod
@@ -2,8 +2,9 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5RSA_print, RSA_print_fp, DHparams_print, DHparams_print_fp - print 5RSA_print, RSA_print_fp, DHparams_print, DHparams_print_fp, DSA_print,
6cryptographic parameters 6DSA_print_fp, DHparams_print, DHparams_print_fp - print cryptographic
7parameters
7 8
8=head1 SYNOPSIS 9=head1 SYNOPSIS
9 10
diff --git a/src/lib/libssl/src/doc/crypto/RSA_public_encrypt.pod b/src/lib/libssl/src/doc/crypto/RSA_public_encrypt.pod
index 13b7df62be..23861c0004 100644
--- a/src/lib/libssl/src/doc/crypto/RSA_public_encrypt.pod
+++ b/src/lib/libssl/src/doc/crypto/RSA_public_encrypt.pod
@@ -47,7 +47,7 @@ Encrypting user data directly with RSA is insecure.
47=back 47=back
48 48
49B<flen> must be less than RSA_size(B<rsa>) - 11 for the PKCS #1 v1.5 49B<flen> must be less than RSA_size(B<rsa>) - 11 for the PKCS #1 v1.5
50based padding modes, and less than RSA_size(B<rsa>) - 21 for 50based padding modes, and less than RSA_size(B<rsa>) - 41 for
51RSA_PKCS1_OAEP_PADDING. The random number generator must be seeded 51RSA_PKCS1_OAEP_PADDING. The random number generator must be seeded
52prior to calling RSA_public_encrypt(). 52prior to calling RSA_public_encrypt().
53 53
diff --git a/src/lib/libssl/src/doc/crypto/RSA_set_method.pod b/src/lib/libssl/src/doc/crypto/RSA_set_method.pod
index 14b0b4cf35..b672712292 100644
--- a/src/lib/libssl/src/doc/crypto/RSA_set_method.pod
+++ b/src/lib/libssl/src/doc/crypto/RSA_set_method.pod
@@ -4,17 +4,18 @@
4 4
5RSA_set_default_method, RSA_get_default_method, RSA_set_method, 5RSA_set_default_method, RSA_get_default_method, RSA_set_method,
6RSA_get_method, RSA_PKCS1_SSLeay, RSA_PKCS1_RSAref, 6RSA_get_method, RSA_PKCS1_SSLeay, RSA_PKCS1_RSAref,
7RSA_PKCS1_null_method, RSA_flags, RSA_new_method - select RSA method 7RSA_null_method, RSA_flags, RSA_new_method - select RSA method
8 8
9=head1 SYNOPSIS 9=head1 SYNOPSIS
10 10
11 #include <openssl/rsa.h> 11 #include <openssl/rsa.h>
12 #include <openssl/engine.h>
12 13
13 void RSA_set_default_method(RSA_METHOD *meth); 14 void RSA_set_default_openssl_method(RSA_METHOD *meth);
14 15
15 RSA_METHOD *RSA_get_default_method(void); 16 RSA_METHOD *RSA_get_default_openssl_method(void);
16 17
17 RSA_METHOD *RSA_set_method(RSA *rsa, RSA_METHOD *meth); 18 RSA_METHOD *RSA_set_method(RSA *rsa, ENGINE *engine);
18 19
19 RSA_METHOD *RSA_get_method(RSA *rsa); 20 RSA_METHOD *RSA_get_method(RSA *rsa);
20 21
@@ -26,7 +27,7 @@ RSA_PKCS1_null_method, RSA_flags, RSA_new_method - select RSA method
26 27
27 int RSA_flags(RSA *rsa); 28 int RSA_flags(RSA *rsa);
28 29
29 RSA *RSA_new_method(RSA_METHOD *method); 30 RSA *RSA_new_method(ENGINE *engine);
30 31
31=head1 DESCRIPTION 32=head1 DESCRIPTION
32 33
@@ -46,23 +47,27 @@ the RSA transformation. It is the default if OpenSSL is compiled with
46C<-DRSA_NULL>. These methods may be useful in the USA because of a 47C<-DRSA_NULL>. These methods may be useful in the USA because of a
47patent on the RSA cryptosystem. 48patent on the RSA cryptosystem.
48 49
49RSA_set_default_method() makes B<meth> the default method for all B<RSA> 50RSA_set_default_openssl_method() makes B<meth> the default method for all B<RSA>
50structures created later. 51structures created later. B<NB:> This is true only whilst the default engine
52for RSA operations remains as "openssl". ENGINEs provide an
53encapsulation for implementations of one or more algorithms at a time, and all
54the RSA functions mentioned here operate within the scope of the default
55"openssl" engine.
51 56
52RSA_get_default_method() returns a pointer to the current default 57RSA_get_default_openssl_method() returns a pointer to the current default
53method. 58method for the "openssl" engine.
54 59
55RSA_set_method() selects B<meth> for all operations using the key 60RSA_set_method() selects B<engine> for all operations using the key
56B<rsa>. 61B<rsa>.
57 62
58RSA_get_method() returns a pointer to the method currently selected 63RSA_get_method() returns a pointer to the RSA_METHOD from the currently
59for B<rsa>. 64selected ENGINE for B<rsa>.
60 65
61RSA_flags() returns the B<flags> that are set for B<rsa>'s current method. 66RSA_flags() returns the B<flags> that are set for B<rsa>'s current method.
62 67
63RSA_new_method() allocates and initializes an B<RSA> structure so that 68RSA_new_method() allocates and initializes an RSA structure so that
64B<method> will be used for the RSA operations. If B<method> is B<NULL>, 69B<engine> will be used for the RSA operations. If B<engine> is NULL,
65the default method is used. 70the default engine for RSA operations is used.
66 71
67=head1 THE RSA_METHOD STRUCTURE 72=head1 THE RSA_METHOD STRUCTURE
68 73
@@ -128,17 +133,21 @@ the default method is used.
128=head1 RETURN VALUES 133=head1 RETURN VALUES
129 134
130RSA_PKCS1_SSLeay(), RSA_PKCS1_RSAref(), RSA_PKCS1_null_method(), 135RSA_PKCS1_SSLeay(), RSA_PKCS1_RSAref(), RSA_PKCS1_null_method(),
131RSA_get_default_method() and RSA_get_method() return pointers to the 136RSA_get_default_openssl_method() and RSA_get_method() return pointers to
132respective B<RSA_METHOD>s. 137the respective RSA_METHODs.
133 138
134RSA_set_default_method() returns no value. 139RSA_set_default_openssl_method() returns no value.
135 140
136RSA_set_method() returns a pointer to the B<RSA_METHOD> previously 141RSA_set_method() selects B<engine> as the engine that will be responsible for
137associated with B<rsa>. 142all operations using the structure B<rsa>. If this function completes successfully,
143then the B<rsa> structure will have its own functional reference of B<engine>, so
144the caller should remember to free their own reference to B<engine> when they are
145finished with it. NB: An ENGINE's RSA_METHOD can be retrieved (or set) by
146ENGINE_get_RSA() or ENGINE_set_RSA().
138 147
139RSA_new_method() returns B<NULL> and sets an error code that can be 148RSA_new_method() returns NULL and sets an error code that can be
140obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise it 149obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise
141returns a pointer to the newly allocated structure. 150it returns a pointer to the newly allocated structure.
142 151
143=head1 SEE ALSO 152=head1 SEE ALSO
144 153
@@ -151,4 +160,9 @@ RSA_get_default_method(), RSA_set_method() and RSA_get_method() as
151well as the rsa_sign and rsa_verify components of RSA_METHOD were 160well as the rsa_sign and rsa_verify components of RSA_METHOD were
152added in OpenSSL 0.9.4. 161added in OpenSSL 0.9.4.
153 162
163RSA_set_default_openssl_method() and RSA_get_default_openssl_method()
164replaced RSA_set_default_method() and RSA_get_default_method() respectively,
165and RSA_set_method() and RSA_new_method() were altered to use B<ENGINE>s
166rather than B<DH_METHOD>s during development of OpenSSL 0.9.6.
167
154=cut 168=cut
diff --git a/src/lib/libssl/src/doc/crypto/bio.pod b/src/lib/libssl/src/doc/crypto/bio.pod
new file mode 100644
index 0000000000..24f61dfb56
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/bio.pod
@@ -0,0 +1,54 @@
1=pod
2
3=head1 NAME
4
5bio - I/O abstraction
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10
11TBA
12
13
14=head1 DESCRIPTION
15
16A BIO is an I/O abstraction, it hides many of the underlying I/O
17details from an application. If an application uses a BIO for its
18I/O it can transparently handle SSL connections, unencrypted network
19connections and file I/O.
20
21There are two type of BIO, a source/sink BIO and a filter BIO.
22
23As its name implies a source/sink BIO is a source and/or sink of data,
24examples include a socket BIO and a file BIO.
25
26A filter BIO takes data from one BIO and passes it through to
27another, or the application. The data may be left unmodified (for
28example a message digest BIO) or translated (for example an
29encryption BIO). The effect of a filter BIO may change according
30to the I/O operation it is performing: for example an encryption
31BIO will encrypt data if it is being written to and decrypt data
32if it is being read from.
33
34BIOs can be joined together to form a chain (a single BIO is a chain
35with one component). A chain normally consist of one source/sink
36BIO and one or more filter BIOs. Data read from or written to the
37first BIO then traverses the chain to the end (normally a source/sink
38BIO).
39
40=head1 SEE ALSO
41
42L<BIO_ctrl(3)|BIO_ctrl(3)>,
43L<BIO_f_base64(3)|BIO_f_base64(3)>,
44L<BIO_f_cipher(3)|BIO_f_cipher(3)>, L<BIO_f_md(3)|BIO_f_md(3)>,
45L<BIO_f_null(3)|BIO_f_null(3)>, L<BIO_f_ssl(3)|BIO_f_ssl(3)>,
46L<BIO_find_type(3)|BIO_find_type(3)>, L<BIO_new(3)|BIO_new(3)>,
47L<BIO_new_bio_pair(3)|BIO_new_bio_pair(3)>,
48L<BIO_push(3)|BIO_push(3)>, L<BIO_read(3)|BIO_read(3)>,
49L<BIO_s_accept(3)|BIO_s_accept(3)>, L<BIO_s_bio(3)|BIO_s_bio(3)>,
50L<BIO_s_connect(3)|BIO_s_connect(3)>, L<BIO_s_fd(3)|BIO_s_fd(3)>,
51L<BIO_s_file(3)|BIO_s_file(3)>, L<BIO_s_mem(3)|BIO_s_mem(3)>,
52L<BIO_s_null(3)|BIO_s_null(3)>, L<BIO_s_socket(3)|BIO_s_socket(3)>,
53L<BIO_set_callback(3)|BIO_set_callback(3)>,
54L<BIO_should_retry(3)|BIO_should_retry(3)>
diff --git a/src/lib/libssl/src/doc/crypto/blowfish.pod b/src/lib/libssl/src/doc/crypto/blowfish.pod
index e0b777418f..65b8be388c 100644
--- a/src/lib/libssl/src/doc/crypto/blowfish.pod
+++ b/src/lib/libssl/src/doc/crypto/blowfish.pod
@@ -11,9 +11,6 @@ BF_cfb64_encrypt, BF_ofb64_encrypt, BF_options - Blowfish encryption
11 11
12 void BF_set_key(BF_KEY *key, int len, const unsigned char *data); 12 void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
13 13
14 void BF_encrypt(BF_LONG *data,const BF_KEY *key);
15 void BF_decrypt(BF_LONG *data,const BF_KEY *key);
16
17 void BF_ecb_encrypt(const unsigned char *in, unsigned char *out, 14 void BF_ecb_encrypt(const unsigned char *in, unsigned char *out,
18 BF_KEY *key, int enc); 15 BF_KEY *key, int enc);
19 void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, 16 void BF_cbc_encrypt(const unsigned char *in, unsigned char *out,
@@ -25,10 +22,13 @@ BF_cfb64_encrypt, BF_ofb64_encrypt, BF_options - Blowfish encryption
25 long length, BF_KEY *schedule, unsigned char *ivec, int *num); 22 long length, BF_KEY *schedule, unsigned char *ivec, int *num);
26 const char *BF_options(void); 23 const char *BF_options(void);
27 24
25 void BF_encrypt(BF_LONG *data,const BF_KEY *key);
26 void BF_decrypt(BF_LONG *data,const BF_KEY *key);
27
28=head1 DESCRIPTION 28=head1 DESCRIPTION
29 29
30This library implements the Blowfish cipher, which is invented and described 30This library implements the Blowfish cipher, which is invented and described
31by Counterpane (see http://www.counterpane.com/blowfish/ ). 31by Counterpane (see http://www.counterpane.com/blowfish.html ).
32 32
33Blowfish is a block cipher that operates on 64 bit (8 byte) blocks of data. 33Blowfish is a block cipher that operates on 64 bit (8 byte) blocks of data.
34It uses a variable size key, but typically, 128 bit (16 byte) keys are 34It uses a variable size key, but typically, 128 bit (16 byte) keys are
@@ -43,11 +43,6 @@ phase.
43BF_set_key() sets up the B<BF_KEY> B<key> using the B<len> bytes long key 43BF_set_key() sets up the B<BF_KEY> B<key> using the B<len> bytes long key
44at B<data>. 44at B<data>.
45 45
46BF_encrypt() and BF_decrypt() are the lowest level functions for Blowfish
47encryption. They encrypt/decrypt the first 64 bits of the vector pointed by
48B<data>, using the key B<key>. These functions should not be used unless you
49implement 'modes' of Blowfish.
50
51BF_ecb_encrypt() is the basic Blowfish encryption and decryption function. 46BF_ecb_encrypt() is the basic Blowfish encryption and decryption function.
52It encrypts or decrypts the first 64 bits of B<in> using the key B<key>, 47It encrypts or decrypts the first 64 bits of B<in> using the key B<key>,
53putting the result in B<out>. B<enc> decides if encryption (B<BF_ENCRYPT>) 48putting the result in B<out>. B<enc> decides if encryption (B<BF_ENCRYPT>)
@@ -56,37 +51,45 @@ B<in> and B<out> must be 64 bits in length, no less. If they are larger,
56everything after the first 64 bits is ignored. 51everything after the first 64 bits is ignored.
57 52
58The mode functions BF_cbc_encrypt(), BF_cfb64_encrypt() and BF_ofb64_encrypt() 53The mode functions BF_cbc_encrypt(), BF_cfb64_encrypt() and BF_ofb64_encrypt()
59all operate on variable length data. They all take an initialisation vector 54all operate on variable length data. They all take an initialization vector
60B<ivec> which needs to be passed along into the next call of the same function 55B<ivec> which needs to be passed along into the next call of the same function
61for the same message. B<ivec> may be initialised with anything, but the 56for the same message. B<ivec> may be initialized with anything, but the
62recipient needs to know what it was initialised with, or it won't be able 57recipient needs to know what it was initialized with, or it won't be able
63to decrypt. Some programs and protocols simplify this, like SSH, where 58to decrypt. Some programs and protocols simplify this, like SSH, where
64B<ivec> is simply initialised to zero. 59B<ivec> is simply initialized to zero.
65BF_cbc_encrypt() operates of data that is a multiple of 8 bytes long, while 60BF_cbc_encrypt() operates of data that is a multiple of 8 bytes long, while
66BF_cfb64_encrypt() and BF_ofb64_encrypt() are used to encrypt an variable 61BF_cfb64_encrypt() and BF_ofb64_encrypt() are used to encrypt an variable
67number of bytes (the amount does not have to be an exact multiple of 8). The 62number of bytes (the amount does not have to be an exact multiple of 8). The
68purpose of the latter two is to simulate stream ciphers, and therefore, they 63purpose of the latter two is to simulate stream ciphers, and therefore, they
69need the parameter B<num>, which is a pointer to an integer where the current 64need the parameter B<num>, which is a pointer to an integer where the current
70offset in B<ivec> is stored between calls. This integer must be initialised 65offset in B<ivec> is stored between calls. This integer must be initialized
71to zero when B<ivec> is initialised. 66to zero when B<ivec> is initialized.
72 67
73BF_cbc_encrypt() is the Cipher Block Chaining function for Blowfish. It 68BF_cbc_encrypt() is the Cipher Block Chaining function for Blowfish. It
74encrypts or decrypts the 64 bits chunks of B<in> using the key B<schedule>, 69encrypts or decrypts the 64 bits chunks of B<in> using the key B<schedule>,
75putting the result in B<out>. B<enc> decides if encryption (BF_ENCRYPT) or 70putting the result in B<out>. B<enc> decides if encryption (BF_ENCRYPT) or
76decryption (BF_DECRYPT) shall be performed. B<ivec> must point at an 8 byte 71decryption (BF_DECRYPT) shall be performed. B<ivec> must point at an 8 byte
77long initialisation vector. 72long initialization vector.
78 73
79BF_cfb64_encrypt() is the CFB mode for Blowfish with 64 bit feedback. 74BF_cfb64_encrypt() is the CFB mode for Blowfish with 64 bit feedback.
80It encrypts or decrypts the bytes in B<in> using the key B<schedule>, 75It encrypts or decrypts the bytes in B<in> using the key B<schedule>,
81putting the result in B<out>. B<enc> decides if encryption (B<BF_ENCRYPT>) 76putting the result in B<out>. B<enc> decides if encryption (B<BF_ENCRYPT>)
82or decryption (B<BF_DECRYPT>) shall be performed. B<ivec> must point at an 77or decryption (B<BF_DECRYPT>) shall be performed. B<ivec> must point at an
838 byte long initialisation vector. B<num> must point at an integer which must 788 byte long initialization vector. B<num> must point at an integer which must
84be initially zero. 79be initially zero.
85 80
86BF_ofb64_encrypt() is the OFB mode for Blowfish with 64 bit feedback. 81BF_ofb64_encrypt() is the OFB mode for Blowfish with 64 bit feedback.
87It uses the same parameters as BF_cfb64_encrypt(), which must be initialised 82It uses the same parameters as BF_cfb64_encrypt(), which must be initialized
88the same way. 83the same way.
89 84
85BF_encrypt() and BF_decrypt() are the lowest level functions for Blowfish
86encryption. They encrypt/decrypt the first 64 bits of the vector pointed by
87B<data>, using the key B<key>. These functions should not be used unless you
88implement 'modes' of Blowfish. The alternative is to use BF_ecb_encrypt().
89If you still want to use these functions, you should be aware that they take
90each 32-bit chunk in host-byte order, which is little-endian on little-endian
91platforms and big-endian on big-endian ones.
92
90=head1 RETURN VALUES 93=head1 RETURN VALUES
91 94
92None of the functions presented here return any value. 95None of the functions presented here return any value.
diff --git a/src/lib/libssl/src/doc/crypto/bn_internal.pod b/src/lib/libssl/src/doc/crypto/bn_internal.pod
index 5af0c791c8..8da244aed4 100644
--- a/src/lib/libssl/src/doc/crypto/bn_internal.pod
+++ b/src/lib/libssl/src/doc/crypto/bn_internal.pod
@@ -149,7 +149,7 @@ word array B<a>, the B<nb> word array B<b> and the B<na>+B<nb> word
149array B<r>. It computes B<a>*B<b> and places the result in B<r>. 149array B<r>. It computes B<a>*B<b> and places the result in B<r>.
150 150
151bn_mul_low_normal(B<r>, B<a>, B<b>, B<n>) operates on the B<n> word 151bn_mul_low_normal(B<r>, B<a>, B<b>, B<n>) operates on the B<n> word
152arrays B<r>, B<a> und B<b>. It computes the B<n> low words of 152arrays B<r>, B<a> and B<b>. It computes the B<n> low words of
153B<a>*B<b> and places the result in B<r>. 153B<a>*B<b> and places the result in B<r>.
154 154
155bn_mul_recursive(B<r>, B<a>, B<b>, B<n2>, B<t>) operates on the B<n2> 155bn_mul_recursive(B<r>, B<a>, B<b>, B<n2>, B<t>) operates on the B<n2>
diff --git a/src/lib/libssl/src/doc/crypto/buffer.pod b/src/lib/libssl/src/doc/crypto/buffer.pod
index 7088f51bc4..781f5b11ee 100644
--- a/src/lib/libssl/src/doc/crypto/buffer.pod
+++ b/src/lib/libssl/src/doc/crypto/buffer.pod
@@ -46,11 +46,11 @@ size.
46 46
47BUF_strdup() copies a null terminated string into a block of allocated 47BUF_strdup() copies a null terminated string into a block of allocated
48memory and returns a pointer to the allocated block. 48memory and returns a pointer to the allocated block.
49Unlike the standard C library strdup() this function uses Malloc() and so 49Unlike the standard C library strdup() this function uses OPENSSL_malloc() and so
50should be used in preference to the standard library strdup() because it can 50should be used in preference to the standard library strdup() because it can
51be used for memory leak checking or replacing the malloc() function. 51be used for memory leak checking or replacing the malloc() function.
52 52
53The memory allocated from BUF_strdup() should be freed up using the Free() 53The memory allocated from BUF_strdup() should be freed up using the OPENSSL_free()
54function. 54function.
55 55
56=head1 RETURN VALUES 56=head1 RETURN VALUES
@@ -68,6 +68,6 @@ L<bio(3)|bio(3)>
68=head1 HISTORY 68=head1 HISTORY
69 69
70BUF_MEM_new(), BUF_MEM_free() and BUF_MEM_grow() are available in all 70BUF_MEM_new(), BUF_MEM_free() and BUF_MEM_grow() are available in all
71versions of SSLeay and OpenSSL. BUF_strdup() was addded in SSLeay 0.8. 71versions of SSLeay and OpenSSL. BUF_strdup() was added in SSLeay 0.8.
72 72
73=cut 73=cut
diff --git a/src/lib/libssl/src/doc/crypto/crypto.pod b/src/lib/libssl/src/doc/crypto/crypto.pod
index c3d74b4587..07ba7e5bc9 100644
--- a/src/lib/libssl/src/doc/crypto/crypto.pod
+++ b/src/lib/libssl/src/doc/crypto/crypto.pod
@@ -28,7 +28,7 @@ hash functions and a cryptographic pseudo-random number generator.
28=item SYMMETRIC CIPHERS 28=item SYMMETRIC CIPHERS
29 29
30L<blowfish(3)|blowfish(3)>, L<cast(3)|cast(3)>, L<des(3)|des(3)>, 30L<blowfish(3)|blowfish(3)>, L<cast(3)|cast(3)>, L<des(3)|des(3)>,
31L<idea(3)|idea(3)>, L<rc2(3)|rc2(3)>, L<RC4(3)|RC4(3)>, L<rc5(3)|rc5(3)> 31L<idea(3)|idea(3)>, L<rc2(3)|rc2(3)>, L<rc4(3)|rc4(3)>, L<rc5(3)|rc5(3)>
32 32
33=item PUBLIC KEY CRYPTOGRAPHY AND KEY AGREEMENT 33=item PUBLIC KEY CRYPTOGRAPHY AND KEY AGREEMENT
34 34
@@ -40,17 +40,17 @@ L<x509(3)|x509(3)>, L<x509v3(3)|x509v3(3)>
40 40
41=item AUTHENTICATION CODES, HASH FUNCTIONS 41=item AUTHENTICATION CODES, HASH FUNCTIONS
42 42
43L<HMAC(3)|HMAC(3)>, L<MD2(3)|MD2(3)>, L<MD5(3)|MD5(3)>, L<MDC2(3)|MDC2(3)>, 43L<hmac(3)|hmac(3)>, L<md2(3)|md2(3)>, L<md4(3)|md4(3)>,
44L<RIPEMD160(3)|RIPEMD160(3)>, L<SHA1(3)|SHA1(3)> 44L<md5(3)|md5(3)>, L<mdc2(3)|mdc2(3)>, L<ripemd(3)|ripemd(3)>,
45L<sha(3)|sha(3)>
45 46
46=item AUXILIARY FUNCTIONS 47=item AUXILIARY FUNCTIONS
47 48
48L<err(3)|err(3)>, L<CRYPTO_set_locking_callback(3)|CRYPTO_set_locking_callback(3)>, L<rand(3)|rand(3)> 49L<err(3)|err(3)>, L<threads(3)|threads(3)>, L<rand(3)|rand(3)>
49 50
50=item INPUT/OUTPUT, DATA ENCODING 51=item INPUT/OUTPUT, DATA ENCODING
51 52
52L<asn1(3)|asn1(3)>, L<bio(3)|bio(3)>, L<evp(3)|evp(3)>, 53L<asn1(3)|asn1(3)>, L<bio(3)|bio(3)>, L<evp(3)|evp(3)>, L<pem(3)|pem(3)>,
53L<EVP_DigestInit(3)|EVP_DigestInit(3)>, L<pem(3)|pem(3)>,
54L<pkcs7(3)|pkcs7(3)>, L<pkcs12(3)|pkcs12(3)> 54L<pkcs7(3)|pkcs7(3)>, L<pkcs12(3)|pkcs12(3)>
55 55
56=item INTERNAL FUNCTIONS 56=item INTERNAL FUNCTIONS
diff --git a/src/lib/libssl/src/doc/crypto/des.pod b/src/lib/libssl/src/doc/crypto/des.pod
index 1ca6bfb78f..99080391b1 100644
--- a/src/lib/libssl/src/doc/crypto/des.pod
+++ b/src/lib/libssl/src/doc/crypto/des.pod
@@ -130,7 +130,7 @@ earlier versions of the library, des_random_key() did not generate
130secure keys. 130secure keys.
131 131
132Before a DES key can be used, it must be converted into the 132Before a DES key can be used, it must be converted into the
133architecture dependant I<des_key_schedule> via the 133architecture dependent I<des_key_schedule> via the
134des_set_key_checked() or des_set_key_unchecked() function. 134des_set_key_checked() or des_set_key_unchecked() function.
135 135
136des_set_key_checked() will check that the key passed is of odd parity 136des_set_key_checked() will check that the key passed is of odd parity
@@ -200,7 +200,7 @@ reusing I<ks1> for the final encryption. C<C=E(ks1,D(ks2,E(ks1,M)))>.
200This form of Triple-DES is used by the RSAREF library. 200This form of Triple-DES is used by the RSAREF library.
201 201
202des_pcbc_encrypt() encrypt/decrypts using the propagating cipher block 202des_pcbc_encrypt() encrypt/decrypts using the propagating cipher block
203chaing mode used by Kerberos v4. Its parameters are the same as 203chaining mode used by Kerberos v4. Its parameters are the same as
204des_ncbc_encrypt(). 204des_ncbc_encrypt().
205 205
206des_cfb_encrypt() encrypt/decrypts using cipher feedback mode. This 206des_cfb_encrypt() encrypt/decrypts using cipher feedback mode. This
@@ -241,7 +241,7 @@ compatibility with the MIT Kerberos library. des_read_pw_string()
241is also available under the name EVP_read_pw_string(). 241is also available under the name EVP_read_pw_string().
242 242
243des_read_pw_string() writes the string specified by I<prompt> to 243des_read_pw_string() writes the string specified by I<prompt> to
244standarf output, turns echo off and reads in input string from the 244standard output, turns echo off and reads in input string from the
245terminal. The string is returned in I<buf>, which must have space for 245terminal. The string is returned in I<buf>, which must have space for
246at least I<length> bytes. If I<verify> is set, the user is asked for 246at least I<length> bytes. If I<verify> is set, the user is asked for
247the password twice and unless the two copies match, an error is 247the password twice and unless the two copies match, an error is
@@ -268,9 +268,9 @@ input, depending on I<out_count>, 1, 2, 3 or 4 times. If I<output> is
268non-NULL, the 8 bytes generated by each pass are written into 268non-NULL, the 8 bytes generated by each pass are written into
269I<output>. 269I<output>.
270 270
271The following are DES-based tranformations: 271The following are DES-based transformations:
272 272
273des_fcrypt() is a fast version of the unix crypt(3) function. This 273des_fcrypt() is a fast version of the Unix crypt(3) function. This
274version takes only a small amount of space relative to other fast 274version takes only a small amount of space relative to other fast
275crypt() implementations. This is different to the normal crypt in 275crypt() implementations. This is different to the normal crypt in
276that the third parameter is the buffer that the return value is 276that the third parameter is the buffer that the return value is
diff --git a/src/lib/libssl/src/doc/crypto/des_modes.pod b/src/lib/libssl/src/doc/crypto/des_modes.pod
index ee4f2238c7..8e5074d24c 100644
--- a/src/lib/libssl/src/doc/crypto/des_modes.pod
+++ b/src/lib/libssl/src/doc/crypto/des_modes.pod
@@ -6,7 +6,7 @@ des_modes - the variants of DES and other crypto algorithms of OpenSSL
6 6
7=head1 DESCRIPTION 7=head1 DESCRIPTION
8 8
9Several crypto algorithms fo OpenSSL can be used in a number of modes. Those 9Several crypto algorithms for OpenSSL can be used in a number of modes. Those
10are used for using block ciphers in a way similar to stream ciphers, among 10are used for using block ciphers in a way similar to stream ciphers, among
11other things. 11other things.
12 12
@@ -165,13 +165,13 @@ only one bit to be in error in the deciphered plaintext.
165 165
166=item * 166=item *
167 167
168OFB mode is not self-synchronising. If the two operation of 168OFB mode is not self-synchronizing. If the two operation of
169encipherment and decipherment get out of synchronism, the system needs 169encipherment and decipherment get out of synchronism, the system needs
170to be re-initialised. 170to be re-initialized.
171 171
172=item * 172=item *
173 173
174Each re-initialisation should use a value of the start variable 174Each re-initialization should use a value of the start variable
175different from the start variable values used before with the same 175different from the start variable values used before with the same
176key. The reason for this is that an identical bit stream would be 176key. The reason for this is that an identical bit stream would be
177produced each time from the same parameters. This would be 177produced each time from the same parameters. This would be
diff --git a/src/lib/libssl/src/doc/crypto/dh.pod b/src/lib/libssl/src/doc/crypto/dh.pod
index 0a9b7c03a2..b4be4be405 100644
--- a/src/lib/libssl/src/doc/crypto/dh.pod
+++ b/src/lib/libssl/src/doc/crypto/dh.pod
@@ -7,6 +7,7 @@ dh - Diffie-Hellman key agreement
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/dh.h> 9 #include <openssl/dh.h>
10 #include <openssl/engine.h>
10 11
11 DH * DH_new(void); 12 DH * DH_new(void);
12 void DH_free(DH *dh); 13 void DH_free(DH *dh);
@@ -20,10 +21,10 @@ dh - Diffie-Hellman key agreement
20 int DH_generate_key(DH *dh); 21 int DH_generate_key(DH *dh);
21 int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh); 22 int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh);
22 23
23 void DH_set_default_method(DH_METHOD *meth); 24 void DH_set_default_openssl_method(DH_METHOD *meth);
24 DH_METHOD *DH_get_default_method(void); 25 DH_METHOD *DH_get_default_openssl_method(void);
25 DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth); 26 int DH_set_method(DH *dh, ENGINE *engine);
26 DH *DH_new_method(DH_METHOD *meth); 27 DH *DH_new_method(ENGINE *engine);
27 DH_METHOD *DH_OpenSSL(void); 28 DH_METHOD *DH_OpenSSL(void);
28 29
29 int DH_get_ex_new_index(long argl, char *argp, int (*new_func)(), 30 int DH_get_ex_new_index(long argl, char *argp, int (*new_func)(),
diff --git a/src/lib/libssl/src/doc/crypto/dsa.pod b/src/lib/libssl/src/doc/crypto/dsa.pod
index 80ecf38178..573500204b 100644
--- a/src/lib/libssl/src/doc/crypto/dsa.pod
+++ b/src/lib/libssl/src/doc/crypto/dsa.pod
@@ -7,6 +7,7 @@ dsa - Digital Signature Algorithm
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/dsa.h> 9 #include <openssl/dsa.h>
10 #include <openssl/engine.h>
10 11
11 DSA * DSA_new(void); 12 DSA * DSA_new(void);
12 void DSA_free(DSA *dsa); 13 void DSA_free(DSA *dsa);
@@ -28,10 +29,10 @@ dsa - Digital Signature Algorithm
28 int DSA_verify(int dummy, const unsigned char *dgst, int len, 29 int DSA_verify(int dummy, const unsigned char *dgst, int len,
29 unsigned char *sigbuf, int siglen, DSA *dsa); 30 unsigned char *sigbuf, int siglen, DSA *dsa);
30 31
31 void DSA_set_default_method(DSA_METHOD *meth); 32 void DSA_set_default_openssl_method(DSA_METHOD *meth);
32 DSA_METHOD *DSA_get_default_method(void); 33 DSA_METHOD *DSA_get_default_openssl_method(void);
33 DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth); 34 int DSA_set_method(DSA *dsa, ENGINE *engine);
34 DSA *DSA_new_method(DSA_METHOD *meth); 35 DSA *DSA_new_method(ENGINE *engine);
35 DSA_METHOD *DSA_OpenSSL(void); 36 DSA_METHOD *DSA_OpenSSL(void);
36 37
37 int DSA_get_ex_new_index(long argl, char *argp, int (*new_func)(), 38 int DSA_get_ex_new_index(long argl, char *argp, int (*new_func)(),
diff --git a/src/lib/libssl/src/doc/crypto/err.pod b/src/lib/libssl/src/doc/crypto/err.pod
index b824c92b57..264e30103d 100644
--- a/src/lib/libssl/src/doc/crypto/err.pod
+++ b/src/lib/libssl/src/doc/crypto/err.pod
@@ -143,7 +143,7 @@ The closing #endif etc will be automatically added by the script.
143 143
144The generated C error code file B<xxx_err.c> will load the header 144The generated C error code file B<xxx_err.c> will load the header
145files B<stdio.h>, B<openssl/err.h> and B<openssl/xxx.h> so the 145files B<stdio.h>, B<openssl/err.h> and B<openssl/xxx.h> so the
146header file must load any additional header files containg any 146header file must load any additional header files containing any
147definitions it uses. 147definitions it uses.
148 148
149=head1 USING ERROR CODES IN EXTERNAL LIBRARIES 149=head1 USING ERROR CODES IN EXTERNAL LIBRARIES
diff --git a/src/lib/libssl/src/doc/crypto/evp.pod b/src/lib/libssl/src/doc/crypto/evp.pod
new file mode 100644
index 0000000000..f089dd49a2
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/evp.pod
@@ -0,0 +1,37 @@
1=pod
2
3=head1 NAME
4
5evp - high-level cryptographic functions
6
7=head1 SYNOPSIS
8
9 #include <openssl/evp.h>
10
11=head1 DESCRIPTION
12
13The EVP library provided a high-level interface to cryptographic
14functions.
15
16B<EVP_Seal>I<...> and B<EVP_Open>I<...> provide public key encryption
17and decryption to implement digital "envelopes".
18
19The B<EVP_Sign>I<...> and B<EVP_Verify>I<...> functions implement
20digital signatures.
21
22Symmetric encryption is available with the B<EVP_Encrypt>I<...>
23functions. The B<EVP_Digest>I<...> functions provide message digests.
24
25Algorithms are loaded with OpenSSL_add_all_algorithms(3).
26
27=head1 SEE ALSO
28
29L<EVP_DigestInit(3)|EVP_DigestInit(3)>,
30L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>,
31L<EVP_OpenInit(3)|EVP_OpenInit(3)>,
32L<EVP_SealInit(3)|EVP_SealInit(3)>,
33L<EVP_SignInit(3)|EVP_SignInit(3)>,
34L<EVP_VerifyInit(3)|EVP_VerifyInit(3)>,
35L<OpenSSL_add_all_algorithms(3)|OpenSSL_add_all_algorithms(3)>
36
37=cut
diff --git a/src/lib/libssl/src/doc/crypto/hmac.pod b/src/lib/libssl/src/doc/crypto/hmac.pod
index 095e537da1..631f40377e 100644
--- a/src/lib/libssl/src/doc/crypto/hmac.pod
+++ b/src/lib/libssl/src/doc/crypto/hmac.pod
@@ -2,7 +2,8 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5HMAC, HMAC_Init, HMAC_Update, HMAC_Final - HMAC message authentication code 5HMAC, HMAC_Init, HMAC_Update, HMAC_Final, HMAC_cleanup - HMAC message
6authentication code
6 7
7=head1 SYNOPSIS 8=head1 SYNOPSIS
8 9
diff --git a/src/lib/libssl/src/doc/crypto/lhash.pod b/src/lib/libssl/src/doc/crypto/lhash.pod
index af2c9a7102..4e87aee824 100644
--- a/src/lib/libssl/src/doc/crypto/lhash.pod
+++ b/src/lib/libssl/src/doc/crypto/lhash.pod
@@ -102,7 +102,7 @@ The following description is based on the SSLeay documentation:
102The B<lhash> library implements a hash table described in the 102The B<lhash> library implements a hash table described in the
103I<Communications of the ACM> in 1991. What makes this hash table 103I<Communications of the ACM> in 1991. What makes this hash table
104different is that as the table fills, the hash table is increased (or 104different is that as the table fills, the hash table is increased (or
105decreased) in size via Realloc(). When a 'resize' is done, instead of 105decreased) in size via OPENSSL_realloc(). When a 'resize' is done, instead of
106all hashes being redistributed over twice as many 'buckets', one 106all hashes being redistributed over twice as many 'buckets', one
107bucket is split. So when an 'expand' is done, there is only a minimal 107bucket is split. So when an 'expand' is done, there is only a minimal
108cost to redistribute some values. Subsequent inserts will cause more 108cost to redistribute some values. Subsequent inserts will cause more
diff --git a/src/lib/libssl/src/doc/crypto/md5.pod b/src/lib/libssl/src/doc/crypto/md5.pod
index e9d7ccd689..6e6322dcdc 100644
--- a/src/lib/libssl/src/doc/crypto/md5.pod
+++ b/src/lib/libssl/src/doc/crypto/md5.pod
@@ -2,8 +2,8 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5MD2, MD5, MD2_Init, MD2_Update, MD2_Final, MD5_Init, MD5_Update, 5MD2, MD4, MD5, MD2_Init, MD2_Update, MD2_Final, MD4_Init, MD4_Update,
6MD5_Final - MD2 and MD5 hash functions 6MD4_Final, MD5_Init, MD5_Update, MD5_Final - MD2, MD4, and MD5 hash functions
7 7
8=head1 SYNOPSIS 8=head1 SYNOPSIS
9 9
@@ -18,6 +18,17 @@ MD5_Final - MD2 and MD5 hash functions
18 void MD2_Final(unsigned char *md, MD2_CTX *c); 18 void MD2_Final(unsigned char *md, MD2_CTX *c);
19 19
20 20
21 #include <openssl/md4.h>
22
23 unsigned char *MD4(const unsigned char *d, unsigned long n,
24 unsigned char *md);
25
26 void MD4_Init(MD4_CTX *c);
27 void MD4_Update(MD4_CTX *c, const void *data,
28 unsigned long len);
29 void MD4_Final(unsigned char *md, MD4_CTX *c);
30
31
21 #include <openssl/md5.h> 32 #include <openssl/md5.h>
22 33
23 unsigned char *MD5(const unsigned char *d, unsigned long n, 34 unsigned char *MD5(const unsigned char *d, unsigned long n,
@@ -30,12 +41,13 @@ MD5_Final - MD2 and MD5 hash functions
30 41
31=head1 DESCRIPTION 42=head1 DESCRIPTION
32 43
33MD2 and MD5 are cryptographic hash functions with a 128 bit output. 44MD2, MD4, and MD5 are cryptographic hash functions with a 128 bit output.
34 45
35MD2() and MD5() compute the MD2 and MD5 message digest of the B<n> 46MD2(), MD4(), and MD5() compute the MD2, MD4, and MD5 message digest
36bytes at B<d> and place it in B<md> (which must have space for 47of the B<n> bytes at B<d> and place it in B<md> (which must have space
37MD2_DIGEST_LENGTH == MD5_DIGEST_LENGTH == 16 bytes of output). If 48for MD2_DIGEST_LENGTH == MD4_DIGEST_LENGTH == MD5_DIGEST_LENGTH == 16
38B<md> is NULL, the digest is placed in a static array. 49bytes of output). If B<md> is NULL, the digest is placed in a static
50array.
39 51
40The following functions may be used if the message is not completely 52The following functions may be used if the message is not completely
41stored in memory: 53stored in memory:
@@ -48,8 +60,8 @@ be hashed (B<len> bytes at B<data>).
48MD2_Final() places the message digest in B<md>, which must have space 60MD2_Final() places the message digest in B<md>, which must have space
49for MD2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MD2_CTX>. 61for MD2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MD2_CTX>.
50 62
51MD5_Init(), MD5_Update() and MD5_Final() are analogous using an 63MD4_Init(), MD4_Update(), MD4_Final(), MD5_Init(), MD5_Update(), and
52B<MD5_CTX> structure. 64MD5_Final() are analogous using an B<MD4_CTX> and B<MD5_CTX> structure.
53 65
54Applications should use the higher level functions 66Applications should use the higher level functions
55L<EVP_DigestInit(3)|EVP_DigestInit(3)> 67L<EVP_DigestInit(3)|EVP_DigestInit(3)>
@@ -57,24 +69,25 @@ etc. instead of calling the hash functions directly.
57 69
58=head1 NOTE 70=head1 NOTE
59 71
60MD2 and MD5 are recommended only for compatibility with existing 72MD2, MD4, and MD5 are recommended only for compatibility with existing
61applications. In new applications, SHA-1 or RIPEMD-160 should be 73applications. In new applications, SHA-1 or RIPEMD-160 should be
62preferred. 74preferred.
63 75
64=head1 RETURN VALUES 76=head1 RETURN VALUES
65 77
66MD2() and MD5() return pointers to the hash value. 78MD2(), MD4(), and MD5() return pointers to the hash value.
67 79
68MD2_Init(), MD2_Update() MD2_Final(), MD5_Init(), MD5_Update() and 80MD2_Init(), MD2_Update(), MD2_Final(), MD4_Init(), MD4_Update(),
69MD5_Final() do not return values. 81MD4_Final(), MD5_Init(), MD5_Update(), and MD5_Final() do not return
82values.
70 83
71=head1 CONFORMING TO 84=head1 CONFORMING TO
72 85
73RFC 1319, RFC 1321 86RFC 1319, RFC 1320, RFC 1321
74 87
75=head1 SEE ALSO 88=head1 SEE ALSO
76 89
77L<SHA1(3)|SHA1(3)>, L<RIPEMD160(3)|RIPEMD160(3)>, L<EVP_DigestInit(3)|EVP_DigestInit(3)> 90L<sha(3)|sha(3)>, L<ripemd(3)|ripemd(3)>, L<EVP_DigestInit(3)|EVP_DigestInit(3)>
78 91
79=head1 HISTORY 92=head1 HISTORY
80 93
@@ -82,4 +95,7 @@ MD2(), MD2_Init(), MD2_Update() MD2_Final(), MD5(), MD5_Init(),
82MD5_Update() and MD5_Final() are available in all versions of SSLeay 95MD5_Update() and MD5_Final() are available in all versions of SSLeay
83and OpenSSL. 96and OpenSSL.
84 97
98MD4(), MD4_Init(), and MD4_Update() are available in OpenSSL 0.9.6 and
99above.
100
85=cut 101=cut
diff --git a/src/lib/libssl/src/doc/crypto/rsa.pod b/src/lib/libssl/src/doc/crypto/rsa.pod
index eb8ba612c4..ef0d4df205 100644
--- a/src/lib/libssl/src/doc/crypto/rsa.pod
+++ b/src/lib/libssl/src/doc/crypto/rsa.pod
@@ -7,6 +7,7 @@ rsa - RSA public key cryptosystem
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/rsa.h> 9 #include <openssl/rsa.h>
10 #include <openssl/engine.h>
10 11
11 RSA * RSA_new(void); 12 RSA * RSA_new(void);
12 void RSA_free(RSA *rsa); 13 void RSA_free(RSA *rsa);
@@ -31,15 +32,15 @@ rsa - RSA public key cryptosystem
31 int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); 32 int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
32 void RSA_blinding_off(RSA *rsa); 33 void RSA_blinding_off(RSA *rsa);
33 34
34 void RSA_set_default_method(RSA_METHOD *meth); 35 void RSA_set_default_openssl_method(RSA_METHOD *meth);
35 RSA_METHOD *RSA_get_default_method(void); 36 RSA_METHOD *RSA_get_default_openssl_method(void);
36 RSA_METHOD *RSA_set_method(RSA *rsa, RSA_METHOD *meth); 37 int RSA_set_method(RSA *rsa, ENGINE *engine);
37 RSA_METHOD *RSA_get_method(RSA *rsa); 38 RSA_METHOD *RSA_get_method(RSA *rsa);
38 RSA_METHOD *RSA_PKCS1_SSLeay(void); 39 RSA_METHOD *RSA_PKCS1_SSLeay(void);
39 RSA_METHOD *RSA_PKCS1_RSAref(void); 40 RSA_METHOD *RSA_PKCS1_RSAref(void);
40 RSA_METHOD *RSA_null_method(void); 41 RSA_METHOD *RSA_null_method(void);
41 int RSA_flags(RSA *rsa); 42 int RSA_flags(RSA *rsa);
42 RSA *RSA_new_method(RSA_METHOD *method); 43 RSA *RSA_new_method(ENGINE *engine);
43 44
44 int RSA_print(BIO *bp, RSA *x, int offset); 45 int RSA_print(BIO *bp, RSA *x, int offset);
45 int RSA_print_fp(FILE *fp, RSA *x, int offset); 46 int RSA_print_fp(FILE *fp, RSA *x, int offset);
@@ -96,7 +97,7 @@ SSL, PKCS #1 v2.0
96 97
97=head1 PATENTS 98=head1 PATENTS
98 99
99RSA is covered by a US patent which expires in September 2000. 100RSA was covered by a US patent which expired in September 2000.
100 101
101=head1 SEE ALSO 102=head1 SEE ALSO
102 103
diff --git a/src/lib/libssl/src/doc/crypto/threads.pod b/src/lib/libssl/src/doc/crypto/threads.pod
index 5da056f3f8..bc7ff9b705 100644
--- a/src/lib/libssl/src/doc/crypto/threads.pod
+++ b/src/lib/libssl/src/doc/crypto/threads.pod
@@ -2,7 +2,10 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5CRYPTO_set_locking_callback, CRYPTO_set_id_callback - OpenSSL thread support 5CRYPTO_set_locking_callback, CRYPTO_set_id_callback, CRYPTO_num_locks,
6CRYPTO_set_dynlock_create_callback, CRYPTO_set_dynlock_lock_callback,
7CRYPTO_set_dynlock_destroy_callback, CRYPTO_get_new_dynlockid,
8CRYPTO_destroy_dynlockid, CRYPTO_lock - OpenSSL thread support
6 9
7=head1 SYNOPSIS 10=head1 SYNOPSIS
8 11
@@ -15,13 +18,42 @@ CRYPTO_set_locking_callback, CRYPTO_set_id_callback - OpenSSL thread support
15 18
16 int CRYPTO_num_locks(void); 19 int CRYPTO_num_locks(void);
17 20
21
22 /* struct CRYPTO_dynlock_value needs to be defined by the user */
23 struct CRYPTO_dynlock_value;
24
25 void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *
26 (*dyn_create_function)(char *file, int line));
27 void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)
28 (int mode, struct CRYPTO_dynlock_value *l,
29 const char *file, int line));
30 void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)
31 (struct CRYPTO_dynlock_value *l, const char *file, int line));
32
33 int CRYPTO_get_new_dynlockid(void);
34
35 void CRYPTO_destroy_dynlockid(int i);
36
37 void CRYPTO_lock(int mode, int n, const char *file, int line);
38
39 #define CRYPTO_w_lock(type) \
40 CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
41 #define CRYPTO_w_unlock(type) \
42 CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
43 #define CRYPTO_r_lock(type) \
44 CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__)
45 #define CRYPTO_r_unlock(type) \
46 CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__)
47 #define CRYPTO_add(addr,amount,type) \
48 CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__)
49
18=head1 DESCRIPTION 50=head1 DESCRIPTION
19 51
20OpenSSL can safely be used in multi-threaded applications provided 52OpenSSL can safely be used in multi-threaded applications provided
21that two callback functions are set. 53that at least two callback functions are set.
22 54
23locking_function(int mode, int n, const char *file, int line) is 55locking_function(int mode, int n, const char *file, int line) is
24needed to perform locking on shared data stuctures. Multi-threaded 56needed to perform locking on shared data structures. Multi-threaded
25applications will crash at random if it is not set. 57applications will crash at random if it is not set.
26 58
27locking_function() must be able to handle up to CRYPTO_num_locks() 59locking_function() must be able to handle up to CRYPTO_num_locks()
@@ -35,9 +67,59 @@ id_function(void) is a function that returns a thread ID. It is not
35needed on Windows nor on platforms where getpid() returns a different 67needed on Windows nor on platforms where getpid() returns a different
36ID for each thread (most notably Linux). 68ID for each thread (most notably Linux).
37 69
70Additionally, OpenSSL supports dynamic locks, and sometimes, some parts
71of OpenSSL need it for better performance. To enable this, the following
72is required:
73
74=over 4
75
76=item *
77Three additional callback function, dyn_create_function, dyn_lock_function
78and dyn_destroy_function.
79
80=item *
81A structure defined with the data that each lock needs to handle.
82
83=back
84
85struct CRYPTO_dynlock_value has to be defined to contain whatever structure
86is needed to handle locks.
87
88dyn_create_function(const char *file, int line) is needed to create a
89lock. Multi-threaded applications might crash at random if it is not set.
90
91dyn_lock_function(int mode, CRYPTO_dynlock *l, const char *file, int line)
92is needed to perform locking off dynamic lock numbered n. Multi-threaded
93applications might crash at random if it is not set.
94
95dyn_destroy_function(CRYPTO_dynlock *l, const char *file, int line) is
96needed to destroy the lock l. Multi-threaded applications might crash at
97random if it is not set.
98
99CRYPTO_get_new_dynlockid() is used to create locks. It will call
100dyn_create_function for the actual creation.
101
102CRYPTO_destroy_dynlockid() is used to destroy locks. It will call
103dyn_destroy_function for the actual destruction.
104
105CRYPTO_lock() is used to lock and unlock the locks. mode is a bitfield
106describing what should be done with the lock. n is the number of the
107lock as returned from CRYPTO_get_new_dynlockid(). mode can be combined
108from the following values. These values are pairwise exclusive, with
109undefined behaviour if misused (for example, CRYPTO_READ and CRYPTO_WRITE
110should not be used together):
111
112 CRYPTO_LOCK 0x01
113 CRYPTO_UNLOCK 0x02
114 CRYPTO_READ 0x04
115 CRYPTO_WRITE 0x08
116
38=head1 RETURN VALUES 117=head1 RETURN VALUES
39 118
40CRYPTO_num_locks() returns the required number of locks. 119CRYPTO_num_locks() returns the required number of locks.
120
121CRYPTO_get_new_dynlockid() returns the index to the newly created lock.
122
41The other functions return no values. 123The other functions return no values.
42 124
43=head1 NOTE 125=head1 NOTE
@@ -52,6 +134,9 @@ You can find out if OpenSSL was configured with thread support:
52 // no thread support 134 // no thread support
53 #endif 135 #endif
54 136
137Also, dynamic locks are currently not used internally by OpenSSL, but
138may do so in the future.
139
55=head1 EXAMPLES 140=head1 EXAMPLES
56 141
57B<crypto/threads/mttest.c> shows examples of the callback functions on 142B<crypto/threads/mttest.c> shows examples of the callback functions on
@@ -62,6 +147,7 @@ Solaris, Irix and Win32.
62CRYPTO_set_locking_callback() and CRYPTO_set_id_callback() are 147CRYPTO_set_locking_callback() and CRYPTO_set_id_callback() are
63available in all versions of SSLeay and OpenSSL. 148available in all versions of SSLeay and OpenSSL.
64CRYPTO_num_locks() was added in OpenSSL 0.9.4. 149CRYPTO_num_locks() was added in OpenSSL 0.9.4.
150All functions dealing with dynamic locks were added in OpenSSL 0.9.5b-dev.
65 151
66=head1 SEE ALSO 152=head1 SEE ALSO
67 153
diff --git a/src/lib/libssl/src/doc/openssl.txt b/src/lib/libssl/src/doc/openssl.txt
index 880eace4da..5da519e7e4 100644
--- a/src/lib/libssl/src/doc/openssl.txt
+++ b/src/lib/libssl/src/doc/openssl.txt
@@ -355,6 +355,24 @@ that would not make sense. It does support an additional issuer:copy option
355that will copy all the subject alternative name values from the issuer 355that will copy all the subject alternative name values from the issuer
356certificate (if possible). 356certificate (if possible).
357 357
358Example:
359
360issuserAltName = issuer:copy
361
362Authority Info Access.
363
364The authority information access extension gives details about how to access
365certain information relating to the CA. Its syntax is accessOID;location
366where 'location' has the same syntax as subject alternative name (except
367that email:copy is not supported). accessOID can be any valid OID but only
368certain values are meaningful for example OCSP and caIssuers. OCSP gives the
369location of an OCSP responder: this is used by Netscape PSM and other software.
370
371Example:
372
373authorityInfoAccess = OCSP;URI:http://ocsp.my.host/
374authorityInfoAccess = caIssuers;URI:http://my.ca/ca.html
375
358CRL distribution points. 376CRL distribution points.
359 377
360This is a multi-valued extension that supports all the literal options of 378This is a multi-valued extension that supports all the literal options of
@@ -489,6 +507,47 @@ details about the structures returned. The returned structure should be freed
489after use using the relevant free function, BASIC_CONSTRAINTS_free() for 507after use using the relevant free function, BASIC_CONSTRAINTS_free() for
490example. 508example.
491 509
510void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx);
511void * X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx);
512void * X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx);
513void * X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx);
514
515These functions combine the operations of searching for extensions and
516parsing them. They search a certificate, a CRL a CRL entry or a stack
517of extensions respectively for extension whose NID is 'nid' and return
518the parsed result of NULL if an error occurred. For example:
519
520BASIC_CONSTRAINTS *bs;
521bs = X509_get_ext_d2i(cert, NID_basic_constraints, NULL, NULL);
522
523This will search for the basicConstraints extension and either return
524it value or NULL. NULL can mean either the extension was not found, it
525occurred more than once or it could not be parsed.
526
527If 'idx' is NULL then an extension is only parsed if it occurs precisely
528once. This is standard behaviour because extensions normally cannot occur
529more than once. If however more than one extension of the same type can
530occur it can be used to parse successive extensions for example:
531
532int i;
533void *ext;
534
535i = -1;
536for(;;) {
537 ext = X509_get_ext_d2i(x, nid, crit, &idx);
538 if(ext == NULL) break;
539 /* Do something with ext */
540}
541
542If 'crit' is not NULL and the extension was found then the int it points to
543is set to 1 for critical extensions and 0 for non critical. Therefore if the
544function returns NULL but 'crit' is set to 0 or 1 then the extension was
545found but it could not be parsed.
546
547The int pointed to by crit will be set to -1 if the extension was not found
548and -2 if the extension occurred more than once (this will only happen if
549idx is NULL). In both cases the function will return NULL.
550
4923. Generating extensions. 5513. Generating extensions.
493 552
494An extension will typically be generated from a configuration file, or some 553An extension will typically be generated from a configuration file, or some
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
new file mode 100644
index 0000000000..7fea14ee68
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_CIPHER_get_name.pod
@@ -0,0 +1,57 @@
1=pod
2
3=head1 NAME
4
5SSL_CIPHER_get_name, SSL_CIPHER_get_bits, SSL_CIPHER_get_version,
6SSL_CIPHER_description - get SSL_CIPHER properties
7
8=head1 SYNOPSIS
9
10 #include <openssl/ssl.h>
11
12 const char *SSL_CIPHER_get_name(SSL_CIPHER *cipher);
13 int SSL_CIPHER_get_bits(SSL_CIPHER *cipher, int *alg_bits);
14 char *SSL_CIPHER_get_version(SSL_CIPHER *cipher);
15 char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int size);
16
17=head1 DESCRIPTION
18
19SSL_CIPHER_get_name() returns a pointer to the name of B<cipher>. If the
20argument is the NULL pointer, a pointer to the constant value "NONE" is
21returned.
22
23SSL_CIPHER_get_bits() returns the number of secret bits used for B<cipher>. If
24B<alg_bits> is not NULL, it contains the number of bits processed by the
25chosen algorithm. If B<cipher> is NULL, 0 is returned.
26
27SSL_CIPHER_get_version() returns the protocol version for B<cipher>, currently
28"SSLv2", "SSLv3", or "TLSv1". If B<cipher> is NULL, "(NONE)" is returned.
29
30SSL_CIPHER_description() returns a textual description of the cipher used
31into the buffer B<buf> of length B<len> provided. B<len> must be at least
32128 bytes, otherwise the string "Buffer too small" is returned. If B<buf>
33is NULL, a buffer of 128 bytes is allocated using OPENSSL_malloc(). If the
34allocation fails, the string "OPENSSL_malloc Error" is returned.
35
36=head1 NOTES
37
38The number of bits processed can be different from the secret bits. An
39export cipher like e.g. EXP-RC4-MD5 has only 40 secret bits. The algorithm
40does use the full 128 bits (which would be returned for B<alg_bits>), of
41which however 88bits are fixed. The search space is hence only 40 bits.
42
43=head1 BUGS
44
45If SSL_CIPHER_description() is called with B<cipher> being NULL, the
46library crashes.
47
48=head1 RETURN VALUES
49
50See DESCRIPTION
51
52=head1 SEE ALSO
53
54L<ssl(3)|ssl(3)>, L<SSL_get_current_cipher(3)|SSL_get_current_cipher(3)>,
55L<SSL_get_ciphers(3)|SSL_get_ciphers(3)>
56
57=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_free.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_free.pod
new file mode 100644
index 0000000000..de69672422
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_free.pod
@@ -0,0 +1,29 @@
1=pod
2
3=head1 NAME
4
5SSL_CTX_free - free an allocated SSL_CTX object
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 void SSL_CTX_free(SSL_CTX *ctx);
12
13=head1 DESCRIPTION
14
15SSL_CTX_free() decrements the reference count of B<ctx>, and removes the
16SSL_CTX object pointed to by B<ctx> and frees up the allocated memory if the
17the reference count has reached 0.
18
19It also calls the free()ing procedures for indirectly affected items, if
20applicable: the session cacahe, the list of ciphers, the list of Client CAs,
21the certificates and keys.
22
23=head1 RETURN VALUES
24
25SSL_CTX_free() does not provide diagnostic information.
26
27L<SSL_CTX_new(3)|SSL_CTX_new(3)>, L<ssl(3)|ssl(3)>
28
29=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_new.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_new.pod
new file mode 100644
index 0000000000..e166c692c3
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_new.pod
@@ -0,0 +1,93 @@
1=pod
2
3=head1 NAME
4
5SSL_CTX_new - create a new SSL_CTX object as framework for TLS/SSL enabled functions
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 SSL_CTX *SSL_CTX_new(SSL_METHOD *method);
12
13=head1 DESCRIPTION
14
15SSL_CTX_new() creates a new B<SSL_CTX> object as framework to establish
16TLS/SSL enabled connections.
17
18=head1 NOTES
19
20The SSL_CTX object uses B<method> as connection method. The methods exist
21in a generic type (for client and server use), a server only type, and a
22client only type. B<method> can be of the following types:
23
24=over 4
25
26=item SSLv2_method(void), SSLv2_server_method(void), SSLv2_client_method(void)
27
28A TLS/SSL connection established with these methods will only understand
29the SSLv2 protocol. A client will send out SSLv2 client hello messages
30and will also indicate that it only understand SSLv2. A server will only
31understand SSLv2 client hello messages.
32
33=item SSLv3_method(void), SSLv3_server_method(void), SSLv3_client_method(void)
34
35A TLS/SSL connection established with these methods will only understand the
36SSLv3 and TLSv1 protocol. A client will send out SSLv3 client hello messages
37and will indicate that it also understands TLSv1. A server will only understand
38SSLv3 and TLSv1 client hello messages. This especially means, that it will
39not understand SSLv2 client hello messages which are widely used for
40compatibility reasons, see SSLv23_*_method().
41
42=item TLSv1_method(void), TLSv1_server_method(void), TLSv1_client_method(void)
43
44A TLS/SSL connection established with these methods will only understand the
45TLSv1 protocol. A client will send out TLSv1 client hello messages
46and will indicate that it only understands TLSv1. A server will only understand
47TLSv1 client hello messages. This especially means, that it will
48not understand SSLv2 client hello messages which are widely used for
49compatibility reasons, see SSLv23_*_method().
50
51=item SSLv23_method(void), SSLv23_server_method(void), SSLv23_client_method(void)
52
53A TLS/SSL connection established with these methods will understand the SSLv2,
54SSLv3, and TLSv1 protocol. A client will send out SSLv2 client hello messages
55and will indicate that it also understands SSLv3 and TLSv1. A server will
56understand SSLv2, SSLv3, and TLSv1 client hello messages. This is the best
57choice when compatibility is a concern.
58
59=back
60
61The list of protocols available can later be limited using the SSL_OP_NO_SSLv2,
62SSL_OP_NO_SSLv3, SSL_OP_NO_TLSv1 options of the B<SSL_CTX_set_options()> or
63B<SSL_set_options()> functions. Using these options it is possible to choose
64e.g. SSLv23_server_method() and be able to negotiate with all possible
65clients, but to only allow newer protocols like SSLv3 or TLSv1.
66
67SSL_CTX_new() initializes the list of ciphers, the session cache setting,
68the callbacks, the keys and certificates, and the options to its default
69values.
70
71=head1 RETURN VALUES
72
73The following return values can occur:
74
75=over 4
76
77=item NULL
78
79The creation of a new SSL_CTX object failed. Check the error stack to
80find out the reason.
81
82=item Pointer to an SSL_CTX object
83
84The return value points to an allocated SSL_CTX object.
85
86=back
87
88=head1 SEE ALSO
89
90L<SSL_CTX_free(3)|SSL_CTX_free(3)>, L<SSL_accept(3)|SSL_accept(3)>,
91L<ssl(3)|ssl(3)>
92
93=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_cipher_list.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_cipher_list.pod
new file mode 100644
index 0000000000..272d6b3de2
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_cipher_list.pod
@@ -0,0 +1,52 @@
1=pod
2
3=head1 NAME
4
5SSL_CTX_set_cipher_list, SSL_set_cipher_list
6- choose list of available SSL_CIPHERs
7
8=head1 SYNOPSIS
9
10 #include <openssl/ssl.h>
11
12 int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str);
13 int SSL_set_cipher_list(SSL *ssl, const char *str);
14
15=head1 DESCRIPTION
16
17SSL_CTX_set_cipher_list() sets the list of available ciphers for B<ctx>
18using the control string B<str>. The format of the string is described
19in L<ciphers(1)|ciphers(1)>. The list of ciphers is inherited by all
20B<ssl> objects created from B<ctx>.
21
22SSL_set_cipher_list() sets the list of ciphers only for B<ssl>.
23
24=head1 NOTES
25
26The control string B<str> should be universally usable and not depend
27on details of the library configuration (ciphers compiled in). Thus no
28syntax checking takes place. Items that are not recognized, because the
29corresponding ciphers are not compiled in or because they are mistyped,
30are simply ignored. Failure is only flagged if no ciphers could be collected
31at all.
32
33It should be noted, that inclusion of a cipher to be used into the list is
34a necessary condition. On the client side, the inclusion into the list is
35also sufficient. On the server side, additional restrictions apply. All ciphers
36have additional requirements. ADH ciphers don't need a certificate, but
37DH-parameters must have been set. All other ciphers need a corresponding
38certificate and key. A RSA cipher can only be chosen, when a RSA certificate is
39available, the respective is valid for DSA ciphers. Ciphers using EDH need
40a certificate and key and DH-parameters.
41
42=head1 RETURN VALUES
43
44SSL_CTX_set_cipher_list() and SSL_set_cipher_list() return 1 if any cipher
45could be selected and 0 on complete failure.
46
47=head1 SEE ALSO
48
49L<ssl(3)|ssl(3)>, L<SSL_get_ciphers(3)|SSL_get_ciphers(3)>,
50L<ciphers(1)|ciphers(1)>
51
52=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
new file mode 100644
index 0000000000..3091bd6895
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_ssl_version.pod
@@ -0,0 +1,60 @@
1=pod
2
3=head1 NAME
4
5SSL_CTX_set_ssl_version, SSL_set_ssl_method, SSL_get_ssl_method
6- choose a new TLS/SSL method
7
8=head1 SYNOPSIS
9
10 #include <openssl/ssl.h>
11
12 int SSL_CTX_set_ssl_version(SSL_CTX *ctx, SSL_METHOD *method);
13 int SSL_set_ssl_method(SSL *s, SSL_METHOD *method);
14 SSL_METHOD *SSL_get_ssl_method(SSL *ssl);
15
16=head1 DESCRIPTION
17
18SSL_CTX_set_ssl_version() sets a new default TLS/SSL B<method> for SSL objects
19newly created from this B<ctx>. SSL objects already created with
20L<SSL_new(3)|SSL_new(3)> are not affected, except when SSL_clear() is
21being called.
22
23SSL_set_ssl_method() sets a new TLS/SSL B<method> for a particular B<ssl>
24object. It may be reset, when SSL_clear() is called.
25
26SSL_get_ssl_method() returns a function pointer to the TLS/SSL method
27set in B<ssl>.
28
29=head1 NOTES
30
31The available B<method> choices are described in
32L<SSL_CTX_new(3)|SSL_CTX_new(3)>.
33
34When SSL_clear() is called and no session is connected to an SSL object,
35the method of the SSL object is reset to the method currently set in
36the corresponding SSL_CTX object.
37
38=head1 RETURN VALUES
39
40The following return values can occur for SSL_CTX_set_ssl_version()
41and SSL_set_ssl_method():
42
43=over 4
44
45=item 0
46
47The new choice failed, check the error stack to find out the reason.
48
49=item 1
50
51The operation succeeded.
52
53=back
54
55=head1 SEE ALSO
56
57L<SSL_CTX_new(3)|SSL_CTX_new(3)>, L<SSL_new(3)|SSL_new(3)>,
58L<SSL_clear(3)|SSL_clear(3)>, L<ssl(3)|ssl(3)>
59
60=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_SESSION_free.pod b/src/lib/libssl/src/doc/ssl/SSL_SESSION_free.pod
new file mode 100644
index 0000000000..df30ccbb32
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_SESSION_free.pod
@@ -0,0 +1,25 @@
1=pod
2
3=head1 NAME
4
5SSL_SESSION_free - free an allocated SSL_SESSION structure
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 void SSL_SESSION_free(SSL_SESSION *session);
12
13=head1 DESCRIPTION
14
15SSL_SESSION_free() decrements the reference count of B<session> and removes
16the B<SSL_SESSION> structure pointed to by B<session> and frees up the allocated
17memory, if the the reference count has reached 0.
18
19=head1 RETURN VALUES
20
21SSL_SESSION_free() does not provide diagnostic information.
22
23L<ssl(3)|ssl(3)>, L<SSL_get_session(3)|SSL_get_session(3)>
24
25=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_accept.pod b/src/lib/libssl/src/doc/ssl/SSL_accept.pod
new file mode 100644
index 0000000000..0c79ac515e
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_accept.pod
@@ -0,0 +1,72 @@
1=pod
2
3=head1 NAME
4
5SSL_accept - wait for a TLS/SSL client to initiate a TLS/SSL handshake
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 int SSL_accept(SSL *ssl);
12
13=head1 DESCRIPTION
14
15SSL_accept() waits for a TLS/SSL client to initiate the TLS/SSL handshake.
16The communication channel must already have been set and assigned to the
17B<ssl> by setting an underlying B<BIO>.
18
19=head1 NOTES
20
21The behaviour of SSL_accept() depends on the underlying BIO.
22
23If the underlying BIO is B<blocking>, SSL_accept() will only return once the
24handshake has been finished or an error occurred, except for SGC (Server
25Gated Cryptography). For SGC, SSL_accept() may return with -1, but
26SSL_get_error() will yield B<SSL_ERROR_WANT_READ/WRITE> and SSL_accept()
27should be called again.
28
29If the underlying BIO is B<non-blocking>, SSL_accept() will also return
30when the underlying BIO could not satisfy the needs of SSL_accept()
31to continue the handshake. In this case a call to SSL_get_error() with the
32return value of SSL_accept() will yield B<SSL_ERROR_WANT_READ> or
33B<SSL_ERROR_WANT_WRITE>. The calling process then must repeat the call after
34taking appropriate action to satisfy the needs of SSL_accept().
35The action depends on the underlying BIO. When using a non-blocking socket,
36nothing is to be done, but select() can be used to check for the required
37condition. When using a buffering BIO, like a BIO pair, data must be written
38into or retrieved out of the BIO before being able to continue.
39
40=head1 RETURN VALUES
41
42The following return values can occur:
43
44=over 4
45
46=item 1
47
48The TLS/SSL handshake was successfully completed, a TLS/SSL connection has been
49established.
50
51=item 0
52
53The TLS/SSL handshake was not successful but was shut down controlled and
54by the specifications of the TLS/SSL protocol. Call SSL_get_error() with the
55return value B<ret> to find out the reason.
56
57=item -1
58
59The TLS/SSL handshake was not successful because a fatal error occurred either
60at the protocol level or a connection failure occurred. The shutdown was
61not clean. It can also occur of action is need to continue the operation
62for non-blocking BIOs. Call SSL_get_error() with the return value B<ret>
63to find out the reason.
64
65=back
66
67=head1 SEE ALSO
68
69L<SSL_get_error(3)|SSL_get_error(3)>, L<SSL_connect(3)|SSL_connect(3)>,
70L<SSL_shutdown(3)|SSL_shutdown(3)>, L<ssl(3)|ssl(3)>, L<bio(3)|bio(3)>
71
72=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_clear.pod b/src/lib/libssl/src/doc/ssl/SSL_clear.pod
new file mode 100644
index 0000000000..862fd8291d
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_clear.pod
@@ -0,0 +1,39 @@
1=pod
2
3=head1 NAME
4
5SSL_clear - reset SSL object to allow another connection
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 int SSL_clear(SSL *ssl);
12
13=head1 DESCRIPTION
14
15Reset B<ssl> to allow another connection. All settings (method, ciphers,
16BIOs) are kept. A completely negotiated B<SSL_SESSION> is not freed but left
17untouched for the underlying B<SSL_CTX>.
18
19=head1 RETURN VALUES
20
21The following return values can occur:
22
23=over 4
24
25=item 0
26
27The SSL_clear() operation could not be performed. Check the error stack to
28find out the reason.
29
30=item 1
31
32The SSL_clear() operation was successful.
33
34=back
35
36L<SSL_new(3)|SSL_new(3)>, L<SSL_free(3)|SSL_free(3)>,
37L<ssl(3)|ssl(3)>
38
39=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_connect.pod b/src/lib/libssl/src/doc/ssl/SSL_connect.pod
new file mode 100644
index 0000000000..debe41744f
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_connect.pod
@@ -0,0 +1,69 @@
1=pod
2
3=head1 NAME
4
5SSL_connect - initiate the TLS/SSL handshake with an TLS/SSL server
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 int SSL_connect(SSL *ssl);
12
13=head1 DESCRIPTION
14
15SSL_connect() initiates the TLS/SSL handshake with a server. The communication
16channel must already have been set and assigned to the B<ssl> by setting an
17underlying B<BIO>.
18
19=head1 NOTES
20
21The behaviour of SSL_connect() depends on the underlying BIO.
22
23If the underlying BIO is B<blocking>, SSL_connect() will only return once the
24handshake has been finished or an error occurred.
25
26If the underlying BIO is B<non-blocking>, SSL_connect() will also return
27when the underlying BIO could not satisfy the needs of SSL_connect()
28to continue the handshake. In this case a call to SSL_get_error() with the
29return value of SSL_connect() will yield B<SSL_ERROR_WANT_READ> or
30B<SSL_ERROR_WANT_WRITE>. The calling process then must repeat the call after
31taking appropriate action to satisfy the needs of SSL_connect().
32The action depends on the underlying BIO. When using a non-blocking socket,
33nothing is to be done, but select() can be used to check for the required
34condition. When using a buffering BIO, like a BIO pair, data must be written
35into or retrieved out of the BIO before being able to continue.
36
37=head1 RETURN VALUES
38
39The following return values can occur:
40
41=over 4
42
43=item 1
44
45The TLS/SSL handshake was successfully completed, a TLS/SSL connection has been
46established.
47
48=item 0
49
50The TLS/SSL handshake was not successful but was shut down controlled and
51by the specifications of the TLS/SSL protocol. Call SSL_get_error() with the
52return value B<ret> to find out the reason.
53
54=item -1
55
56The TLS/SSL handshake was not successful, because a fatal error occurred either
57at the protocol level or a connection failure occurred. The shutdown was
58not clean. It can also occur of action is need to continue the operation
59for non-blocking BIOs. Call SSL_get_error() with the return value B<ret>
60to find out the reason.
61
62=back
63
64=head1 SEE ALSO
65
66L<SSL_get_error(3)|SSL_get_error(3)>, L<SSL_accept(3)|SSL_accept(3)>,
67L<SSL_shutdown(3)|SSL_shutdown(3)>, L<ssl(3)|ssl(3)> , L<bio(3)|bio(3)>
68
69=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_free.pod b/src/lib/libssl/src/doc/ssl/SSL_free.pod
new file mode 100644
index 0000000000..f3f0c345f8
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_free.pod
@@ -0,0 +1,33 @@
1=pod
2
3=head1 NAME
4
5SSL_free - free an allocated SSL structure
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 void SSL_free(SSL *ssl);
12
13=head1 DESCRIPTION
14
15SSL_free() decrements the reference count of B<ssl>, and removes the SSL
16structure pointed to by B<ssl> and frees up the allocated memory if the
17the reference count has reached 0.
18
19It also calls the free()ing procedures for indirectly affected items, if
20applicable: the buffering BIO, the read and write BIOs,
21cipher lists specially created for this B<ssl>, the B<SSL_SESSION>.
22Do not explicitly free these indirectly freed up items before or after
23calling SSL_free(), as trying to free things twice may lead to program
24failure.
25
26=head1 RETURN VALUES
27
28SSL_free() does not provide diagnostic information.
29
30L<SSL_new(3)|SSL_new(3)>, L<SSL_clear(3)|SSL_clear(3)>,
31L<ssl(3)|ssl(3)>
32
33=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_get_ciphers.pod b/src/lib/libssl/src/doc/ssl/SSL_get_ciphers.pod
new file mode 100644
index 0000000000..2a57455c23
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_get_ciphers.pod
@@ -0,0 +1,42 @@
1=pod
2
3=head1 NAME
4
5SSL_get_ciphers, SSL_get_cipher_list - get list of available SSL_CIPHERs
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 STACK_OF(SSL_CIPHER) *SSL_get_ciphers(SSL *ssl);
12 const char *SSL_get_cipher_list(SSL *ssl, int priority);
13
14=head1 DESCRIPTION
15
16SSL_get_ciphers() returns the stack of available SSL_CIPHERs for B<ssl>,
17sorted by preference. If B<ssl> is NULL or no ciphers are available, NULL
18is returned.
19
20SSL_get_cipher_list() returns a pointer to the name of the SSL_CIPHER
21listed for B<ssl> with B<priority>. If B<ssl> is NULL, no ciphers are
22available, or there are less ciphers than B<priority> available, NULL
23is returned.
24
25=head1 NOTES
26
27The details of the ciphers obtained by SSL_get_ciphers() can be obtained using
28the L<SSL_CIPHER_get_name(3)|SSL_CIPHER_get_name(3)> family of functions.
29
30Call SSL_get_cipher_list() with B<priority> starting from 0 to obtain the
31sorted list of available ciphers, until NULL is returned.
32
33=head1 RETURN VALUES
34
35See DESCRIPTION
36
37=head1 SEE ALSO
38
39L<ssl(3)|ssl(3)>, L<SSL_CTX_set_cipher_list(3)|SSL_CTX_set_cipher_list(3)>,
40L<SSL_CIPHER_get_name(3)|SSL_CIPHER_get_name(3)>
41
42=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_get_current_cipher.pod b/src/lib/libssl/src/doc/ssl/SSL_get_current_cipher.pod
new file mode 100644
index 0000000000..2dd7261d89
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_get_current_cipher.pod
@@ -0,0 +1,43 @@
1=pod
2
3=head1 NAME
4
5SSL_get_current_cipher, SSL_get_cipher, SSL_get_cipher_name,
6SSL_get_cipher_bits, SSL_get_cipher_version - get SSL_CIPHER of a connection
7
8=head1 SYNOPSIS
9
10 #include <openssl/ssl.h>
11
12 SSL_CIPHER *SSL_get_current_cipher(SSL *ssl);
13 #define SSL_get_cipher(s) \
14 SSL_CIPHER_get_name(SSL_get_current_cipher(s))
15 #define SSL_get_cipher_name(s) \
16 SSL_CIPHER_get_name(SSL_get_current_cipher(s))
17 #define SSL_get_cipher_bits(s,np) \
18 SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np)
19 #define SSL_get_cipher_version(s) \
20 SSL_CIPHER_get_version(SSL_get_current_cipher(s))
21
22=head1 DESCRIPTION
23
24SSL_get_current_cipher() returns a pointer to an SSL_CIPHER object containing
25the description of the actually used cipher of a connection established with
26the B<ssl> object.
27
28SSL_get_cipher() and SSL_get_cipher_name() are identical macros to obtain the
29name of the currently used cipher. SSL_get_cipher_bits() is a
30macro to obtain the number of secret/algorithm bits used and
31SSL_get_cipher_version() returns the protocol name.
32See L<SSL_CIPHER_get_name(3)|SSL_CIPHER_get_name(3)> for more details.
33
34=head1 RETURN VALUES
35
36SSL_get_current_cipher() returns the cipher actually used or NULL, when
37no session has been established.
38
39=head1 SEE ALSO
40
41L<ssl(3)|ssl(3)>, L<SSL_CIPHER_get_name(3)|SSL_CIPHER_get_name(3)>
42
43=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_get_error.pod b/src/lib/libssl/src/doc/ssl/SSL_get_error.pod
index 9cacdedc57..d85b564258 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_get_error.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_get_error.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5SSL_get_error - obtain result code for SSL I/O operation 5SSL_get_error - obtain result code for TLS/SSL I/O operation
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
@@ -15,14 +15,14 @@ SSL_get_error - obtain result code for SSL I/O operation
15SSL_get_error() returns a result code (suitable for the C "switch" 15SSL_get_error() returns a result code (suitable for the C "switch"
16statement) for a preceding call to SSL_connect(), SSL_accept(), 16statement) for a preceding call to SSL_connect(), SSL_accept(),
17SSL_read(), or SSL_write() on B<ssl>. The value returned by that 17SSL_read(), or SSL_write() on B<ssl>. The value returned by that
18SSL I/O function must be passed to SSL_get_error() in parameter 18TLS/SSL I/O function must be passed to SSL_get_error() in parameter
19B<ret>. 19B<ret>.
20 20
21In addition to B<ssl> and B<ret>, SSL_get_error() inspects the 21In addition to B<ssl> and B<ret>, SSL_get_error() inspects the
22current thread's OpenSSL error queue. Thus, SSL_get_error() must be 22current thread's OpenSSL error queue. Thus, SSL_get_error() must be
23used in the same thread that performed the SSL I/O operation, and no 23used in the same thread that performed the TLS/SSL I/O operation, and no
24other OpenSSL function calls should appear in between. The current 24other OpenSSL function calls should appear in between. The current
25thread's error queue must be empty before the SSL I/O operation is 25thread's error queue must be empty before the TLS/SSL I/O operation is
26attempted, or SSL_get_error() will not work reliably. 26attempted, or SSL_get_error() will not work reliably.
27 27
28=head1 RETURN VALUES 28=head1 RETURN VALUES
@@ -33,27 +33,29 @@ The following return values can currently occur:
33 33
34=item SSL_ERROR_NONE 34=item SSL_ERROR_NONE
35 35
36The SSL I/O operation completed. This result code is returned 36The TLS/SSL I/O operation completed. This result code is returned
37if and only if B<ret E<gt> 0>. 37if and only if B<ret E<gt> 0>.
38 38
39=item SSL_ERROR_ZERO_RETURN 39=item SSL_ERROR_ZERO_RETURN
40 40
41The SSL connection has been closed. If the protocol version is SSL 3.0 41The TLS/SSL connection has been closed. If the protocol version is SSL 3.0
42or TLS 1.0, this result code is returned only if a closure 42or TLS 1.0, this result code is returned only if a closure
43alerts has occurred in the protocol, i.e. if the connection has been 43alert has occurred in the protocol, i.e. if the connection has been
44closed cleanly. 44closed cleanly. Note that in this case B<SSL_ERROR_ZERO_RETURN>
45does not necessarily indicate that the underlying transport
46has been closed.
45 47
46=item SSL_ERROR_WANT_READ, SSL_ERROR_WANT_WRITE 48=item SSL_ERROR_WANT_READ, SSL_ERROR_WANT_WRITE
47 49
48The operation did not complete; the same SSL I/O function should be 50The operation did not complete; the same TLS/SSL I/O function should be
49called again later. There will be protocol progress if, by then, the 51called again later. There will be protocol progress if, by then, the
50underlying B<BIO> has data available for reading (if the result code is 52underlying B<BIO> has data available for reading (if the result code is
51B<SSL_ERROR_WANT_READ>) or allows writing data (B<SSL_ERROR_WANT_WRITE>). 53B<SSL_ERROR_WANT_READ>) or allows writing data (B<SSL_ERROR_WANT_WRITE>).
52For socket B<BIO>s (e.g. when SSL_set_fd() was used) this means that 54For socket B<BIO>s (e.g. when SSL_set_fd() was used) this means that
53select() or poll() on the underlying socket can be used to find out 55select() or poll() on the underlying socket can be used to find out
54when the SSL I/O function should be retried. 56when the TLS/SSL I/O function should be retried.
55 57
56Caveat: Any SSL I/O function can lead to either of 58Caveat: Any TLS/SSL I/O function can lead to either of
57B<SSL_ERROR_WANT_READ> and B<SSL_ERROR_WANT_WRITE>, i.e. SSL_read() 59B<SSL_ERROR_WANT_READ> and B<SSL_ERROR_WANT_WRITE>, i.e. SSL_read()
58may want to write data and SSL_write() may want to read data. 60may want to write data and SSL_write() may want to read data.
59 61
@@ -61,7 +63,7 @@ may want to write data and SSL_write() may want to read data.
61 63
62The operation did not complete because an application callback set by 64The operation did not complete because an application callback set by
63SSL_CTX_set_client_cert_cb() has asked to be called again. 65SSL_CTX_set_client_cert_cb() has asked to be called again.
64The SSL I/O function should be called again later. 66The TLS/SSL I/O function should be called again later.
65Details depend on the application. 67Details depend on the application.
66 68
67=item SSL_ERROR_SYSCALL 69=item SSL_ERROR_SYSCALL
diff --git a/src/lib/libssl/src/doc/ssl/SSL_get_fd.pod b/src/lib/libssl/src/doc/ssl/SSL_get_fd.pod
new file mode 100644
index 0000000000..a3f7625931
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_get_fd.pod
@@ -0,0 +1,44 @@
1=pod
2
3=head1 NAME
4
5SSL_get_fd - get file descriptor linked to an SSL object
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 int SSL_get_fd(SSL *ssl);
12 int SSL_get_rfd(SSL *ssl);
13 int SSL_get_wfd(SSL *ssl);
14
15=head1 DESCRIPTION
16
17SSL_get_fd() returns the file descriptor which is linked to B<ssl>.
18SSL_get_rfd() and SSL_get_wfd() return the file descriptors for the
19read or the write channel, which can be different. If the read and the
20write channel are different, SSL_get_fd() will return the file descriptor
21of the read channel.
22
23=head1 RETURN VALUES
24
25The following return values can occur:
26
27=over 4
28
29=item -1
30
31The operation failed, because the underlying BIO is not of the correct type
32(suitable for file descriptors).
33
34=item E<gt>=0
35
36The file descriptor linked to B<ssl>.
37
38=back
39
40=head1 SEE ALSO
41
42L<SSL_set_fd(3)|SSL_set_fd(3)>, L<ssl(3)|ssl(3)> , L<bio(3)|bio(3)>
43
44=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_get_peer_cert_chain.pod b/src/lib/libssl/src/doc/ssl/SSL_get_peer_cert_chain.pod
new file mode 100644
index 0000000000..e93e8206fa
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_get_peer_cert_chain.pod
@@ -0,0 +1,52 @@
1=pod
2
3=head1 NAME
4
5SSL_get_peer_cert_chain - get the X509 certificate chain of the peer
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 STACKOF(X509) *SSL_get_peer_cert_chain(SSL *ssl);
12
13=head1 DESCRIPTION
14
15SSL_get_peer_cert_chain() returns a pointer to STACKOF(X509) certificates
16forming the certificate chain of the peer. If called on the client side,
17the stack also contains the peer's certificate; if called on the server
18side, the peer's certificate must be obtained seperately using
19L<SSL_get_peer_certificate(3)|SSL_get_peer_certificate(3)>.
20If the peer did not present a certificate, NULL is returned.
21
22=head1 NOTES
23
24The peer certificate chain is not necessarily available after reusing
25a session, in which case a NULL pointer is returned.
26
27The reference count of the STACKOF(X509) object is not incremented.
28If the corresponding session is freed, the pointer must not be used
29any longer.
30
31=head1 RETURN VALUES
32
33The following return values can occur:
34
35=over 4
36
37=item NULL
38
39No certificate was presented by the peer or no connection was established
40or the certificate chain is no longer available when a session is reused.
41
42=item Pointer to a STACKOF(X509)
43
44The return value points to the certificate chain presented by the peer.
45
46=back
47
48=head1 SEE ALSO
49
50L<ssl(3)|ssl(3)>, L<SSL_get_peer_certificate(3)|SSL_get_peer_certificate(3)>
51
52=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_get_peer_certificate.pod b/src/lib/libssl/src/doc/ssl/SSL_get_peer_certificate.pod
new file mode 100644
index 0000000000..79c089aa51
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_get_peer_certificate.pod
@@ -0,0 +1,48 @@
1=pod
2
3=head1 NAME
4
5SSL_get_peer_certificate - get the X509 certificate of the peer
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 X509 *SSL_get_peer_certificate(SSL *ssl);
12
13=head1 DESCRIPTION
14
15SSL_get_peer_certificate() returns a pointer to the X509 certificate the
16peer presented. If the peer did not present a certificate, NULL is returned.
17
18=head1 NOTES
19
20That a certificate is returned does not indicate information about the
21verification state, use L<SSL_get_verify_result(3)|SSL_get_verify_result(3)>
22to check the verification state.
23
24The reference count of the X509 object is incremented by one, so that it
25will not be destroyed when the session containing the peer certificate is
26freed. The X509 object must be explicitely freed using X509_free().
27
28=head1 RETURN VALUES
29
30The following return values can occur:
31
32=over 4
33
34=item NULL
35
36No certificate was presented by the peer or no connection was established.
37
38=item Pointer to an X509 certificate
39
40The return value points to the certificate presented by the peer.
41
42=back
43
44=head1 SEE ALSO
45
46L<ssl(3)|ssl(3)>, L<SSL_get_verify_result(3)|SSL_get_verify_result(3)>
47
48=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_get_rbio.pod b/src/lib/libssl/src/doc/ssl/SSL_get_rbio.pod
new file mode 100644
index 0000000000..3d98233cac
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_get_rbio.pod
@@ -0,0 +1,40 @@
1=pod
2
3=head1 NAME
4
5SSL_get_rbio - get BIO linked to an SSL object
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 BIO *SSL_get_rbio(SSL *ssl);
12 BIO *SSL_get_wbio(SSL *ssl);
13
14=head1 DESCRIPTION
15
16SSL_get_rbio() and SSL_get_wbio() return pointers to the BIOs for the
17read or the write channel, which can be different. The reference count
18of the BIO is not incremented.
19
20=head1 RETURN VALUES
21
22The following return values can occur:
23
24=over 4
25
26=item NULL
27
28No BIO was connected to the SSL object
29
30=item Any other pointer
31
32The BIO linked to B<ssl>.
33
34=back
35
36=head1 SEE ALSO
37
38L<SSL_set_bio(3)|SSL_set_bio(3)>, L<ssl(3)|ssl(3)> , L<bio(3)|bio(3)>
39
40=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_get_session.pod b/src/lib/libssl/src/doc/ssl/SSL_get_session.pod
new file mode 100644
index 0000000000..aff41fb9cf
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_get_session.pod
@@ -0,0 +1,48 @@
1=pod
2
3=head1 NAME
4
5SSL_get_session - retrieve TLS/SSL session data
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 SSL_SESSION *SSL_get_session(SSL *ssl);
12 SSL_SESSION *SSL_get0_session(SSL *ssl);
13 SSL_SESSION *SSL_get1_session(SSL *ssl);
14
15=head1 DESCRIPTION
16
17SSL_get_session() returns a pointer to the B<SSL_SESSION> actually used in
18B<ssl>. The reference count of the B<SSL_SESSION> is not incremented, so
19that the pointer can become invalid when the B<ssl> is freed and
20SSL_SESSION_free() is implicitly called.
21
22SSL_get0_session() is the same as SSL_get_session().
23
24SSL_get1_session() is the same as SSL_get_session(), but the reference
25count of the B<SSL_SESSION> is incremented by one.
26
27=head1 RETURN VALUES
28
29The following return values can occur:
30
31=over 4
32
33=item NULL
34
35There is no session available in B<ssl>.
36
37=item Pointer to an SSL
38
39The return value points to the data of an SSL session.
40
41=back
42
43=head1 SEE ALSO
44
45L<ssl(3)|ssl(3)>, L<SSL_free(3)|SSL_free(3)>,
46L<SSL_SESSION_free(3)|SSL_SESSION_free(3)>
47
48=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_get_verify_result.pod b/src/lib/libssl/src/doc/ssl/SSL_get_verify_result.pod
new file mode 100644
index 0000000000..4d66236a05
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_get_verify_result.pod
@@ -0,0 +1,57 @@
1=pod
2
3=head1 NAME
4
5SSL_get_verify_result - get result of peer certificate verification
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 long SSL_get_verify_result(SSL *ssl);
12
13=head1 DESCRIPTION
14
15SSL_get_verify_result() returns the result of the verification of the
16X509 certificate presented by the peer, if any.
17
18=head1 NOTES
19
20SSL_get_verify_result() can only return one error code while the verification
21of a certificate can fail because of many reasons at the same time. Only
22the last verification error that occured during the processing is available
23from SSL_get_verify_result().
24
25The verification result is part of the established session and is restored
26when a session is reused.
27
28=head1 BUGS
29
30If no peer certificate was presented, the returned result code is
31X509_V_OK. This is because no verification error occured, it does however
32not indicate success. SSL_get_verify_result() is only useful in connection
33with L<SSL_get_peer_certificate(3)|SSL_get_peer_certificate(3)>.
34
35=head1 RETURN VALUES
36
37The following return values can currently occur:
38
39=over 4
40
41=item X509_V_OK
42
43The verification succeeded or no peer certificate was presented.
44
45=item Any other value
46
47Documented in L<verify(1)|verify(1)>.
48
49=back
50
51=head1 SEE ALSO
52
53L<ssl(3)|ssl(3)>, L<SSL_set_verify_result(3)|SSL_set_verify_result(3)>,
54L<SSL_get_peer_certificate(3)|SSL_get_peer_certificate(3)>,
55L<verify(1)|verify(1)>
56
57=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_library_init.pod b/src/lib/libssl/src/doc/ssl/SSL_library_init.pod
new file mode 100644
index 0000000000..ecf3c4858e
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_library_init.pod
@@ -0,0 +1,52 @@
1=pod
2
3=head1 NAME
4
5SSL_library_init, OpenSSL_add_ssl_algorithms, SSLeay_add_ssl_algorithms
6- initialize SSL library by registering algorithms
7
8=head1 SYNOPSIS
9
10 #include <openssl/ssl.h>
11
12 int SSL_library_init(void);
13 #define OpenSSL_add_ssl_algorithms() SSL_library_init()
14 #define SSLeay_add_ssl_algorithms() SSL_library_init()
15
16=head1 DESCRIPTION
17
18SSL_library_init() registers the available ciphers and digests.
19
20OpenSSL_add_ssl_algorithms() and SSLeay_add_ssl_algorithms() are synonyms
21for SSL_library_init().
22
23=head1 NOTES
24
25SSL_library_init() must be called before any other action takes place.
26
27=head1 WARNING
28
29SSL_library_init() only registers ciphers. Another important initialization
30is the seeding of the PRNG (Pseudo Random Number Generator), which has to
31be performed separately.
32
33=head1 EXAMPLES
34
35A typical TLS/SSL application will start with the library initialization,
36will provide readable error messages and will seed the PRNG.
37
38 SSL_load_error_strings(); /* readable error messages */
39 SSL_library_init(); /* initialize library */
40 actions_to_seed_PRNG();
41
42=head1 RETURN VALUES
43
44SSL_library_init() always returns "1", so it is safe to discard the return
45value.
46
47=head1 SEE ALSO
48
49L<ssl(3)|ssl(3)>, L<SSL_load_error_strings(3)|SSL_load_error_strings(3)>,
50L<RAND_add(3)|RAND_add(3)>
51
52=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_new.pod b/src/lib/libssl/src/doc/ssl/SSL_new.pod
new file mode 100644
index 0000000000..8e8638fa95
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_new.pod
@@ -0,0 +1,42 @@
1=pod
2
3=head1 NAME
4
5SSL_new - create a new SSL structure for a connection
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 SSL *SSL_new(SSL_CTX *ctx);
12
13=head1 DESCRIPTION
14
15SSL_new() creates a new B<SSL> structure which is needed to hold the
16data for a TLS/SSL connection. The new structure inherits the settings
17of the underlying context B<ctx>: connection method (SSLv2/v3/TLSv1),
18options, verification settings, timeout settings.
19
20=head1 RETURN VALUES
21
22The following return values can occur:
23
24=over 4
25
26=item NULL
27
28The creation of a new SSL structure failed. Check the error stack to
29find out the reason.
30
31=item Pointer to an SSL structure
32
33The return value points to an allocated SSL structure.
34
35=back
36
37=head1 SEE ALSO
38
39L<SSL_free(3)|SSL_free(3)>, L<SSL_clear(3)|SSL_clear(3)>,
40L<ssl(3)|ssl(3)>
41
42=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_pending.pod b/src/lib/libssl/src/doc/ssl/SSL_pending.pod
new file mode 100644
index 0000000000..744e1855e1
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_pending.pod
@@ -0,0 +1,30 @@
1=pod
2
3=head1 NAME
4
5SSL_pending - obtain number of readable bytes buffered in an SSL object
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 int SSL_pending(SSL *ssl);
12
13=head1 DESCRIPTION
14
15SSL_pending() returns the number of bytes which are available inside
16B<ssl> for immediate read.
17
18=head1 NOTES
19
20Data are received in blocks from the peer. Therefore data can be buffered
21inside B<ssl> and are ready for immediate retrieval with
22L<SSL_read(3)|SSL_read(3)>.
23
24=head1 RETURN VALUES
25
26The number of bytes pending is returned.
27
28L<SSL_read(3)|SSL_read(3)>, L<ssl(3)|ssl(3)>
29
30=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_read.pod b/src/lib/libssl/src/doc/ssl/SSL_read.pod
new file mode 100644
index 0000000000..072dc26cf2
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_read.pod
@@ -0,0 +1,77 @@
1=pod
2
3=head1 NAME
4
5SSL_read - read bytes from a TLS/SSL connection.
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 int SSL_read(SSL *ssl, char *buf, int num);
12
13=head1 DESCRIPTION
14
15SSL_read() tries to read B<num> bytes from the specified B<ssl> into the
16buffer B<buf>.
17
18=head1 NOTES
19
20If necessary, SSL_read() will negotiate a TLS/SSL session, if
21not already explicitly performed by SSL_connect() or SSL_accept(). If the
22peer requests a re-negotiation, it will be performed transparently during
23the SSL_read() operation. The behaviour of SSL_read() depends on the
24underlying BIO.
25
26If the underlying BIO is B<blocking>, SSL_read() will only return, once the
27read operation has been finished or an error occurred.
28
29If the underlying BIO is B<non-blocking>, SSL_read() will also return
30when the underlying BIO could not satisfy the needs of SSL_read()
31to continue the operation. In this case a call to SSL_get_error() with the
32return value of SSL_read() will yield B<SSL_ERROR_WANT_READ> or
33B<SSL_ERROR_WANT_WRITE>. As at any time a re-negotiation is possible, a
34call to SSL_read() can also cause write operations! The calling process
35then must repeat the call after taking appropriate action to satisfy the
36needs of SSL_read(). The action depends on the underlying BIO. When using a
37non-blocking socket, nothing is to be done, but select() can be used to check
38for the required condition. When using a buffering BIO, like a BIO pair, data
39must be written into or retrieved out of the BIO before being able to continue.
40
41=head1 WARNING
42
43When an SSL_read() operation has to be repeated because of
44B<SSL_ERROR_WANT_READ> or B<SSL_ERROR_WANT_WRITE>, it must be repeated
45with the same arguments.
46
47=head1 RETURN VALUES
48
49The following return values can occur:
50
51=over 4
52
53=item E<gt>0
54
55The read operation was successful; the return value is the number of
56bytes actually read from the TLS/SSL connection.
57
58=item 0
59
60The read operation was not successful, probably because no data was
61available. Call SSL_get_error() with the return value B<ret> to find out,
62whether an error occurred.
63
64=item -1
65
66The read operation was not successful, because either an error occurred
67or action must be taken by the calling process. Call SSL_get_error() with the
68return value B<ret> to find out the reason.
69
70=back
71
72=head1 SEE ALSO
73
74L<SSL_get_error(3)|SSL_get_error(3)>, L<SSL_write(3)|SSL_write(3)>,
75L<ssl(3)|ssl(3)>, L<bio(3)|bio(3)>
76
77=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_set_bio.pod b/src/lib/libssl/src/doc/ssl/SSL_set_bio.pod
new file mode 100644
index 0000000000..67c9756d3f
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_set_bio.pod
@@ -0,0 +1,34 @@
1=pod
2
3=head1 NAME
4
5SSL_set_bio - connect the SSL object with a BIO
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 void SSL_set_bio(SSL *ssl, BIO *rbio, BIO *wbio);
12
13=head1 DESCRIPTION
14
15SSL_set_bio() connects the BIOs B<rbio> and B<wbio> for the read and write
16operations of the TLS/SSL (encrypted) side of B<ssl>.
17
18The SSL engine inherits the behaviour of B<rbio> and B<wbio>, respectively.
19If a BIO is non-blocking, the B<ssl> will also have non-blocking behaviour.
20
21If there was already a BIO connected to B<ssl>, BIO_free() will be called
22(for both the reading and writing side, if different).
23
24=head1 RETURN VALUES
25
26SSL_set_bio() cannot fail.
27
28=head1 SEE ALSO
29
30L<SSL_get_rbio(3)|SSL_get_rbio(3)>,
31L<SSL_connect(3)|SSL_connect(3)>, L<SSL_accept(3)|SSL_accept(3)>,
32L<SSL_shutdown(3)|SSL_shutdown(3)>, L<ssl(3)|ssl(3)>, L<bio(3)|bio(3)>
33
34=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_set_fd.pod b/src/lib/libssl/src/doc/ssl/SSL_set_fd.pod
new file mode 100644
index 0000000000..70291128fc
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_set_fd.pod
@@ -0,0 +1,54 @@
1=pod
2
3=head1 NAME
4
5SSL_set_fd - connect the SSL object with a file descriptor
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 int SSL_set_fd(SSL *ssl, int fd);
12 int SSL_set_rfd(SSL *ssl, int fd);
13 int SSL_set_wfd(SSL *ssl, int fd);
14
15=head1 DESCRIPTION
16
17SSL_set_fd() sets the file descriptor B<fd> as the input/output facility
18for the TLS/SSL (encrypted) side of B<ssl>. B<fd> will typically be the
19socket file descriptor of a network connection.
20
21When performing the operation, a B<socket BIO> is automatically created to
22interface between the B<ssl> and B<fd>. The BIO and hence the SSL engine
23inherit the behaviour of B<fd>. If B<fd> is non-blocking, the B<ssl> will
24also have non-blocking behaviour.
25
26If there was already a BIO connected to B<ssl>, BIO_free() will be called
27(for both the reading and writing side, if different).
28
29SSL_set_rfd() and SSL_set_wfd() perform the respective action, but only
30for the read channel or the write channel, which can be set independently.
31
32=head1 RETURN VALUES
33
34The following return values can occur:
35
36=over 4
37
38=item 0
39
40The operation failed. Check the error stack to find out why.
41
42=item 1
43
44The operation succeeded.
45
46=back
47
48=head1 SEE ALSO
49
50L<SSL_get_fd(3)|SSL_get_fd(3)>, L<SSL_set_bio(3)|SSL_set_bio(3)>,
51L<SSL_connect(3)|SSL_connect(3)>, L<SSL_accept(3)|SSL_accept(3)>,
52L<SSL_shutdown(3)|SSL_shutdown(3)>, L<ssl(3)|ssl(3)> , L<bio(3)|bio(3)>
53
54=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_set_session.pod b/src/lib/libssl/src/doc/ssl/SSL_set_session.pod
new file mode 100644
index 0000000000..9f78d9e434
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_set_session.pod
@@ -0,0 +1,45 @@
1=pod
2
3=head1 NAME
4
5SSL_set_session - set a TLS/SSL session to be used during TLS/SSL connect
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 int SSL_set_session(SSL *ssl, SSL_SESSION *session);
12
13=head1 DESCRIPTION
14
15SSL_set_session() sets B<session> to be used when the TLS/SSL connection
16is to be established. SSL_set_session() is only useful for TLS/SSL clients.
17When the session is set, the reference count of B<session> is incremented
18by 1. If the session is not reused, the reference count is decremented
19again during SSL_connect().
20
21If there is already a session set inside B<ssl> (because it was set with
22SSL_set_session() before or because the same B<ssl> was already used for
23a connection), SSL_SESSION_free() will be called for that session.
24
25=head1 RETURN VALUES
26
27The following return values can occur:
28
29=over 4
30
31=item 0
32
33The operation failed; check the error stack to find out the reason.
34
35=item 1
36
37The operation succeeded.
38
39=back
40
41=head1 SEE ALSO
42
43L<ssl(3)|ssl(3)>, L<SSL_SESSION_free(3)|SSL_SESSION_free(3)>
44
45=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_set_verify_result.pod b/src/lib/libssl/src/doc/ssl/SSL_set_verify_result.pod
new file mode 100644
index 0000000000..04ab101aad
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_set_verify_result.pod
@@ -0,0 +1,38 @@
1=pod
2
3=head1 NAME
4
5SSL_set_verify_result - override result of peer certificate verification
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 void SSL_set_verify_result(SSL *ssl, long verify_result);
12
13=head1 DESCRIPTION
14
15SSL_set_verify_result() sets B<verify_result> of the object B<ssl> to be the
16result of the verification of the X509 certificate presented by the peer,
17if any.
18
19=head1 NOTES
20
21SSL_set_verify_result() overrides the verification result. It only changes
22the verification result of the B<ssl> object. It does not become part of the
23established session, so if the session is to be reused later, the original
24value will reappear.
25
26The valid codes for B<verify_result> are documented in L<verify(1)|verify(1)>.
27
28=head1 RETURN VALUES
29
30SSL_set_verify_result() does not provide a return value.
31
32=head1 SEE ALSO
33
34L<ssl(3)|ssl(3)>, L<SSL_get_verify_result(3)|SSL_get_verify_result(3)>,
35L<SSL_get_peer_certificate(3)|SSL_get_peer_certificate(3)>,
36L<verify(1)|verify(1)>
37
38=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_shutdown.pod b/src/lib/libssl/src/doc/ssl/SSL_shutdown.pod
new file mode 100644
index 0000000000..20e273bd4d
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_shutdown.pod
@@ -0,0 +1,62 @@
1=pod
2
3=head1 NAME
4
5SSL_shutdown - shut down a TLS/SSL connection
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 int SSL_shutdown(SSL *ssl);
12
13=head1 DESCRIPTION
14
15SSL_shutdown() shuts down an active TLS/SSL connection. It sends the shutdown
16alert to the peer. The behaviour of SSL_shutdown() depends on the underlying
17BIO.
18
19If the underlying BIO is B<blocking>, SSL_shutdown() will only return once the
20handshake has been finished or an error occurred.
21
22If the underlying BIO is B<non-blocking>, SSL_shutdown() will also return
23when the underlying BIO could not satisfy the needs of SSL_shutdown()
24to continue the handshake. In this case a call to SSL_get_error() with the
25return value of SSL_shutdown() will yield B<SSL_ERROR_WANT_READ> or
26B<SSL_ERROR_WANT_WRITE>. The calling process then must repeat the call after
27taking appropriate action to satisfy the needs of SSL_shutdown().
28The action depends on the underlying BIO. When using a non-blocking socket,
29nothing is to be done, but select() can be used to check for the required
30condition. When using a buffering BIO, like a BIO pair, data must be written
31into or retrieved out of the BIO before being able to continue.
32
33=head1 RETURN VALUES
34
35The following return values can occur:
36
37=over 4
38
39=item 1
40
41The shutdown was successfully completed.
42
43=item 0
44
45The shutdown was not successful. Call SSL_get_error() with the return
46value B<ret> to find out the reason.
47
48=item -1
49
50The shutdown was not successful because a fatal error occurred either
51at the protocol level or a connection failure occurred. It can also occur of
52action is need to continue the operation for non-blocking BIOs.
53Call SSL_get_error() with the return value B<ret> to find out the reason.
54
55=back
56
57=head1 SEE ALSO
58
59L<SSL_get_error(3)|SSL_get_error(3)>, L<SSL_connect(3)|SSL_connect(3)>,
60L<SSL_accept(3)|SSL_accept(3)>, L<ssl(3)|ssl(3)>, L<bio(3)|bio(3)>
61
62=cut
diff --git a/src/lib/libssl/src/doc/ssl/SSL_write.pod b/src/lib/libssl/src/doc/ssl/SSL_write.pod
new file mode 100644
index 0000000000..db67c187e0
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssl/SSL_write.pod
@@ -0,0 +1,76 @@
1=pod
2
3=head1 NAME
4
5SSL_read - write bytes to a TLS/SSL connection.
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 int SSL_write(SSL *ssl, char *buf, int num);
12
13=head1 DESCRIPTION
14
15SSL_write() writes B<num> bytes from the buffer B<buf> into the specified
16B<ssl> connection.
17
18=head1 NOTES
19
20If necessary, SSL_write() will negotiate a TLS/SSL session, if
21not already explicitly performed by SSL_connect() or SSL_accept(). If the
22peer requests a re-negotiation, it will be performed transparently during
23the SSL_write() operation. The behaviour of SSL_write() depends on the
24underlying BIO.
25
26If the underlying BIO is B<blocking>, SSL_write() will only return, once the
27write operation has been finished or an error occurred.
28
29If the underlying BIO is B<non-blocking>, SSL_write() will also return,
30when the underlying BIO could not satisfy the needs of SSL_write()
31to continue the operation. In this case a call to SSL_get_error() with the
32return value of SSL_write() will yield B<SSL_ERROR_WANT_READ> or
33B<SSL_ERROR_WANT_WRITE>. As at any time a re-negotiation is possible, a
34call to SSL_write() can also cause write operations! The calling process
35then must repeat the call after taking appropriate action to satisfy the
36needs of SSL_write(). The action depends on the underlying BIO. When using a
37non-blocking socket, nothing is to be done, but select() can be used to check
38for the required condition. When using a buffering BIO, like a BIO pair, data
39must be written into or retrieved out of the BIO before being able to continue.
40
41=head1 WARNING
42
43When an SSL_write() operation has to be repeated because of
44B<SSL_ERROR_WANT_READ> or B<SSL_ERROR_WANT_WRITE>, it must be repeated
45with the same arguments.
46
47=head1 RETURN VALUES
48
49The following return values can occur:
50
51=over 4
52
53=item E<gt>0
54
55The write operation was successful, the return value is the number of
56bytes actually written to the TLS/SSL connection.
57
58=item 0
59
60The write operation was not successful. Call SSL_get_error() with the return
61value B<ret> to find out, whether an error occurred.
62
63=item -1
64
65The read operation was not successful, because either an error occurred
66or action must be taken by the calling process. Call SSL_get_error() with the
67return value B<ret> to find out the reason.
68
69=back
70
71=head1 SEE ALSO
72
73L<SSL_get_error(3)|SSL_get_error(3)>, L<SSL_read(3)|SSL_read(3)>,
74L<ssl(3)|ssl(3)>, L<bio(3)|bio(3)>
75
76=cut
diff --git a/src/lib/libssl/src/doc/ssl/ssl.pod b/src/lib/libssl/src/doc/ssl/ssl.pod
index 9dae13d9eb..7787376f7b 100644
--- a/src/lib/libssl/src/doc/ssl/ssl.pod
+++ b/src/lib/libssl/src/doc/ssl/ssl.pod
@@ -83,7 +83,7 @@ B<SSL> structures which are later created for the connections.
83 83
84=item B<SSL_SESSION> (SSL Session) 84=item B<SSL_SESSION> (SSL Session)
85 85
86This is a structure containing the current SSL session details for a 86This is a structure containing the current TLS/SSL session details for a
87connection: B<SSL_CIPHER>s, client and server certificates, keys, etc. 87connection: B<SSL_CIPHER>s, client and server certificates, keys, etc.
88 88
89=item B<SSL> (SSL Connection) 89=item B<SSL> (SSL Connection)
@@ -163,7 +163,7 @@ Determine the number of bits in I<cipher>. Because of export crippled ciphers
163there are two bits: The bits the algorithm supports in general (stored to 163there are two bits: The bits the algorithm supports in general (stored to
164I<alg_bits>) and the bits which are actually used (the return value). 164I<alg_bits>) and the bits which are actually used (the return value).
165 165
166=item char *B<SSL_CIPHER_get_name>(SSL_CIPHER *cipher); 166=item const char *B<SSL_CIPHER_get_name>(SSL_CIPHER *cipher);
167 167
168Return the internal name of I<cipher> as a string. These are the various 168Return the internal name of I<cipher> as a string. These are the various
169strings defined by the I<SSL2_TXT_xxx>, I<SSL3_TXT_xxx> and I<TLS1_TXT_xxx> 169strings defined by the I<SSL2_TXT_xxx>, I<SSL3_TXT_xxx> and I<TLS1_TXT_xxx>
@@ -437,7 +437,7 @@ connection defined in the B<SSL> structure.
437 437
438=item X509 *B<SSL_get_certificate>(SSL *ssl); 438=item X509 *B<SSL_get_certificate>(SSL *ssl);
439 439
440=item SSL_CIPHER *B<SSL_get_cipher>(SSL *ssl); 440=item const char *B<SSL_get_cipher>(SSL *ssl);
441 441
442=item int B<SSL_get_cipher_bits>(SSL *ssl, int *alg_bits); 442=item int B<SSL_get_cipher_bits>(SSL *ssl, int *alg_bits);
443 443
@@ -624,7 +624,21 @@ connection defined in the B<SSL> structure.
624=head1 SEE ALSO 624=head1 SEE ALSO
625 625
626L<openssl(1)|openssl(1)>, L<crypto(3)|crypto(3)>, 626L<openssl(1)|openssl(1)>, L<crypto(3)|crypto(3)>,
627L<SSL_get_error(3)|SSL_get_error(3)> 627L<SSL_accept(3)|SSL_accept(3)>, L<SSL_clear(3)|SSL_clear(3)>,
628L<SSL_connect(3)|SSL_connect(3)>, L<SSL_CTX_new(3)|SSL_CTX_new(3)>,
629L<SSL_CTX_set_ssl_version(3)|SSL_CTX_set_ssl_version(3)>,
630L<SSL_get_ciphers(3)|SSL_get_ciphers(3)>,
631L<SSL_get_error(3)|SSL_get_error(3)>, L<SSL_get_fd(3)|SSL_get_fd(3)>,
632L<SSL_get_peer_cert_chain(3)|SSL_get_peer_cert_chain(3)>,
633L<SSL_get_rbio(3)|SSL_get_rbio(3)>,
634L<SSL_get_session(3)|SSL_get_session(3)>,
635L<SSL_get_verify_result(3)|SSL_get_verify_result(3)>,
636L<SSL_library_init(3)|SSL_library_init(3)>, L<SSL_new(3)|SSL_new(3)>,
637L<SSL_read(3)|SSL_read(3)>, L<SSL_set_bio(3)|SSL_set_bio(3)>,
638L<SSL_set_fd(3)|SSL_set_fd(3)>, L<SSL_pending(3)|SSL_pending(3)>,
639L<SSL_set_session(3)|SSL_set_session(3)>,
640L<SSL_shutdown(3)|SSL_shutdown(3)>, L<SSL_write(3)|SSL_write(3)>,
641L<SSL_SESSION_free(3)|SSL_SESSION_free(3)>
628 642
629=head1 HISTORY 643=head1 HISTORY
630 644
diff --git a/src/lib/libssl/src/doc/standards.txt b/src/lib/libssl/src/doc/standards.txt
new file mode 100644
index 0000000000..61ccc5d7e0
--- /dev/null
+++ b/src/lib/libssl/src/doc/standards.txt
@@ -0,0 +1,121 @@
1Standards related to OpenSSL
2============================
3
4[Please, this is currently a draft. I made a first try at finding
5 documents that describe parts of what OpenSSL implements. There are
6 big gaps, and I've most certainly done something wrong. Please
7 correct whatever is... Also, this note should be removed when this
8 file is reaching a somewhat correct state. -- Richard Levitte]
9
10
11All pointers in here will be either URL's or blobs of text borrowed
12from miscellaneous indexes, like rfc-index.txt (index of RFCs),
131id-index.txt (index of Internet drafts) and the like.
14
15To find the latest possible RFCs, it's recommended to either browse
16ftp://ftp.isi.edu/in-notes/ or go to http://www.rfc-editor.org/ and
17use the search mechanism found there.
18To find the latest possible Internet drafts, it's recommended to
19browse ftp://ftp.isi.edu/internet-drafts/.
20To find the latest possible PKCS, it's recommended to browse
21http://www.rsasecurity.com/rsalabs/pkcs/.
22
23
24Implemented:
25------------
26
27These are documents that describe things that are implemented in OpenSSL.
28
291319 The MD2 Message-Digest Algorithm. B. Kaliski. April 1992.
30 (Format: TXT=25661 bytes) (Status: INFORMATIONAL)
31
321320 The MD4 Message-Digest Algorithm. R. Rivest. April 1992. (Format:
33 TXT=32407 bytes) (Status: INFORMATIONAL)
34
351321 The MD5 Message-Digest Algorithm. R. Rivest. April 1992. (Format:
36 TXT=35222 bytes) (Status: INFORMATIONAL)
37
382246 The TLS Protocol Version 1.0. T. Dierks, C. Allen. January 1999.
39 (Format: TXT=170401 bytes) (Status: PROPOSED STANDARD)
40
412268 A Description of the RC2(r) Encryption Algorithm. R. Rivest.
42 January 1998. (Format: TXT=19048 bytes) (Status: INFORMATIONAL)
43
442314 PKCS 10: Certification Request Syntax Version 1.5. B. Kaliski.
45 March 1998. (Format: TXT=15814 bytes) (Status: INFORMATIONAL)
46
472315 PKCS 7: Cryptographic Message Syntax Version 1.5. B. Kaliski.
48 March 1998. (Format: TXT=69679 bytes) (Status: INFORMATIONAL)
49
502437 PKCS #1: RSA Cryptography Specifications Version 2.0. B. Kaliski,
51 J. Staddon. October 1998. (Format: TXT=73529 bytes) (Obsoletes
52 RFC2313) (Status: INFORMATIONAL)
53
542459 Internet X.509 Public Key Infrastructure Certificate and CRL
55 Profile. R. Housley, W. Ford, W. Polk, D. Solo. January 1999.
56 (Format: TXT=278438 bytes) (Status: PROPOSED STANDARD)
57
58PKCS#8: Private-Key Information Syntax Standard
59
60PKCS#12: Personal Information Exchange Syntax Standard, version 1.0.
61
62
63Related:
64--------
65
66These are documents that are close to OpenSSL, for example the
67STARTTLS documents.
68
691421 Privacy Enhancement for Internet Electronic Mail: Part I: Message
70 Encryption and Authentication Procedures. J. Linn. February 1993.
71 (Format: TXT=103894 bytes) (Obsoletes RFC1113) (Status: PROPOSED
72 STANDARD)
73
741422 Privacy Enhancement for Internet Electronic Mail: Part II:
75 Certificate-Based Key Management. S. Kent. February 1993. (Format:
76 TXT=86085 bytes) (Obsoletes RFC1114) (Status: PROPOSED STANDARD)
77
781423 Privacy Enhancement for Internet Electronic Mail: Part III:
79 Algorithms, Modes, and Identifiers. D. Balenson. February 1993.
80 (Format: TXT=33277 bytes) (Obsoletes RFC1115) (Status: PROPOSED
81 STANDARD)
82
831424 Privacy Enhancement for Internet Electronic Mail: Part IV: Key
84 Certification and Related Services. B. Kaliski. February 1993.
85 (Format: TXT=17537 bytes) (Status: PROPOSED STANDARD)
86
872487 SMTP Service Extension for Secure SMTP over TLS. P. Hoffman.
88 January 1999. (Format: TXT=15120 bytes) (Status: PROPOSED STANDARD)
89
902585 Internet X.509 Public Key Infrastructure Operational Protocols:
91 FTP and HTTP. R. Housley, P. Hoffman. May 1999. (Format: TXT=14813
92 bytes) (Status: PROPOSED STANDARD)
93
942595 Using TLS with IMAP, POP3 and ACAP. C. Newman. June 1999.
95 (Format: TXT=32440 bytes) (Status: PROPOSED STANDARD)
96
972712 Addition of Kerberos Cipher Suites to Transport Layer Security
98 (TLS). A. Medvinsky, M. Hur. October 1999. (Format: TXT=13763 bytes)
99 (Status: PROPOSED STANDARD)
100
1012817 Upgrading to TLS Within HTTP/1.1. R. Khare, S. Lawrence. May
102 2000. (Format: TXT=27598 bytes) (Updates RFC2616) (Status: PROPOSED
103 STANDARD)
104
1052818 HTTP Over TLS. E. Rescorla. May 2000. (Format: TXT=15170 bytes)
106 (Status: INFORMATIONAL)
107
108 "Securing FTP with TLS", 01/27/2000, <draft-murray-auth-ftp-ssl-05.txt>
109
110
111To be implemented:
112------------------
113
114These are documents that describe things that are planed to be
115implemented in the hopefully short future.
116
1172560 X.509 Internet Public Key Infrastructure Online Certificate
118 Status Protocol - OCSP. M. Myers, R. Ankney, A. Malpani, S. Galperin,
119 C. Adams. June 1999. (Format: TXT=43243 bytes) (Status: PROPOSED
120 STANDARD)
121