summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/doc/DES_set_key.pod (renamed from src/lib/libssl/src/doc/crypto/des.pod)0
-rw-r--r--src/lib/libcrypto/doc/ERR.pod (renamed from src/lib/libssl/src/doc/crypto/err.pod)0
-rw-r--r--src/lib/libcrypto/doc/HMAC.pod (renamed from src/lib/libssl/src/doc/crypto/hmac.pod)0
-rw-r--r--src/lib/libcrypto/doc/MD5.pod (renamed from src/lib/libssl/src/doc/crypto/md5.pod)0
-rw-r--r--src/lib/libcrypto/doc/PEM_read_bio_PrivateKey.pod (renamed from src/lib/libssl/src/doc/crypto/pem.pod)0
-rw-r--r--src/lib/libcrypto/doc/RAND.pod (renamed from src/lib/libssl/src/doc/crypto/rand.pod)0
-rw-r--r--src/lib/libcrypto/doc/RC4.pod (renamed from src/lib/libssl/src/doc/crypto/rc4.pod)0
-rw-r--r--src/lib/libcrypto/doc/RIPEMD160.pod (renamed from src/lib/libssl/src/doc/crypto/ripemd.pod)0
-rw-r--r--src/lib/libcrypto/doc/SHA1.pod (renamed from src/lib/libssl/src/doc/crypto/sha.pod)0
-rw-r--r--src/lib/libcrypto/man/Makefile132
-rw-r--r--src/lib/libssl/man/Makefile209
-rw-r--r--src/lib/libssl/src/doc/crypto/BF_set_key.pod (renamed from src/lib/libssl/src/doc/crypto/blowfish.pod)0
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO.pod (renamed from src/lib/libssl/src/doc/crypto/bio.pod)0
-rw-r--r--src/lib/libssl/src/doc/crypto/BUF_MEM_new.pod (renamed from src/lib/libssl/src/doc/crypto/buffer.pod)0
-rw-r--r--src/lib/libssl/src/doc/crypto/CRYPTO_set_locking_callback.pod (renamed from src/lib/libssl/src/doc/crypto/threads.pod)0
-rw-r--r--src/lib/libssl/src/doc/crypto/DES_set_key.pod358
-rw-r--r--src/lib/libssl/src/doc/crypto/ERR.pod187
-rw-r--r--src/lib/libssl/src/doc/crypto/HMAC.pod106
-rw-r--r--src/lib/libssl/src/doc/crypto/MD5.pod101
-rw-r--r--src/lib/libssl/src/doc/crypto/PEM_read_bio_PrivateKey.pod476
-rw-r--r--src/lib/libssl/src/doc/crypto/RAND.pod74
-rw-r--r--src/lib/libssl/src/doc/crypto/RC4.pod62
-rw-r--r--src/lib/libssl/src/doc/crypto/RIPEMD160.pod66
-rw-r--r--src/lib/libssl/src/doc/crypto/SHA1.pod70
-rw-r--r--src/lib/libssl/src/doc/ssl/BIO_f_ssl.pod (renamed from src/lib/libssl/src/doc/crypto/BIO_f_ssl.pod)0
25 files changed, 1662 insertions, 179 deletions
diff --git a/src/lib/libssl/src/doc/crypto/des.pod b/src/lib/libcrypto/doc/DES_set_key.pod
index 6f0cf1cc5e..6f0cf1cc5e 100644
--- a/src/lib/libssl/src/doc/crypto/des.pod
+++ b/src/lib/libcrypto/doc/DES_set_key.pod
diff --git a/src/lib/libssl/src/doc/crypto/err.pod b/src/lib/libcrypto/doc/ERR.pod
index 6f729554d2..6f729554d2 100644
--- a/src/lib/libssl/src/doc/crypto/err.pod
+++ b/src/lib/libcrypto/doc/ERR.pod
diff --git a/src/lib/libssl/src/doc/crypto/hmac.pod b/src/lib/libcrypto/doc/HMAC.pod
index d92138d273..d92138d273 100644
--- a/src/lib/libssl/src/doc/crypto/hmac.pod
+++ b/src/lib/libcrypto/doc/HMAC.pod
diff --git a/src/lib/libssl/src/doc/crypto/md5.pod b/src/lib/libcrypto/doc/MD5.pod
index d11d5c32cb..d11d5c32cb 100644
--- a/src/lib/libssl/src/doc/crypto/md5.pod
+++ b/src/lib/libcrypto/doc/MD5.pod
diff --git a/src/lib/libssl/src/doc/crypto/pem.pod b/src/lib/libcrypto/doc/PEM_read_bio_PrivateKey.pod
index 54414a3f6f..54414a3f6f 100644
--- a/src/lib/libssl/src/doc/crypto/pem.pod
+++ b/src/lib/libcrypto/doc/PEM_read_bio_PrivateKey.pod
diff --git a/src/lib/libssl/src/doc/crypto/rand.pod b/src/lib/libcrypto/doc/RAND.pod
index e987414477..e987414477 100644
--- a/src/lib/libssl/src/doc/crypto/rand.pod
+++ b/src/lib/libcrypto/doc/RAND.pod
diff --git a/src/lib/libssl/src/doc/crypto/rc4.pod b/src/lib/libcrypto/doc/RC4.pod
index b6d3a4342c..b6d3a4342c 100644
--- a/src/lib/libssl/src/doc/crypto/rc4.pod
+++ b/src/lib/libcrypto/doc/RC4.pod
diff --git a/src/lib/libssl/src/doc/crypto/ripemd.pod b/src/lib/libcrypto/doc/RIPEMD160.pod
index 264bb99ae7..264bb99ae7 100644
--- a/src/lib/libssl/src/doc/crypto/ripemd.pod
+++ b/src/lib/libcrypto/doc/RIPEMD160.pod
diff --git a/src/lib/libssl/src/doc/crypto/sha.pod b/src/lib/libcrypto/doc/SHA1.pod
index 94ab7bc724..94ab7bc724 100644
--- a/src/lib/libssl/src/doc/crypto/sha.pod
+++ b/src/lib/libcrypto/doc/SHA1.pod
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile
index 503829ae8d..826d161c23 100644
--- a/src/lib/libcrypto/man/Makefile
+++ b/src/lib/libcrypto/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.1 2014/04/11 22:51:53 miod Exp $ 1# $OpenBSD: Makefile,v 1.2 2014/04/16 09:50:10 mpi Exp $
2 2
3.include <bsd.own.mk> # for NOMAN 3.include <bsd.own.mk> # for NOMAN
4 4
@@ -11,6 +11,8 @@ MAN= \
11 ASN1_STRING_new.3 \ 11 ASN1_STRING_new.3 \
12 ASN1_STRING_print_ex.3 \ 12 ASN1_STRING_print_ex.3 \
13 ASN1_generate_nconf.3 \ 13 ASN1_generate_nconf.3 \
14 BF_set_key.3 \
15 BIO.3 \
14 BIO_ctrl.3 \ 16 BIO_ctrl.3 \
15 BIO_f_base64.3 \ 17 BIO_f_base64.3 \
16 BIO_f_buffer.3 \ 18 BIO_f_buffer.3 \
@@ -49,9 +51,12 @@ MAN= \
49 BN_set_bit.3 \ 51 BN_set_bit.3 \
50 BN_swap.3 \ 52 BN_swap.3 \
51 BN_zero.3 \ 53 BN_zero.3 \
54 BUF_MEM_new.3 \
52 CONF_modules_free.3 \ 55 CONF_modules_free.3 \
53 CONF_modules_load_file.3 \ 56 CONF_modules_load_file.3 \
54 CRYPTO_set_ex_data.3 \ 57 CRYPTO_set_ex_data.3 \
58 CRYPTO_set_locking_callback.3 \
59 DES_set_key.3 \
55 DH_generate_key.3 \ 60 DH_generate_key.3 \
56 DH_generate_parameters.3 \ 61 DH_generate_parameters.3 \
57 DH_get_ex_new_index.3 \ 62 DH_get_ex_new_index.3 \
@@ -68,6 +73,7 @@ MAN= \
68 DSA_set_method.3 \ 73 DSA_set_method.3 \
69 DSA_sign.3 \ 74 DSA_sign.3 \
70 DSA_size.3 \ 75 DSA_size.3 \
76 ERR.3 \
71 ERR_GET_LIB.3 \ 77 ERR_GET_LIB.3 \
72 ERR_clear_error.3 \ 78 ERR_clear_error.3 \
73 ERR_error_string.3 \ 79 ERR_error_string.3 \
@@ -84,28 +90,48 @@ MAN= \
84 EVP_DigestVerifyInit.3 \ 90 EVP_DigestVerifyInit.3 \
85 EVP_EncryptInit.3 \ 91 EVP_EncryptInit.3 \
86 EVP_OpenInit.3 \ 92 EVP_OpenInit.3 \
93 EVP_PKEY_CTX_ctrl.3 \
94 EVP_PKEY_CTX_new.3 \
95 EVP_PKEY_cmp.3 \
96 EVP_PKEY_decrypt.3 \
97 EVP_PKEY_derive.3 \
98 EVP_PKEY_encrypt.3 \
99 EVP_PKEY_get_default_digest.3 \
100 EVP_PKEY_keygen.3 \
87 EVP_PKEY_new.3 \ 101 EVP_PKEY_new.3 \
102 EVP_PKEY_print_private.3 \
88 EVP_PKEY_set1_RSA.3 \ 103 EVP_PKEY_set1_RSA.3 \
104 EVP_PKEY_sign.3 \
105 EVP_PKEY_verify.3 \
106 EVP_PKEY_verify_recover.3 \
89 EVP_SealInit.3 \ 107 EVP_SealInit.3 \
90 EVP_SignInit.3 \ 108 EVP_SignInit.3 \
91 EVP_VerifyInit.3 \ 109 EVP_VerifyInit.3 \
110 HMAC.3 \
111 MD5.3 \
92 OBJ_nid2obj.3 \ 112 OBJ_nid2obj.3 \
93 OPENSSL_VERSION_NUMBER.3 \ 113 OPENSSL_VERSION_NUMBER.3 \
94 OPENSSL_config.3 \ 114 OPENSSL_config.3 \
95 OPENSSL_load_builtin_modules.3 \ 115 OPENSSL_load_builtin_modules.3 \
96 OpenSSL_add_all_algorithms.3 \ 116 OpenSSL_add_all_algorithms.3 \
117 PEM_read_bio_PrivateKey.3 \
118 PEM_write_bio_PKCS7_stream.3 \
97 PKCS12_create.3 \ 119 PKCS12_create.3 \
98 PKCS12_parse.3 \ 120 PKCS12_parse.3 \
99 PKCS7_decrypt.3 \ 121 PKCS7_decrypt.3 \
100 PKCS7_encrypt.3 \ 122 PKCS7_encrypt.3 \
101 PKCS7_sign.3 \ 123 PKCS7_sign.3 \
124 PKCS7_sign_add_signer.3 \
102 PKCS7_verify.3 \ 125 PKCS7_verify.3 \
126 RAND.3 \
103 RAND_add.3 \ 127 RAND_add.3 \
104 RAND_bytes.3 \ 128 RAND_bytes.3 \
105 RAND_cleanup.3 \ 129 RAND_cleanup.3 \
106 RAND_egd.3 \ 130 RAND_egd.3 \
107 RAND_load_file.3 \ 131 RAND_load_file.3 \
108 RAND_set_rand_method.3 \ 132 RAND_set_rand_method.3 \
133 RC4.3 \
134 RIPEMD160.3 \
109 RSA_blinding_on.3 \ 135 RSA_blinding_on.3 \
110 RSA_check_key.3 \ 136 RSA_check_key.3 \
111 RSA_generate_key.3 \ 137 RSA_generate_key.3 \
@@ -119,19 +145,20 @@ MAN= \
119 RSA_sign.3 \ 145 RSA_sign.3 \
120 RSA_sign_ASN1_OCTET_STRING.3 \ 146 RSA_sign_ASN1_OCTET_STRING.3 \
121 RSA_size.3 \ 147 RSA_size.3 \
148 SHA1.3 \
122 SMIME_read_PKCS7.3 \ 149 SMIME_read_PKCS7.3 \
123 SMIME_write_PKCS7.3 \ 150 SMIME_write_PKCS7.3 \
124 X509_NAME_ENTRY_get_object.3 \ 151 X509_NAME_ENTRY_get_object.3 \
125 X509_NAME_add_entry_by_txt.3 \ 152 X509_NAME_add_entry_by_txt.3 \
126 X509_NAME_get_index_by_NID.3 \ 153 X509_NAME_get_index_by_NID.3 \
127 X509_NAME_print_ex.3 \ 154 X509_NAME_print_ex.3 \
128 X509_new.3 \
129 X509_STORE_CTX_get_error.3 \ 155 X509_STORE_CTX_get_error.3 \
130 X509_STORE_CTX_get_ex_new_index.3 \ 156 X509_STORE_CTX_get_ex_new_index.3 \
131 X509_STORE_CTX_new.3 \ 157 X509_STORE_CTX_new.3 \
132 X509_STORE_CTX_set_verify_cb.3 \ 158 X509_STORE_CTX_set_verify_cb.3 \
133 X509_STORE_set_verify_cb_func.3 \ 159 X509_STORE_set_verify_cb_func.3 \
134 X509_VERIFY_PARAM_set_flags.3 \ 160 X509_VERIFY_PARAM_set_flags.3 \
161 X509_new.3 \
135 X509_verify_cert.3 \ 162 X509_verify_cert.3 \
136 bn.3 \ 163 bn.3 \
137 bn_internal.3 \ 164 bn_internal.3 \
@@ -152,66 +179,35 @@ MAN= \
152 ecdsa.3 \ 179 ecdsa.3 \
153 engine.3 \ 180 engine.3 \
154 evp.3 \ 181 evp.3 \
182 i2d_PKCS7_bio_stream.3 \
155 lh_stats.3 \ 183 lh_stats.3 \
156 lhash.3 \ 184 lhash.3 \
157 pem.3 \
158 rsa.3 \ 185 rsa.3 \
159 ui.3 \ 186 ui.3 \
160 ui_compat.3 \ 187 ui_compat.3 \
161 x509.3 \ 188 x509.3 \
162 BF_set_key.3 \
163 BIO.3 \
164 BUF_MEM_new.3 \
165 CRYPTO_set_locking_callback.3 \
166 DES_set_key.3 \
167 ERR.3 \
168 HMAC.3 \
169 MD5.3 \
170 PEM_read_bio_PrivateKey.3 \
171 RAND.3 \
172 RC4.3 \
173 RIPEMD160.3 \
174 SHA1.3
175
176# These pages removed/renamed
177# OPENSSL_ia32cap.cat3 \ # i386-only, internal API
178# OPENSSL_Applink.cat3 \ # Win32 only
179# bio.cat3 \ # conflict; see below
180# blowfish.cat3 \ # conflict; see below
181# buffer.cat3 \ # conflict; see below
182# des.cat3 \ # conflict; see below
183# des_modes.cat3 \ # fairly pointless
184# hmac.cat3 \ # conflict; see below
185# md5.cat3 \ # conflict; see below
186# mdc2.cat3 \ # patents; removed
187# rand.cat3 \ # conflict; see below
188# rc4.cat3 \ # conflict; see below
189# ripemd.cat3 \ # conflict; see below
190# sha.cat3 \ # conflict; see below
191
192 189
193# these are a real problem, since they re-document functions described in 190#MAN+= BIO_new_CMS.3 \
194# other pages. 191# CMS_add0_cert.3 \
195 192# CMS_add1_recipient_cert.3 \
196.for page src in \ 193# CMS_compress.3 \
197 BF_set_key blowfish \ 194# CMS_decrypt.3 \
198 BIO bio \ 195# CMS_encrypt.3 \
199 BUF_MEM_new buffer \ 196# CMS_final.3 \
200 CRYPTO_set_locking_callback threads \ 197# CMS_get0_RecipientInfos.3 \
201 DES_set_key des \ 198# CMS_get0_SignerInfos.3 \
202 ERR err \ 199# CMS_get0_type.3 \
203 HMAC hmac \ 200# CMS_get1_ReceiptRequest.3 \
204 MD5 md5 \ 201# CMS_sign.3 \
205 PEM_read_bio_PrivateKey pem \ 202# CMS_sign_add1_signer.3 \
206 RAND rand \ 203# CMS_sign_receipt.3 \
207 RC4 rc4 \ 204# CMS_uncompress.3 \
208 RIPEMD160 ripemd \ 205# CMS_verify.3 \
209 SHA1 sha 206# CMS_verify_receipt.3 \
210 207# PEM_write_bio_CMS_stream.3 \
211${page}.3: ${src}.pod 208# SMIME_read_CMS.3 \
212 @echo '${POD2MAN} --section=3 --name=${page:U} $? > $@' 209# SMIME_write_CMS.3 \
213 @${POD2MAN} --section=3 --name=${page:U} $? > $@.tmp && mv $@.tmp $@ 210# i2d_CMS_bio_stream.3 \
214.endfor
215 211
216MLINKS+=\ 212MLINKS+=\
217 ASN1_OBJECT_new.3 ASN1_OBJECT_free.3 \ 213 ASN1_OBJECT_new.3 ASN1_OBJECT_free.3 \
@@ -520,7 +516,32 @@ MLINKS+=\
520 EVP_EncryptInit.3 OBJ_obj2nid.3 \ 516 EVP_EncryptInit.3 OBJ_obj2nid.3 \
521 EVP_OpenInit.3 EVP_OpenFinal.3 \ 517 EVP_OpenInit.3 EVP_OpenFinal.3 \
522 EVP_OpenInit.3 EVP_OpenUpdate.3 \ 518 EVP_OpenInit.3 EVP_OpenUpdate.3 \
519 EVP_PKEY_CTX_ctrl.3 EVP_PKEY_ctrl_str.3 \
520 EVP_PKEY_CTX_new.3 EVP_PKEY_CTX_new_id.3 \
521 EVP_PKEY_CTX_new.3 EVP_PKEY_CTX_dup.3 \
522 EVP_PKEY_CTX_new.3 EVP_PKEY_CTX_free.3 \
523 EVP_PKEY_cmp.3 EVP_PKEY_copy_parameters.3 \
524 EVP_PKEY_cmp.3 EVP_PKEY_missing_parameters.3 \
525 EVP_PKEY_cmp.3 EVP_PKEY_cmp_parameters.3 \
523 EVP_PKEY_new.3 EVP_PKEY_free.3 \ 526 EVP_PKEY_new.3 EVP_PKEY_free.3 \
527 EVP_PKEY_decrypt.3 EVP_PKEY_decrypt_init.3 \
528 EVP_PKEY_derive.3 EVP_PKEY_derive_init.3 \
529 EVP_PKEY_derive.3 EVP_PKEY_derive_set_peer.3 \
530 EVP_PKEY_get_default_digest.3 EVP_PKEY_get_default_digest_nid.3 \
531 EVP_PKEY_encrypt.3 EVP_PKEY_encrypt_init.3 \
532 EVP_PKEY_keygen.3 EVP_PKEY_keygen_init.3 \
533 EVP_PKEY_keygen.3 EVP_PKEY_paramgen_init.3 \
534 EVP_PKEY_keygen.3 EVP_PKEY_paramgen.3 \
535 EVP_PKEY_keygen.3 EVP_PKEY_CTX_set_cb.3 \
536 EVP_PKEY_keygen.3 EVP_PKEY_CTX_get_cb.3 \
537 EVP_PKEY_keygen.3 EVP_PKEY_CTX_get_keygen_info.3 \
538 EVP_PKEY_keygen.3 EVP_PKEY_CTX_set_app_data.3 \
539 EVP_PKEY_keygen.3 EVP_PKEY_CTX_get_app_data.3 \
540 EVP_PKEY_print_private.3 EVP_PKEY_print_private.3 \
541 EVP_PKEY_print_private.3 EVP_PKEY_print_params.3 \
542 EVP_PKEY_sign.3 EVP_PKEY_sign_init.3 \
543 EVP_PKEY_verify.3 EVP_PKEY_verify_init.3 \
544 EVP_PKEY_verify_recover.3 EVP_PKEY_verify_recover_init.3 \
524 EVP_PKEY_set1_RSA.3 EVP_PKEY_assign_DH.3 \ 545 EVP_PKEY_set1_RSA.3 EVP_PKEY_assign_DH.3 \
525 EVP_PKEY_set1_RSA.3 EVP_PKEY_assign_DSA.3 \ 546 EVP_PKEY_set1_RSA.3 EVP_PKEY_assign_DSA.3 \
526 EVP_PKEY_set1_RSA.3 EVP_PKEY_assign_EC_KEY.3 \ 547 EVP_PKEY_set1_RSA.3 EVP_PKEY_assign_EC_KEY.3 \
@@ -887,7 +908,6 @@ maninstall:
887 908
888.endif 909.endif
889 910
890# XXX .PATH order is critical because of non-unique filenames
891.PATH: ${.CURDIR}/../../libssl/src/doc/crypto 911.PATH: ${.CURDIR}/../../libssl/src/doc/crypto
892.SUFFIXES: .pod .1 .3 .7 912.SUFFIXES: .pod .1 .3 .7
893.for sect in 1 3 7 913.for sect in 1 3 7
diff --git a/src/lib/libssl/man/Makefile b/src/lib/libssl/man/Makefile
index b3b5369cd8..00414ad322 100644
--- a/src/lib/libssl/man/Makefile
+++ b/src/lib/libssl/man/Makefile
@@ -1,129 +1,94 @@
1# $OpenBSD: Makefile,v 1.24 2014/04/14 08:18:40 mpi Exp $ 1# $OpenBSD: Makefile,v 1.25 2014/04/16 09:50:10 mpi Exp $
2 2
3.include <bsd.own.mk> # for NOMAN 3.include <bsd.own.mk> # for NOMAN
4 4
5POD2MAN=pod2man --official --release="OpenBSD ${OSREV}" --center=OpenSSL 5POD2MAN=pod2man --official --release="OpenBSD ${OSREV}" --center=OpenSSL
6 6
7.ifndef NOMAN 7.ifndef NOMAN
8 8MAN= \
9# libcrypto 9 BIO_f_ssl.3 \
10MAN= ASN1_OBJECT_new.3 ASN1_STRING_length.3 ASN1_STRING_new.3 \ 10 SSL_CIPHER_get_name.3 \
11 ASN1_STRING_print_ex.3 ASN1_generate_nconf.3 11 SSL_COMP_add_compression_method.3 \
12 12 SSL_CTX_add_extra_chain_cert.3 \
13MAN+= BIO_ctrl.3 BIO_f_base64.3 BIO_f_buffer.3 BIO_f_cipher.3 BIO_f_md.3 \ 13 SSL_CTX_add_session.3 \
14 BIO_f_null.3 BIO_f_ssl.3 BIO_find_type.3 BIO_new.3 BIO_new_CMS.3 \ 14 SSL_CTX_ctrl.3 \
15 BIO_push.3 BIO_read.3 BIO_s_accept.3 BIO_s_bio.3 BIO_s_connect.3 \ 15 SSL_CTX_flush_sessions.3 \
16 BIO_s_fd.3 BIO_s_file.3 BIO_s_mem.3 BIO_s_null.3 BIO_s_socket.3 \ 16 SSL_CTX_free.3 \
17 BIO_set_callback.3 BIO_should_retry.3 17 SSL_CTX_get_ex_new_index.3 \
18 18 SSL_CTX_get_verify_mode.3 \
19MAN+= BN_BLINDING_new.3 BN_CTX_new.3 BN_CTX_start.3 BN_add.3 BN_add_word.3 \ 19 SSL_CTX_load_verify_locations.3 \
20 BN_bn2bin.3 BN_cmp.3 BN_copy.3 BN_generate_prime.3 BN_mod_inverse.3 \ 20 SSL_CTX_new.3 \
21 BN_mod_mul_montgomery.3 BN_mod_mul_reciprocal.3 BN_new.3 \ 21 SSL_CTX_sess_number.3 \
22 BN_num_bytes.3 BN_rand.3 BN_set_bit.3 BN_swap.3 BN_zero.3 22 SSL_CTX_sess_set_cache_size.3 \
23 23 SSL_CTX_sess_set_get_cb.3 \
24MAN+= CMS_add0_cert.3 CMS_add1_recipient_cert.3 CMS_compress.3 CMS_decrypt.3 \ 24 SSL_CTX_sessions.3 \
25 CMS_encrypt.3 CMS_final.3 CMS_get0_RecipientInfos.3 \ 25 SSL_CTX_set_cert_store.3 \
26 CMS_get0_SignerInfos.3 CMS_get0_type.3 CMS_get1_ReceiptRequest.3 \ 26 SSL_CTX_set_cert_verify_callback.3 \
27 CMS_sign.3 CMS_sign_add1_signer.3 CMS_sign_receipt.3 CMS_uncompress.3 \ 27 SSL_CTX_set_cipher_list.3 \
28 CMS_verify.3 CMS_verify_receipt.3 28 SSL_CTX_set_client_CA_list.3 \
29 29 SSL_CTX_set_client_cert_cb.3 \
30MAN+= CONF_modules_free.3 CONF_modules_load_file.3 30 SSL_CTX_set_default_passwd_cb.3 \
31 31 SSL_CTX_set_generate_session_id.3 \
32MAN+= CRYPTO_set_ex_data.3 32 SSL_CTX_set_info_callback.3 \
33 33 SSL_CTX_set_max_cert_list.3 \
34MAN+= DH_generate_key.3 DH_generate_parameters.3 DH_get_ex_new_index.3 \ 34 SSL_CTX_set_mode.3 \
35 DH_new.3 DH_set_method.3 DH_size.3 35 SSL_CTX_set_msg_callback.3 \
36 36 SSL_CTX_set_options.3 \
37MAN+= DSA_SIG_new.3 DSA_do_sign.3 DSA_dup_DH.3 DSA_generate_key.3 \ 37 SSL_CTX_set_psk_client_callback.3 \
38 DSA_generate_parameters.3 DSA_get_ex_new_index.3 DSA_new.3 \ 38 SSL_CTX_set_quiet_shutdown.3 \
39 DSA_set_method.3 DSA_sign.3 DSA_size.3 39 SSL_CTX_set_session_cache_mode.3 \
40 40 SSL_CTX_set_session_id_context.3 \
41MAN+= ERR_GET_LIB.3 ERR_clear_error.3 ERR_error_string.3 ERR_get_error.3 \ 41 SSL_CTX_set_ssl_version.3 \
42 ERR_load_crypto_strings.3 ERR_load_strings.3 ERR_print_errors.3 \ 42 SSL_CTX_set_timeout.3 \
43 ERR_put_error.3 ERR_remove_state.3 ERR_set_mark.3 43 SSL_CTX_set_tmp_dh_callback.3 \
44 44 SSL_CTX_set_tmp_rsa_callback.3 \
45MAN+= EVP_BytesToKey.3 EVP_DigestInit.3 EVP_DigestSignInit.3 \ 45 SSL_CTX_set_verify.3 \
46 EVP_DigestVerifyInit.3 EVP_EncryptInit.3 EVP_OpenInit.3 \ 46 SSL_CTX_use_certificate.3 \
47 EVP_PKEY_CTX_ctrl.3 EVP_PKEY_CTX_new.3 EVP_PKEY_cmp.3 \ 47 SSL_CTX_use_psk_identity_hint.3 \
48 EVP_PKEY_decrypt.3 EVP_PKEY_derive.3 EVP_PKEY_encrypt.3 \ 48 SSL_SESSION_free.3 \
49 EVP_PKEY_get_default_digest.3 EVP_PKEY_keygen.3 EVP_PKEY_new.3 \ 49 SSL_SESSION_get_ex_new_index.3 \
50 EVP_PKEY_print_private.3 EVP_PKEY_set1_RSA.3 EVP_PKEY_sign.3 \ 50 SSL_SESSION_get_time.3 \
51 EVP_PKEY_verify.3 EVP_PKEY_verify_recover.3 EVP_SealInit.3 \ 51 SSL_accept.3 \
52 EVP_SignInit.3 EVP_VerifyInit.3 52 SSL_alert_type_string.3 \
53 53 SSL_clear.3 \
54MAN+= OBJ_nid2obj.3 54 SSL_connect.3 \
55 55 SSL_do_handshake.3 \
56MAN+= OPENSSL_Applink.3 OPENSSL_VERSION_NUMBER.3 OPENSSL_config.3 \ 56 SSL_free.3 \
57 OPENSSL_ia32cap.3 OPENSSL_load_builtin_modules.3 \ 57 SSL_get_SSL_CTX.3 \
58 OpenSSL_add_all_algorithms.3 58 SSL_get_ciphers.3 \
59 59 SSL_get_client_CA_list.3 \
60MAN+= PEM_write_bio_CMS_stream.3 PEM_write_bio_PKCS7_stream.3 60 SSL_get_current_cipher.3 \
61 61 SSL_get_default_timeout.3 \
62MAN+= PKCS12_create.3 PKCS12_parse.3 PKCS7_decrypt.3 PKCS7_encrypt.3 \ 62 SSL_get_error.3 \
63 PKCS7_sign.3 PKCS7_sign_add_signer.3 PKCS7_verify.3 63 SSL_get_ex_data_X509_STORE_CTX_idx.3 \
64 64 SSL_get_ex_new_index.3 \
65MAN+= RAND_add.3 RAND_bytes.3 RAND_cleanup.3 RAND_egd.3 RAND_load_file.3 \ 65 SSL_get_fd.3 \
66 RAND_set_rand_method.3 66 SSL_get_peer_cert_chain.3 \
67 67 SSL_get_peer_certificate.3 \
68MAN+= RSA_blinding_on.3 RSA_check_key.3 RSA_generate_key.3 \ 68 SSL_get_psk_identity.3 \
69 RSA_get_ex_new_index.3 RSA_new.3 RSA_padding_add_PKCS1_type_1.3 \ 69 SSL_get_rbio.3 \
70 RSA_print.3 RSA_private_encrypt.3 RSA_public_encrypt.3 \ 70 SSL_get_session.3 \
71 RSA_set_method.3 RSA_sign.3 RSA_sign_ASN1_OCTET_STRING.3 RSA_size.3 71 SSL_get_verify_result.3 \
72 72 SSL_get_version.3 \
73MAN+= SMIME_read_CMS.3 SMIME_read_PKCS7.3 SMIME_write_CMS.3 \ 73 SSL_library_init.3 \
74 SMIME_write_PKCS7.3 74 SSL_load_client_CA_file.3 \
75 75 SSL_new.3 \
76MAN+= X509_NAME_ENTRY_get_object.3 X509_NAME_add_entry_by_txt.3 \ 76 SSL_pending.3 \
77 X509_NAME_get_index_by_NID.3 X509_NAME_print_ex.3 \ 77 SSL_read.3 \
78 X509_STORE_CTX_get_error.3 X509_STORE_CTX_get_ex_new_index.3 \ 78 SSL_rstate_string.3 \
79 X509_STORE_CTX_new.3 X509_STORE_CTX_set_verify_cb.3 \ 79 SSL_session_reused.3 \
80 X509_STORE_set_verify_cb_func.3 X509_VERIFY_PARAM_set_flags.3 \ 80 SSL_set_bio.3 \
81 X509_new.3 X509_verify_cert.3 81 SSL_set_connect_state.3 \
82 82 SSL_set_fd.3 \
83MAN+= d2i_ASN1_OBJECT.3 d2i_DHparams.3 d2i_DSAPublicKey.3 \ 83 SSL_set_session.3 \
84 d2i_PKCS8PrivateKey.3 d2i_RSAPublicKey.3 d2i_X509.3 d2i_X509_ALGOR.3 \ 84 SSL_set_shutdown.3 \
85 d2i_X509_CRL.3 d2i_X509_NAME.3 d2i_X509_REQ.3 d2i_X509_SIG.3 85 SSL_set_verify_result.3 \
86 86 SSL_shutdown.3 \
87MAN+= i2d_CMS_bio_stream.3 i2d_PKCS7_bio_stream.3 87 SSL_state_string.3 \
88 88 SSL_want.3 \
89MAN+= bio.3 blowfish.3 bn.3 bn_internal.3 buffer.3 crypto.3 des.3 \ 89 SSL_write.3 \
90 des_modes.3 dh.3 dsa.3 ecdsa.3 engine.3 err.3 evp.3 hmac.3 lh_stats.3 \ 90 d2i_SSL_SESSION.3 \
91 lhash.3 md5.3 mdc2.3 pem.3 rand.3 rc4.3 ripemd.3 rsa.3 sha.3 threads.3 \ 91 ssl.3 \
92 ui.3 ui_compat.3 x509.3
93
94# libssl
95MAN+= SSL_CIPHER_get_name.3 SSL_COMP_add_compression_method.3 \
96 SSL_CTX_add_extra_chain_cert.3 SSL_CTX_add_session.3 SSL_CTX_ctrl.3 \
97 SSL_CTX_flush_sessions.3 SSL_CTX_free.3 SSL_CTX_get_ex_new_index.3 \
98 SSL_CTX_get_verify_mode.3 SSL_CTX_load_verify_locations.3 \
99 SSL_CTX_new.3 SSL_CTX_sess_number.3 SSL_CTX_sess_set_cache_size.3 \
100 SSL_CTX_sess_set_get_cb.3 SSL_CTX_sessions.3 SSL_CTX_set_cert_store.3 \
101 SSL_CTX_set_cert_verify_callback.3 SSL_CTX_set_cipher_list.3 \
102 SSL_CTX_set_client_CA_list.3 SSL_CTX_set_client_cert_cb.3 \
103 SSL_CTX_set_default_passwd_cb.3 SSL_CTX_set_generate_session_id.3 \
104 SSL_CTX_set_info_callback.3 SSL_CTX_set_max_cert_list.3 \
105 SSL_CTX_set_mode.3 SSL_CTX_set_msg_callback.3 SSL_CTX_set_options.3 \
106 SSL_CTX_set_psk_client_callback.3 SSL_CTX_set_quiet_shutdown.3 \
107 SSL_CTX_set_session_cache_mode.3 SSL_CTX_set_session_id_context.3 \
108 SSL_CTX_set_ssl_version.3 SSL_CTX_set_timeout.3 \
109 SSL_CTX_set_tmp_dh_callback.3 SSL_CTX_set_tmp_rsa_callback.3 \
110 SSL_CTX_set_verify.3 SSL_CTX_use_certificate.3 \
111 SSL_CTX_use_psk_identity_hint.3 SSL_SESSION_free.3 \
112 SSL_SESSION_get_ex_new_index.3 SSL_SESSION_get_time.3 SSL_accept.3 \
113 SSL_alert_type_string.3 SSL_clear.3 SSL_connect.3 SSL_do_handshake.3 \
114 SSL_free.3 SSL_get_SSL_CTX.3 SSL_get_ciphers.3 \
115 SSL_get_client_CA_list.3 SSL_get_current_cipher.3 \
116 SSL_get_default_timeout.3 SSL_get_error.3 \
117 SSL_get_ex_data_X509_STORE_CTX_idx.3 SSL_get_ex_new_index.3 \
118 SSL_get_fd.3 SSL_get_peer_cert_chain.3 SSL_get_peer_certificate.3 \
119 SSL_get_psk_identity.3 SSL_get_rbio.3 SSL_get_session.3 \
120 SSL_get_verify_result.3 SSL_get_version.3 SSL_library_init.3 \
121 SSL_load_client_CA_file.3 SSL_new.3 SSL_pending.3 SSL_read.3 \
122 SSL_rstate_string.3 SSL_session_reused.3 SSL_set_bio.3 \
123 SSL_set_connect_state.3 SSL_set_fd.3 SSL_set_session.3 \
124 SSL_set_shutdown.3 SSL_set_verify_result.3 SSL_shutdown.3 \
125 SSL_state_string.3 SSL_want.3 SSL_write.3 \
126 d2i_SSL_SESSION.3 ssl.3
127 92
128# XXX ERR_load_crypto_strings.3 built by libcrypto 93# XXX ERR_load_crypto_strings.3 built by libcrypto
129MLINKS+=\ 94MLINKS+=\
@@ -282,9 +247,7 @@ maninstall:
282 247
283.endif 248.endif
284 249
285# XXX .PATH order is critical because of non-unique filenames 250.PATH: ${.CURDIR}/../src/doc/ssl
286# XXX doc/crypto because of BIO_f_ssl()
287.PATH: ${.CURDIR}/../src/doc/crypto ${.CURDIR}/../src/doc/ssl
288.SUFFIXES: .pod .1 .3 .7 251.SUFFIXES: .pod .1 .3 .7
289.for sect in 1 3 7 252.for sect in 1 3 7
290.pod.${sect}: 253.pod.${sect}:
diff --git a/src/lib/libssl/src/doc/crypto/blowfish.pod b/src/lib/libssl/src/doc/crypto/BF_set_key.pod
index 5b2d274c15..5b2d274c15 100644
--- a/src/lib/libssl/src/doc/crypto/blowfish.pod
+++ b/src/lib/libssl/src/doc/crypto/BF_set_key.pod
diff --git a/src/lib/libssl/src/doc/crypto/bio.pod b/src/lib/libssl/src/doc/crypto/BIO.pod
index f9239226ff..f9239226ff 100644
--- a/src/lib/libssl/src/doc/crypto/bio.pod
+++ b/src/lib/libssl/src/doc/crypto/BIO.pod
diff --git a/src/lib/libssl/src/doc/crypto/buffer.pod b/src/lib/libssl/src/doc/crypto/BUF_MEM_new.pod
index 781f5b11ee..781f5b11ee 100644
--- a/src/lib/libssl/src/doc/crypto/buffer.pod
+++ b/src/lib/libssl/src/doc/crypto/BUF_MEM_new.pod
diff --git a/src/lib/libssl/src/doc/crypto/threads.pod b/src/lib/libssl/src/doc/crypto/CRYPTO_set_locking_callback.pod
index dc0e9391dc..dc0e9391dc 100644
--- a/src/lib/libssl/src/doc/crypto/threads.pod
+++ b/src/lib/libssl/src/doc/crypto/CRYPTO_set_locking_callback.pod
diff --git a/src/lib/libssl/src/doc/crypto/DES_set_key.pod b/src/lib/libssl/src/doc/crypto/DES_set_key.pod
new file mode 100644
index 0000000000..6f0cf1cc5e
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/DES_set_key.pod
@@ -0,0 +1,358 @@
1=pod
2
3=head1 NAME
4
5DES_random_key, DES_set_key, DES_key_sched, DES_set_key_checked,
6DES_set_key_unchecked, DES_set_odd_parity, DES_is_weak_key,
7DES_ecb_encrypt, DES_ecb2_encrypt, DES_ecb3_encrypt, DES_ncbc_encrypt,
8DES_cfb_encrypt, DES_ofb_encrypt, DES_pcbc_encrypt, DES_cfb64_encrypt,
9DES_ofb64_encrypt, DES_xcbc_encrypt, DES_ede2_cbc_encrypt,
10DES_ede2_cfb64_encrypt, DES_ede2_ofb64_encrypt, DES_ede3_cbc_encrypt,
11DES_ede3_cbcm_encrypt, DES_ede3_cfb64_encrypt, DES_ede3_ofb64_encrypt,
12DES_cbc_cksum, DES_quad_cksum, DES_string_to_key, DES_string_to_2keys,
13DES_fcrypt, DES_crypt, DES_enc_read, DES_enc_write - DES encryption
14
15=head1 SYNOPSIS
16
17 #include <openssl/des.h>
18
19 void DES_random_key(DES_cblock *ret);
20
21 int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule);
22 int DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule);
23 int DES_set_key_checked(const_DES_cblock *key,
24 DES_key_schedule *schedule);
25 void DES_set_key_unchecked(const_DES_cblock *key,
26 DES_key_schedule *schedule);
27
28 void DES_set_odd_parity(DES_cblock *key);
29 int DES_is_weak_key(const_DES_cblock *key);
30
31 void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output,
32 DES_key_schedule *ks, int enc);
33 void DES_ecb2_encrypt(const_DES_cblock *input, DES_cblock *output,
34 DES_key_schedule *ks1, DES_key_schedule *ks2, int enc);
35 void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
36 DES_key_schedule *ks1, DES_key_schedule *ks2,
37 DES_key_schedule *ks3, int enc);
38
39 void DES_ncbc_encrypt(const unsigned char *input, unsigned char *output,
40 long length, DES_key_schedule *schedule, DES_cblock *ivec,
41 int enc);
42 void DES_cfb_encrypt(const unsigned char *in, unsigned char *out,
43 int numbits, long length, DES_key_schedule *schedule,
44 DES_cblock *ivec, int enc);
45 void DES_ofb_encrypt(const unsigned char *in, unsigned char *out,
46 int numbits, long length, DES_key_schedule *schedule,
47 DES_cblock *ivec);
48 void DES_pcbc_encrypt(const unsigned char *input, unsigned char *output,
49 long length, DES_key_schedule *schedule, DES_cblock *ivec,
50 int enc);
51 void DES_cfb64_encrypt(const unsigned char *in, unsigned char *out,
52 long length, DES_key_schedule *schedule, DES_cblock *ivec,
53 int *num, int enc);
54 void DES_ofb64_encrypt(const unsigned char *in, unsigned char *out,
55 long length, DES_key_schedule *schedule, DES_cblock *ivec,
56 int *num);
57
58 void DES_xcbc_encrypt(const unsigned char *input, unsigned char *output,
59 long length, DES_key_schedule *schedule, DES_cblock *ivec,
60 const_DES_cblock *inw, const_DES_cblock *outw, int enc);
61
62 void DES_ede2_cbc_encrypt(const unsigned char *input,
63 unsigned char *output, long length, DES_key_schedule *ks1,
64 DES_key_schedule *ks2, DES_cblock *ivec, int enc);
65 void DES_ede2_cfb64_encrypt(const unsigned char *in,
66 unsigned char *out, long length, DES_key_schedule *ks1,
67 DES_key_schedule *ks2, DES_cblock *ivec, int *num, int enc);
68 void DES_ede2_ofb64_encrypt(const unsigned char *in,
69 unsigned char *out, long length, DES_key_schedule *ks1,
70 DES_key_schedule *ks2, DES_cblock *ivec, int *num);
71
72 void DES_ede3_cbc_encrypt(const unsigned char *input,
73 unsigned char *output, long length, DES_key_schedule *ks1,
74 DES_key_schedule *ks2, DES_key_schedule *ks3, DES_cblock *ivec,
75 int enc);
76 void DES_ede3_cbcm_encrypt(const unsigned char *in, unsigned char *out,
77 long length, DES_key_schedule *ks1, DES_key_schedule *ks2,
78 DES_key_schedule *ks3, DES_cblock *ivec1, DES_cblock *ivec2,
79 int enc);
80 void DES_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out,
81 long length, DES_key_schedule *ks1, DES_key_schedule *ks2,
82 DES_key_schedule *ks3, DES_cblock *ivec, int *num, int enc);
83 void DES_ede3_ofb64_encrypt(const unsigned char *in, unsigned char *out,
84 long length, DES_key_schedule *ks1,
85 DES_key_schedule *ks2, DES_key_schedule *ks3,
86 DES_cblock *ivec, int *num);
87
88 DES_LONG DES_cbc_cksum(const unsigned char *input, DES_cblock *output,
89 long length, DES_key_schedule *schedule,
90 const_DES_cblock *ivec);
91 DES_LONG DES_quad_cksum(const unsigned char *input, DES_cblock output[],
92 long length, int out_count, DES_cblock *seed);
93 void DES_string_to_key(const char *str, DES_cblock *key);
94 void DES_string_to_2keys(const char *str, DES_cblock *key1,
95 DES_cblock *key2);
96
97 char *DES_fcrypt(const char *buf, const char *salt, char *ret);
98 char *DES_crypt(const char *buf, const char *salt);
99
100 int DES_enc_read(int fd, void *buf, int len, DES_key_schedule *sched,
101 DES_cblock *iv);
102 int DES_enc_write(int fd, const void *buf, int len,
103 DES_key_schedule *sched, DES_cblock *iv);
104
105=head1 DESCRIPTION
106
107This library contains a fast implementation of the DES encryption
108algorithm.
109
110There are two phases to the use of DES encryption. The first is the
111generation of a I<DES_key_schedule> from a key, the second is the
112actual encryption. A DES key is of type I<DES_cblock>. This type is
113consists of 8 bytes with odd parity. The least significant bit in
114each byte is the parity bit. The key schedule is an expanded form of
115the key; it is used to speed the encryption process.
116
117DES_random_key() generates a random key. The PRNG must be seeded
118prior to using this function (see L<rand(3)|rand(3)>). If the PRNG
119could not generate a secure key, 0 is returned.
120
121Before a DES key can be used, it must be converted into the
122architecture dependent I<DES_key_schedule> via the
123DES_set_key_checked() or DES_set_key_unchecked() function.
124
125DES_set_key_checked() will check that the key passed is of odd parity
126and is not a week or semi-weak key. If the parity is wrong, then -1
127is returned. If the key is a weak key, then -2 is returned. If an
128error is returned, the key schedule is not generated.
129
130DES_set_key() works like
131DES_set_key_checked() if the I<DES_check_key> flag is non-zero,
132otherwise like DES_set_key_unchecked(). These functions are available
133for compatibility; it is recommended to use a function that does not
134depend on a global variable.
135
136DES_set_odd_parity() sets the parity of the passed I<key> to odd.
137
138DES_is_weak_key() returns 1 is the passed key is a weak key, 0 if it
139is ok. The probability that a randomly generated key is weak is
1401/2^52, so it is not really worth checking for them.
141
142The following routines mostly operate on an input and output stream of
143I<DES_cblock>s.
144
145DES_ecb_encrypt() is the basic DES encryption routine that encrypts or
146decrypts a single 8-byte I<DES_cblock> in I<electronic code book>
147(ECB) mode. It always transforms the input data, pointed to by
148I<input>, into the output data, pointed to by the I<output> argument.
149If the I<encrypt> argument is non-zero (DES_ENCRYPT), the I<input>
150(cleartext) is encrypted in to the I<output> (ciphertext) using the
151key_schedule specified by the I<schedule> argument, previously set via
152I<DES_set_key>. If I<encrypt> is zero (DES_DECRYPT), the I<input> (now
153ciphertext) is decrypted into the I<output> (now cleartext). Input
154and output may overlap. DES_ecb_encrypt() does not return a value.
155
156DES_ecb3_encrypt() encrypts/decrypts the I<input> block by using
157three-key Triple-DES encryption in ECB mode. This involves encrypting
158the input with I<ks1>, decrypting with the key schedule I<ks2>, and
159then encrypting with I<ks3>. This routine greatly reduces the chances
160of brute force breaking of DES and has the advantage of if I<ks1>,
161I<ks2> and I<ks3> are the same, it is equivalent to just encryption
162using ECB mode and I<ks1> as the key.
163
164The macro DES_ecb2_encrypt() is provided to perform two-key Triple-DES
165encryption by using I<ks1> for the final encryption.
166
167DES_ncbc_encrypt() encrypts/decrypts using the I<cipher-block-chaining>
168(CBC) mode of DES. If the I<encrypt> argument is non-zero, the
169routine cipher-block-chain encrypts the cleartext data pointed to by
170the I<input> argument into the ciphertext pointed to by the I<output>
171argument, using the key schedule provided by the I<schedule> argument,
172and initialization vector provided by the I<ivec> argument. If the
173I<length> argument is not an integral multiple of eight bytes, the
174last block is copied to a temporary area and zero filled. The output
175is always an integral multiple of eight bytes.
176
177DES_xcbc_encrypt() is RSA's DESX mode of DES. It uses I<inw> and
178I<outw> to 'whiten' the encryption. I<inw> and I<outw> are secret
179(unlike the iv) and are as such, part of the key. So the key is sort
180of 24 bytes. This is much better than CBC DES.
181
182DES_ede3_cbc_encrypt() implements outer triple CBC DES encryption with
183three keys. This means that each DES operation inside the CBC mode is
184really an C<C=E(ks3,D(ks2,E(ks1,M)))>. This mode is used by SSL.
185
186The DES_ede2_cbc_encrypt() macro implements two-key Triple-DES by
187reusing I<ks1> for the final encryption. C<C=E(ks1,D(ks2,E(ks1,M)))>.
188This form of Triple-DES is used by the RSAREF library.
189
190DES_pcbc_encrypt() encrypt/decrypts using the propagating cipher block
191chaining mode used by Kerberos v4. Its parameters are the same as
192DES_ncbc_encrypt().
193
194DES_cfb_encrypt() encrypt/decrypts using cipher feedback mode. This
195method takes an array of characters as input and outputs and array of
196characters. It does not require any padding to 8 character groups.
197Note: the I<ivec> variable is changed and the new changed value needs to
198be passed to the next call to this function. Since this function runs
199a complete DES ECB encryption per I<numbits>, this function is only
200suggested for use when sending small numbers of characters.
201
202DES_cfb64_encrypt()
203implements CFB mode of DES with 64bit feedback. Why is this
204useful you ask? Because this routine will allow you to encrypt an
205arbitrary number of bytes, no 8 byte padding. Each call to this
206routine will encrypt the input bytes to output and then update ivec
207and num. num contains 'how far' we are though ivec. If this does
208not make much sense, read more about cfb mode of DES :-).
209
210DES_ede3_cfb64_encrypt() and DES_ede2_cfb64_encrypt() is the same as
211DES_cfb64_encrypt() except that Triple-DES is used.
212
213DES_ofb_encrypt() encrypts using output feedback mode. This method
214takes an array of characters as input and outputs and array of
215characters. It does not require any padding to 8 character groups.
216Note: the I<ivec> variable is changed and the new changed value needs to
217be passed to the next call to this function. Since this function runs
218a complete DES ECB encryption per numbits, this function is only
219suggested for use when sending small numbers of characters.
220
221DES_ofb64_encrypt() is the same as DES_cfb64_encrypt() using Output
222Feed Back mode.
223
224DES_ede3_ofb64_encrypt() and DES_ede2_ofb64_encrypt() is the same as
225DES_ofb64_encrypt(), using Triple-DES.
226
227The following functions are included in the DES library for
228compatibility with the MIT Kerberos library.
229
230DES_cbc_cksum() produces an 8 byte checksum based on the input stream
231(via CBC encryption). The last 4 bytes of the checksum are returned
232and the complete 8 bytes are placed in I<output>. This function is
233used by Kerberos v4. Other applications should use
234L<EVP_DigestInit(3)|EVP_DigestInit(3)> etc. instead.
235
236DES_quad_cksum() is a Kerberos v4 function. It returns a 4 byte
237checksum from the input bytes. The algorithm can be iterated over the
238input, depending on I<out_count>, 1, 2, 3 or 4 times. If I<output> is
239non-NULL, the 8 bytes generated by each pass are written into
240I<output>.
241
242The following are DES-based transformations:
243
244DES_fcrypt() is a fast version of the Unix crypt(3) function. This
245version takes only a small amount of space relative to other fast
246crypt() implementations. This is different to the normal crypt in
247that the third parameter is the buffer that the return value is
248written into. It needs to be at least 14 bytes long. This function
249is thread safe, unlike the normal crypt.
250
251DES_crypt() is a faster replacement for the normal system crypt().
252This function calls DES_fcrypt() with a static array passed as the
253third parameter. This emulates the normal non-thread safe semantics
254of crypt(3).
255
256DES_enc_write() writes I<len> bytes to file descriptor I<fd> from
257buffer I<buf>. The data is encrypted via I<pcbc_encrypt> (default)
258using I<sched> for the key and I<iv> as a starting vector. The actual
259data send down I<fd> consists of 4 bytes (in network byte order)
260containing the length of the following encrypted data. The encrypted
261data then follows, padded with random data out to a multiple of 8
262bytes.
263
264DES_enc_read() is used to read I<len> bytes from file descriptor
265I<fd> into buffer I<buf>. The data being read from I<fd> is assumed to
266have come from DES_enc_write() and is decrypted using I<sched> for
267the key schedule and I<iv> for the initial vector.
268
269B<Warning:> The data format used by DES_enc_write() and DES_enc_read()
270has a cryptographic weakness: When asked to write more than MAXWRITE
271bytes, DES_enc_write() will split the data into several chunks that
272are all encrypted using the same IV. So don't use these functions
273unless you are sure you know what you do (in which case you might not
274want to use them anyway). They cannot handle non-blocking sockets.
275DES_enc_read() uses an internal state and thus cannot be used on
276multiple files.
277
278I<DES_rw_mode> is used to specify the encryption mode to use with
279DES_enc_read() and DES_end_write(). If set to I<DES_PCBC_MODE> (the
280default), DES_pcbc_encrypt is used. If set to I<DES_CBC_MODE>
281DES_cbc_encrypt is used.
282
283=head1 NOTES
284
285Single-key DES is insecure due to its short key size. ECB mode is
286not suitable for most applications; see L<des_modes(7)|des_modes(7)>.
287
288The L<evp(3)|evp(3)> library provides higher-level encryption functions.
289
290=head1 BUGS
291
292DES_3cbc_encrypt() is flawed and must not be used in applications.
293
294DES_cbc_encrypt() does not modify B<ivec>; use DES_ncbc_encrypt()
295instead.
296
297DES_cfb_encrypt() and DES_ofb_encrypt() operates on input of 8 bits.
298What this means is that if you set numbits to 12, and length to 2, the
299first 12 bits will come from the 1st input byte and the low half of
300the second input byte. The second 12 bits will have the low 8 bits
301taken from the 3rd input byte and the top 4 bits taken from the 4th
302input byte. The same holds for output. This function has been
303implemented this way because most people will be using a multiple of 8
304and because once you get into pulling bytes input bytes apart things
305get ugly!
306
307DES_string_to_key() is available for backward compatibility with the
308MIT library. New applications should use a cryptographic hash function.
309The same applies for DES_string_to_2key().
310
311=head1 CONFORMING TO
312
313ANSI X3.106
314
315The B<des> library was written to be source code compatible with
316the MIT Kerberos library.
317
318=head1 SEE ALSO
319
320crypt(3), L<des_modes(7)|des_modes(7)>, L<evp(3)|evp(3)>, L<rand(3)|rand(3)>
321
322=head1 HISTORY
323
324In OpenSSL 0.9.7, all des_ functions were renamed to DES_ to avoid
325clashes with older versions of libdes. Compatibility des_ functions
326are provided for a short while, as well as crypt().
327Declarations for these are in <openssl/des_old.h>. There is no DES_
328variant for des_random_seed().
329This will happen to other functions
330as well if they are deemed redundant (des_random_seed() just calls
331RAND_seed() and is present for backward compatibility only), buggy or
332already scheduled for removal.
333
334des_cbc_cksum(), des_cbc_encrypt(), des_ecb_encrypt(),
335des_is_weak_key(), des_key_sched(), des_pcbc_encrypt(),
336des_quad_cksum(), des_random_key() and des_string_to_key()
337are available in the MIT Kerberos library;
338des_check_key_parity(), des_fixup_key_parity() and des_is_weak_key()
339are available in newer versions of that library.
340
341des_set_key_checked() and des_set_key_unchecked() were added in
342OpenSSL 0.9.5.
343
344des_generate_random_block(), des_init_random_number_generator(),
345des_new_random_key(), des_set_random_generator_seed() and
346des_set_sequence_number() and des_rand_data() are used in newer
347versions of Kerberos but are not implemented here.
348
349des_random_key() generated cryptographically weak random data in
350SSLeay and in OpenSSL prior version 0.9.5, as well as in the original
351MIT library.
352
353=head1 AUTHOR
354
355Eric Young (eay@cryptsoft.com). Modified for the OpenSSL project
356(http://www.openssl.org).
357
358=cut
diff --git a/src/lib/libssl/src/doc/crypto/ERR.pod b/src/lib/libssl/src/doc/crypto/ERR.pod
new file mode 100644
index 0000000000..6f729554d2
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/ERR.pod
@@ -0,0 +1,187 @@
1=pod
2
3=head1 NAME
4
5err - error codes
6
7=head1 SYNOPSIS
8
9 #include <openssl/err.h>
10
11 unsigned long ERR_get_error(void);
12 unsigned long ERR_peek_error(void);
13 unsigned long ERR_get_error_line(const char **file, int *line);
14 unsigned long ERR_peek_error_line(const char **file, int *line);
15 unsigned long ERR_get_error_line_data(const char **file, int *line,
16 const char **data, int *flags);
17 unsigned long ERR_peek_error_line_data(const char **file, int *line,
18 const char **data, int *flags);
19
20 int ERR_GET_LIB(unsigned long e);
21 int ERR_GET_FUNC(unsigned long e);
22 int ERR_GET_REASON(unsigned long e);
23
24 void ERR_clear_error(void);
25
26 char *ERR_error_string(unsigned long e, char *buf);
27 const char *ERR_lib_error_string(unsigned long e);
28 const char *ERR_func_error_string(unsigned long e);
29 const char *ERR_reason_error_string(unsigned long e);
30
31 void ERR_print_errors(BIO *bp);
32 void ERR_print_errors_fp(FILE *fp);
33
34 void ERR_load_crypto_strings(void);
35 void ERR_free_strings(void);
36
37 void ERR_remove_state(unsigned long pid);
38
39 void ERR_put_error(int lib, int func, int reason, const char *file,
40 int line);
41 void ERR_add_error_data(int num, ...);
42
43 void ERR_load_strings(int lib,ERR_STRING_DATA str[]);
44 unsigned long ERR_PACK(int lib, int func, int reason);
45 int ERR_get_next_error_library(void);
46
47=head1 DESCRIPTION
48
49When a call to the OpenSSL library fails, this is usually signalled
50by the return value, and an error code is stored in an error queue
51associated with the current thread. The B<err> library provides
52functions to obtain these error codes and textual error messages.
53
54The L<ERR_get_error(3)|ERR_get_error(3)> manpage describes how to
55access error codes.
56
57Error codes contain information about where the error occurred, and
58what went wrong. L<ERR_GET_LIB(3)|ERR_GET_LIB(3)> describes how to
59extract this information. A method to obtain human-readable error
60messages is described in L<ERR_error_string(3)|ERR_error_string(3)>.
61
62L<ERR_clear_error(3)|ERR_clear_error(3)> can be used to clear the
63error queue.
64
65Note that L<ERR_remove_state(3)|ERR_remove_state(3)> should be used to
66avoid memory leaks when threads are terminated.
67
68=head1 ADDING NEW ERROR CODES TO OPENSSL
69
70See L<ERR_put_error(3)> if you want to record error codes in the
71OpenSSL error system from within your application.
72
73The remainder of this section is of interest only if you want to add
74new error codes to OpenSSL or add error codes from external libraries.
75
76=head2 Reporting errors
77
78Each sub-library has a specific macro XXXerr() that is used to report
79errors. Its first argument is a function code B<XXX_F_...>, the second
80argument is a reason code B<XXX_R_...>. Function codes are derived
81from the function names; reason codes consist of textual error
82descriptions. For example, the function ssl23_read() reports a
83"handshake failure" as follows:
84
85 SSLerr(SSL_F_SSL23_READ, SSL_R_SSL_HANDSHAKE_FAILURE);
86
87Function and reason codes should consist of upper case characters,
88numbers and underscores only. The error file generation script translates
89function codes into function names by looking in the header files
90for an appropriate function name, if none is found it just uses
91the capitalized form such as "SSL23_READ" in the above example.
92
93The trailing section of a reason code (after the "_R_") is translated
94into lower case and underscores changed to spaces.
95
96When you are using new function or reason codes, run B<make errors>.
97The necessary B<#define>s will then automatically be added to the
98sub-library's header file.
99
100Although a library will normally report errors using its own specific
101XXXerr macro, another library's macro can be used. This is normally
102only done when a library wants to include ASN1 code which must use
103the ASN1err() macro.
104
105=head2 Adding new libraries
106
107When adding a new sub-library to OpenSSL, assign it a library number
108B<ERR_LIB_XXX>, define a macro XXXerr() (both in B<err.h>), add its
109name to B<ERR_str_libraries[]> (in B<crypto/err/err.c>), and add
110C<ERR_load_XXX_strings()> to the ERR_load_crypto_strings() function
111(in B<crypto/err/err_all.c>). Finally, add an entry
112
113 L XXX xxx.h xxx_err.c
114
115to B<crypto/err/openssl.ec>, and add B<xxx_err.c> to the Makefile.
116Running B<make errors> will then generate a file B<xxx_err.c>, and
117add all error codes used in the library to B<xxx.h>.
118
119Additionally the library include file must have a certain form.
120Typically it will initially look like this:
121
122 #ifndef HEADER_XXX_H
123 #define HEADER_XXX_H
124
125 #ifdef __cplusplus
126 extern "C" {
127 #endif
128
129 /* Include files */
130
131 #include <openssl/bio.h>
132 #include <openssl/x509.h>
133
134 /* Macros, structures and function prototypes */
135
136
137 /* BEGIN ERROR CODES */
138
139The B<BEGIN ERROR CODES> sequence is used by the error code
140generation script as the point to place new error codes, any text
141after this point will be overwritten when B<make errors> is run.
142The closing #endif etc will be automatically added by the script.
143
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
146header file must load any additional header files containing any
147definitions it uses.
148
149=head1 USING ERROR CODES IN EXTERNAL LIBRARIES
150
151It is also possible to use OpenSSL's error code scheme in external
152libraries. The library needs to load its own codes and call the OpenSSL
153error code insertion script B<mkerr.pl> explicitly to add codes to
154the header file and generate the C error code file. This will normally
155be done if the external library needs to generate new ASN1 structures
156but it can also be used to add more general purpose error code handling.
157
158TBA more details
159
160=head1 INTERNALS
161
162The error queues are stored in a hash table with one B<ERR_STATE>
163entry for each pid. ERR_get_state() returns the current thread's
164B<ERR_STATE>. An B<ERR_STATE> can hold up to B<ERR_NUM_ERRORS> error
165codes. When more error codes are added, the old ones are overwritten,
166on the assumption that the most recent errors are most important.
167
168Error strings are also stored in hash table. The hash tables can
169be obtained by calling ERR_get_err_state_table(void) and
170ERR_get_string_table(void) respectively.
171
172=head1 SEE ALSO
173
174L<CRYPTO_set_id_callback(3)|CRYPTO_set_id_callback(3)>,
175L<CRYPTO_set_locking_callback(3)|CRYPTO_set_locking_callback(3)>,
176L<ERR_get_error(3)|ERR_get_error(3)>,
177L<ERR_GET_LIB(3)|ERR_GET_LIB(3)>,
178L<ERR_clear_error(3)|ERR_clear_error(3)>,
179L<ERR_error_string(3)|ERR_error_string(3)>,
180L<ERR_print_errors(3)|ERR_print_errors(3)>,
181L<ERR_load_crypto_strings(3)|ERR_load_crypto_strings(3)>,
182L<ERR_remove_state(3)|ERR_remove_state(3)>,
183L<ERR_put_error(3)|ERR_put_error(3)>,
184L<ERR_load_strings(3)|ERR_load_strings(3)>,
185L<SSL_get_error(3)|SSL_get_error(3)>
186
187=cut
diff --git a/src/lib/libssl/src/doc/crypto/HMAC.pod b/src/lib/libssl/src/doc/crypto/HMAC.pod
new file mode 100644
index 0000000000..d92138d273
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/HMAC.pod
@@ -0,0 +1,106 @@
1=pod
2
3=head1 NAME
4
5HMAC, HMAC_Init, HMAC_Update, HMAC_Final, HMAC_cleanup - HMAC message
6authentication code
7
8=head1 SYNOPSIS
9
10 #include <openssl/hmac.h>
11
12 unsigned char *HMAC(const EVP_MD *evp_md, const void *key,
13 int key_len, const unsigned char *d, int n,
14 unsigned char *md, unsigned int *md_len);
15
16 void HMAC_CTX_init(HMAC_CTX *ctx);
17
18 int HMAC_Init(HMAC_CTX *ctx, const void *key, int key_len,
19 const EVP_MD *md);
20 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int key_len,
21 const EVP_MD *md, ENGINE *impl);
22 int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, int len);
23 int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
24
25 void HMAC_CTX_cleanup(HMAC_CTX *ctx);
26 void HMAC_cleanup(HMAC_CTX *ctx);
27
28=head1 DESCRIPTION
29
30HMAC is a MAC (message authentication code), i.e. a keyed hash
31function used for message authentication, which is based on a hash
32function.
33
34HMAC() computes the message authentication code of the B<n> bytes at
35B<d> using the hash function B<evp_md> and the key B<key> which is
36B<key_len> bytes long.
37
38It places the result in B<md> (which must have space for the output of
39the hash function, which is no more than B<EVP_MAX_MD_SIZE> bytes).
40If B<md> is NULL, the digest is placed in a static array. The size of
41the output is placed in B<md_len>, unless it is B<NULL>.
42
43B<evp_md> can be EVP_sha1(), EVP_ripemd160() etc.
44
45HMAC_CTX_init() initialises a B<HMAC_CTX> before first use. It must be
46called.
47
48HMAC_CTX_cleanup() erases the key and other data from the B<HMAC_CTX>
49and releases any associated resources. It must be called when an
50B<HMAC_CTX> is no longer required.
51
52HMAC_cleanup() is an alias for HMAC_CTX_cleanup() included for back
53compatibility with 0.9.6b, it is deprecated.
54
55The following functions may be used if the message is not completely
56stored in memory:
57
58HMAC_Init() initializes a B<HMAC_CTX> structure to use the hash
59function B<evp_md> and the key B<key> which is B<key_len> bytes
60long. It is deprecated and only included for backward compatibility
61with OpenSSL 0.9.6b.
62
63HMAC_Init_ex() initializes or reuses a B<HMAC_CTX> structure to use
64the function B<evp_md> and key B<key>. Either can be NULL, in which
65case the existing one will be reused. HMAC_CTX_init() must have been
66called before the first use of an B<HMAC_CTX> in this
67function. B<N.B. HMAC_Init() had this undocumented behaviour in
68previous versions of OpenSSL - failure to switch to HMAC_Init_ex() in
69programs that expect it will cause them to stop working>.
70
71HMAC_Update() can be called repeatedly with chunks of the message to
72be authenticated (B<len> bytes at B<data>).
73
74HMAC_Final() places the message authentication code in B<md>, which
75must have space for the hash function output.
76
77=head1 RETURN VALUES
78
79HMAC() returns a pointer to the message authentication code or NULL if
80an error occurred.
81
82HMAC_Init_ex(), HMAC_Update() and HMAC_Final() return 1 for success or 0 if
83an error occurred.
84
85HMAC_CTX_init() and HMAC_CTX_cleanup() do not return values.
86
87=head1 CONFORMING TO
88
89RFC 2104
90
91=head1 SEE ALSO
92
93L<sha(3)|sha(3)>, L<evp(3)|evp(3)>
94
95=head1 HISTORY
96
97HMAC(), HMAC_Init(), HMAC_Update(), HMAC_Final() and HMAC_cleanup()
98are available since SSLeay 0.9.0.
99
100HMAC_CTX_init(), HMAC_Init_ex() and HMAC_CTX_cleanup() are available
101since OpenSSL 0.9.7.
102
103HMAC_Init_ex(), HMAC_Update() and HMAC_Final() did not return values in
104versions of OpenSSL before 1.0.0.
105
106=cut
diff --git a/src/lib/libssl/src/doc/crypto/MD5.pod b/src/lib/libssl/src/doc/crypto/MD5.pod
new file mode 100644
index 0000000000..d11d5c32cb
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/MD5.pod
@@ -0,0 +1,101 @@
1=pod
2
3=head1 NAME
4
5MD2, MD4, MD5, MD2_Init, MD2_Update, MD2_Final, MD4_Init, MD4_Update,
6MD4_Final, MD5_Init, MD5_Update, MD5_Final - MD2, MD4, and MD5 hash functions
7
8=head1 SYNOPSIS
9
10 #include <openssl/md2.h>
11
12 unsigned char *MD2(const unsigned char *d, unsigned long n,
13 unsigned char *md);
14
15 int MD2_Init(MD2_CTX *c);
16 int MD2_Update(MD2_CTX *c, const unsigned char *data,
17 unsigned long len);
18 int MD2_Final(unsigned char *md, MD2_CTX *c);
19
20
21 #include <openssl/md4.h>
22
23 unsigned char *MD4(const unsigned char *d, unsigned long n,
24 unsigned char *md);
25
26 int MD4_Init(MD4_CTX *c);
27 int MD4_Update(MD4_CTX *c, const void *data,
28 unsigned long len);
29 int MD4_Final(unsigned char *md, MD4_CTX *c);
30
31
32 #include <openssl/md5.h>
33
34 unsigned char *MD5(const unsigned char *d, unsigned long n,
35 unsigned char *md);
36
37 int MD5_Init(MD5_CTX *c);
38 int MD5_Update(MD5_CTX *c, const void *data,
39 unsigned long len);
40 int MD5_Final(unsigned char *md, MD5_CTX *c);
41
42=head1 DESCRIPTION
43
44MD2, MD4, and MD5 are cryptographic hash functions with a 128 bit output.
45
46MD2(), MD4(), and MD5() compute the MD2, MD4, and MD5 message digest
47of the B<n> bytes at B<d> and place it in B<md> (which must have space
48for MD2_DIGEST_LENGTH == MD4_DIGEST_LENGTH == MD5_DIGEST_LENGTH == 16
49bytes of output). If B<md> is NULL, the digest is placed in a static
50array.
51
52The following functions may be used if the message is not completely
53stored in memory:
54
55MD2_Init() initializes a B<MD2_CTX> structure.
56
57MD2_Update() can be called repeatedly with chunks of the message to
58be hashed (B<len> bytes at B<data>).
59
60MD2_Final() places the message digest in B<md>, which must have space
61for MD2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MD2_CTX>.
62
63MD4_Init(), MD4_Update(), MD4_Final(), MD5_Init(), MD5_Update(), and
64MD5_Final() are analogous using an B<MD4_CTX> and B<MD5_CTX> structure.
65
66Applications should use the higher level functions
67L<EVP_DigestInit(3)|EVP_DigestInit(3)>
68etc. instead of calling the hash functions directly.
69
70=head1 NOTE
71
72MD2, MD4, and MD5 are recommended only for compatibility with existing
73applications. In new applications, SHA-1 or RIPEMD-160 should be
74preferred.
75
76=head1 RETURN VALUES
77
78MD2(), MD4(), and MD5() return pointers to the hash value.
79
80MD2_Init(), MD2_Update(), MD2_Final(), MD4_Init(), MD4_Update(),
81MD4_Final(), MD5_Init(), MD5_Update(), and MD5_Final() return 1 for
82success, 0 otherwise.
83
84=head1 CONFORMING TO
85
86RFC 1319, RFC 1320, RFC 1321
87
88=head1 SEE ALSO
89
90L<sha(3)|sha(3)>, L<ripemd(3)|ripemd(3)>, L<EVP_DigestInit(3)|EVP_DigestInit(3)>
91
92=head1 HISTORY
93
94MD2(), MD2_Init(), MD2_Update() MD2_Final(), MD5(), MD5_Init(),
95MD5_Update() and MD5_Final() are available in all versions of SSLeay
96and OpenSSL.
97
98MD4(), MD4_Init(), and MD4_Update() are available in OpenSSL 0.9.6 and
99above.
100
101=cut
diff --git a/src/lib/libssl/src/doc/crypto/PEM_read_bio_PrivateKey.pod b/src/lib/libssl/src/doc/crypto/PEM_read_bio_PrivateKey.pod
new file mode 100644
index 0000000000..54414a3f6f
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/PEM_read_bio_PrivateKey.pod
@@ -0,0 +1,476 @@
1=pod
2
3=head1 NAME
4
5PEM, PEM_read_bio_PrivateKey, PEM_read_PrivateKey, PEM_write_bio_PrivateKey, PEM_write_PrivateKey, PEM_write_bio_PKCS8PrivateKey, PEM_write_PKCS8PrivateKey, PEM_write_bio_PKCS8PrivateKey_nid, PEM_write_PKCS8PrivateKey_nid, PEM_read_bio_PUBKEY, PEM_read_PUBKEY, PEM_write_bio_PUBKEY, PEM_write_PUBKEY, PEM_read_bio_RSAPrivateKey, PEM_read_RSAPrivateKey, PEM_write_bio_RSAPrivateKey, PEM_write_RSAPrivateKey, PEM_read_bio_RSAPublicKey, PEM_read_RSAPublicKey, PEM_write_bio_RSAPublicKey, PEM_write_RSAPublicKey, PEM_read_bio_RSA_PUBKEY, PEM_read_RSA_PUBKEY, PEM_write_bio_RSA_PUBKEY, PEM_write_RSA_PUBKEY, PEM_read_bio_DSAPrivateKey, PEM_read_DSAPrivateKey, PEM_write_bio_DSAPrivateKey, PEM_write_DSAPrivateKey, PEM_read_bio_DSA_PUBKEY, PEM_read_DSA_PUBKEY, PEM_write_bio_DSA_PUBKEY, PEM_write_DSA_PUBKEY, PEM_read_bio_DSAparams, PEM_read_DSAparams, PEM_write_bio_DSAparams, PEM_write_DSAparams, PEM_read_bio_DHparams, PEM_read_DHparams, PEM_write_bio_DHparams, PEM_write_DHparams, PEM_read_bio_X509, PEM_read_X509, PEM_write_bio_X509, PEM_write_X509, PEM_read_bio_X509_AUX, PEM_read_X509_AUX, PEM_write_bio_X509_AUX, PEM_write_X509_AUX, PEM_read_bio_X509_REQ, PEM_read_X509_REQ, PEM_write_bio_X509_REQ, PEM_write_X509_REQ, PEM_write_bio_X509_REQ_NEW, PEM_write_X509_REQ_NEW, PEM_read_bio_X509_CRL, PEM_read_X509_CRL, PEM_write_bio_X509_CRL, PEM_write_X509_CRL, PEM_read_bio_PKCS7, PEM_read_PKCS7, PEM_write_bio_PKCS7, PEM_write_PKCS7, PEM_read_bio_NETSCAPE_CERT_SEQUENCE, PEM_read_NETSCAPE_CERT_SEQUENCE, PEM_write_bio_NETSCAPE_CERT_SEQUENCE, PEM_write_NETSCAPE_CERT_SEQUENCE - PEM routines
6
7=head1 SYNOPSIS
8
9 #include <openssl/pem.h>
10
11 EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x,
12 pem_password_cb *cb, void *u);
13
14 EVP_PKEY *PEM_read_PrivateKey(FILE *fp, EVP_PKEY **x,
15 pem_password_cb *cb, void *u);
16
17 int PEM_write_bio_PrivateKey(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc,
18 unsigned char *kstr, int klen,
19 pem_password_cb *cb, void *u);
20
21 int PEM_write_PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
22 unsigned char *kstr, int klen,
23 pem_password_cb *cb, void *u);
24
25 int PEM_write_bio_PKCS8PrivateKey(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc,
26 char *kstr, int klen,
27 pem_password_cb *cb, void *u);
28
29 int PEM_write_PKCS8PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
30 char *kstr, int klen,
31 pem_password_cb *cb, void *u);
32
33 int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid,
34 char *kstr, int klen,
35 pem_password_cb *cb, void *u);
36
37 int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid,
38 char *kstr, int klen,
39 pem_password_cb *cb, void *u);
40
41 EVP_PKEY *PEM_read_bio_PUBKEY(BIO *bp, EVP_PKEY **x,
42 pem_password_cb *cb, void *u);
43
44 EVP_PKEY *PEM_read_PUBKEY(FILE *fp, EVP_PKEY **x,
45 pem_password_cb *cb, void *u);
46
47 int PEM_write_bio_PUBKEY(BIO *bp, EVP_PKEY *x);
48 int PEM_write_PUBKEY(FILE *fp, EVP_PKEY *x);
49
50 RSA *PEM_read_bio_RSAPrivateKey(BIO *bp, RSA **x,
51 pem_password_cb *cb, void *u);
52
53 RSA *PEM_read_RSAPrivateKey(FILE *fp, RSA **x,
54 pem_password_cb *cb, void *u);
55
56 int PEM_write_bio_RSAPrivateKey(BIO *bp, RSA *x, const EVP_CIPHER *enc,
57 unsigned char *kstr, int klen,
58 pem_password_cb *cb, void *u);
59
60 int PEM_write_RSAPrivateKey(FILE *fp, RSA *x, const EVP_CIPHER *enc,
61 unsigned char *kstr, int klen,
62 pem_password_cb *cb, void *u);
63
64 RSA *PEM_read_bio_RSAPublicKey(BIO *bp, RSA **x,
65 pem_password_cb *cb, void *u);
66
67 RSA *PEM_read_RSAPublicKey(FILE *fp, RSA **x,
68 pem_password_cb *cb, void *u);
69
70 int PEM_write_bio_RSAPublicKey(BIO *bp, RSA *x);
71
72 int PEM_write_RSAPublicKey(FILE *fp, RSA *x);
73
74 RSA *PEM_read_bio_RSA_PUBKEY(BIO *bp, RSA **x,
75 pem_password_cb *cb, void *u);
76
77 RSA *PEM_read_RSA_PUBKEY(FILE *fp, RSA **x,
78 pem_password_cb *cb, void *u);
79
80 int PEM_write_bio_RSA_PUBKEY(BIO *bp, RSA *x);
81
82 int PEM_write_RSA_PUBKEY(FILE *fp, RSA *x);
83
84 DSA *PEM_read_bio_DSAPrivateKey(BIO *bp, DSA **x,
85 pem_password_cb *cb, void *u);
86
87 DSA *PEM_read_DSAPrivateKey(FILE *fp, DSA **x,
88 pem_password_cb *cb, void *u);
89
90 int PEM_write_bio_DSAPrivateKey(BIO *bp, DSA *x, const EVP_CIPHER *enc,
91 unsigned char *kstr, int klen,
92 pem_password_cb *cb, void *u);
93
94 int PEM_write_DSAPrivateKey(FILE *fp, DSA *x, const EVP_CIPHER *enc,
95 unsigned char *kstr, int klen,
96 pem_password_cb *cb, void *u);
97
98 DSA *PEM_read_bio_DSA_PUBKEY(BIO *bp, DSA **x,
99 pem_password_cb *cb, void *u);
100
101 DSA *PEM_read_DSA_PUBKEY(FILE *fp, DSA **x,
102 pem_password_cb *cb, void *u);
103
104 int PEM_write_bio_DSA_PUBKEY(BIO *bp, DSA *x);
105
106 int PEM_write_DSA_PUBKEY(FILE *fp, DSA *x);
107
108 DSA *PEM_read_bio_DSAparams(BIO *bp, DSA **x, pem_password_cb *cb, void *u);
109
110 DSA *PEM_read_DSAparams(FILE *fp, DSA **x, pem_password_cb *cb, void *u);
111
112 int PEM_write_bio_DSAparams(BIO *bp, DSA *x);
113
114 int PEM_write_DSAparams(FILE *fp, DSA *x);
115
116 DH *PEM_read_bio_DHparams(BIO *bp, DH **x, pem_password_cb *cb, void *u);
117
118 DH *PEM_read_DHparams(FILE *fp, DH **x, pem_password_cb *cb, void *u);
119
120 int PEM_write_bio_DHparams(BIO *bp, DH *x);
121
122 int PEM_write_DHparams(FILE *fp, DH *x);
123
124 X509 *PEM_read_bio_X509(BIO *bp, X509 **x, pem_password_cb *cb, void *u);
125
126 X509 *PEM_read_X509(FILE *fp, X509 **x, pem_password_cb *cb, void *u);
127
128 int PEM_write_bio_X509(BIO *bp, X509 *x);
129
130 int PEM_write_X509(FILE *fp, X509 *x);
131
132 X509 *PEM_read_bio_X509_AUX(BIO *bp, X509 **x, pem_password_cb *cb, void *u);
133
134 X509 *PEM_read_X509_AUX(FILE *fp, X509 **x, pem_password_cb *cb, void *u);
135
136 int PEM_write_bio_X509_AUX(BIO *bp, X509 *x);
137
138 int PEM_write_X509_AUX(FILE *fp, X509 *x);
139
140 X509_REQ *PEM_read_bio_X509_REQ(BIO *bp, X509_REQ **x,
141 pem_password_cb *cb, void *u);
142
143 X509_REQ *PEM_read_X509_REQ(FILE *fp, X509_REQ **x,
144 pem_password_cb *cb, void *u);
145
146 int PEM_write_bio_X509_REQ(BIO *bp, X509_REQ *x);
147
148 int PEM_write_X509_REQ(FILE *fp, X509_REQ *x);
149
150 int PEM_write_bio_X509_REQ_NEW(BIO *bp, X509_REQ *x);
151
152 int PEM_write_X509_REQ_NEW(FILE *fp, X509_REQ *x);
153
154 X509_CRL *PEM_read_bio_X509_CRL(BIO *bp, X509_CRL **x,
155 pem_password_cb *cb, void *u);
156 X509_CRL *PEM_read_X509_CRL(FILE *fp, X509_CRL **x,
157 pem_password_cb *cb, void *u);
158 int PEM_write_bio_X509_CRL(BIO *bp, X509_CRL *x);
159 int PEM_write_X509_CRL(FILE *fp, X509_CRL *x);
160
161 PKCS7 *PEM_read_bio_PKCS7(BIO *bp, PKCS7 **x, pem_password_cb *cb, void *u);
162
163 PKCS7 *PEM_read_PKCS7(FILE *fp, PKCS7 **x, pem_password_cb *cb, void *u);
164
165 int PEM_write_bio_PKCS7(BIO *bp, PKCS7 *x);
166
167 int PEM_write_PKCS7(FILE *fp, PKCS7 *x);
168
169 NETSCAPE_CERT_SEQUENCE *PEM_read_bio_NETSCAPE_CERT_SEQUENCE(BIO *bp,
170 NETSCAPE_CERT_SEQUENCE **x,
171 pem_password_cb *cb, void *u);
172
173 NETSCAPE_CERT_SEQUENCE *PEM_read_NETSCAPE_CERT_SEQUENCE(FILE *fp,
174 NETSCAPE_CERT_SEQUENCE **x,
175 pem_password_cb *cb, void *u);
176
177 int PEM_write_bio_NETSCAPE_CERT_SEQUENCE(BIO *bp, NETSCAPE_CERT_SEQUENCE *x);
178
179 int PEM_write_NETSCAPE_CERT_SEQUENCE(FILE *fp, NETSCAPE_CERT_SEQUENCE *x);
180
181=head1 DESCRIPTION
182
183The PEM functions read or write structures in PEM format. In
184this sense PEM format is simply base64 encoded data surrounded
185by header lines.
186
187For more details about the meaning of arguments see the
188B<PEM FUNCTION ARGUMENTS> section.
189
190Each operation has four functions associated with it. For
191clarity the term "B<foobar> functions" will be used to collectively
192refer to the PEM_read_bio_foobar(), PEM_read_foobar(),
193PEM_write_bio_foobar() and PEM_write_foobar() functions.
194
195The B<PrivateKey> functions read or write a private key in
196PEM format using an EVP_PKEY structure. The write routines use
197"traditional" private key format and can handle both RSA and DSA
198private keys. The read functions can additionally transparently
199handle PKCS#8 format encrypted and unencrypted keys too.
200
201PEM_write_bio_PKCS8PrivateKey() and PEM_write_PKCS8PrivateKey()
202write a private key in an EVP_PKEY structure in PKCS#8
203EncryptedPrivateKeyInfo format using PKCS#5 v2.0 password based encryption
204algorithms. The B<cipher> argument specifies the encryption algorithm to
205use: unlike all other PEM routines the encryption is applied at the
206PKCS#8 level and not in the PEM headers. If B<cipher> is NULL then no
207encryption is used and a PKCS#8 PrivateKeyInfo structure is used instead.
208
209PEM_write_bio_PKCS8PrivateKey_nid() and PEM_write_PKCS8PrivateKey_nid()
210also write out a private key as a PKCS#8 EncryptedPrivateKeyInfo however
211it uses PKCS#5 v1.5 or PKCS#12 encryption algorithms instead. The algorithm
212to use is specified in the B<nid> parameter and should be the NID of the
213corresponding OBJECT IDENTIFIER (see NOTES section).
214
215The B<PUBKEY> functions process a public key using an EVP_PKEY
216structure. The public key is encoded as a SubjectPublicKeyInfo
217structure.
218
219The B<RSAPrivateKey> functions process an RSA private key using an
220RSA structure. It handles the same formats as the B<PrivateKey>
221functions but an error occurs if the private key is not RSA.
222
223The B<RSAPublicKey> functions process an RSA public key using an
224RSA structure. The public key is encoded using a PKCS#1 RSAPublicKey
225structure.
226
227The B<RSA_PUBKEY> functions also process an RSA public key using
228an RSA structure. However the public key is encoded using a
229SubjectPublicKeyInfo structure and an error occurs if the public
230key is not RSA.
231
232The B<DSAPrivateKey> functions process a DSA private key using a
233DSA structure. It handles the same formats as the B<PrivateKey>
234functions but an error occurs if the private key is not DSA.
235
236The B<DSA_PUBKEY> functions process a DSA public key using
237a DSA structure. The public key is encoded using a
238SubjectPublicKeyInfo structure and an error occurs if the public
239key is not DSA.
240
241The B<DSAparams> functions process DSA parameters using a DSA
242structure. The parameters are encoded using a foobar structure.
243
244The B<DHparams> functions process DH parameters using a DH
245structure. The parameters are encoded using a PKCS#3 DHparameter
246structure.
247
248The B<X509> functions process an X509 certificate using an X509
249structure. They will also process a trusted X509 certificate but
250any trust settings are discarded.
251
252The B<X509_AUX> functions process a trusted X509 certificate using
253an X509 structure.
254
255The B<X509_REQ> and B<X509_REQ_NEW> functions process a PKCS#10
256certificate request using an X509_REQ structure. The B<X509_REQ>
257write functions use B<CERTIFICATE REQUEST> in the header whereas
258the B<X509_REQ_NEW> functions use B<NEW CERTIFICATE REQUEST>
259(as required by some CAs). The B<X509_REQ> read functions will
260handle either form so there are no B<X509_REQ_NEW> read functions.
261
262The B<X509_CRL> functions process an X509 CRL using an X509_CRL
263structure.
264
265The B<PKCS7> functions process a PKCS#7 ContentInfo using a PKCS7
266structure.
267
268The B<NETSCAPE_CERT_SEQUENCE> functions process a Netscape Certificate
269Sequence using a NETSCAPE_CERT_SEQUENCE structure.
270
271=head1 PEM FUNCTION ARGUMENTS
272
273The PEM functions have many common arguments.
274
275The B<bp> BIO parameter (if present) specifies the BIO to read from
276or write to.
277
278The B<fp> FILE parameter (if present) specifies the FILE pointer to
279read from or write to.
280
281The PEM read functions all take an argument B<TYPE **x> and return
282a B<TYPE *> pointer. Where B<TYPE> is whatever structure the function
283uses. If B<x> is NULL then the parameter is ignored. If B<x> is not
284NULL but B<*x> is NULL then the structure returned will be written
285to B<*x>. If neither B<x> nor B<*x> is NULL then an attempt is made
286to reuse the structure at B<*x> (but see BUGS and EXAMPLES sections).
287Irrespective of the value of B<x> a pointer to the structure is always
288returned (or NULL if an error occurred).
289
290The PEM functions which write private keys take an B<enc> parameter
291which specifies the encryption algorithm to use, encryption is done
292at the PEM level. If this parameter is set to NULL then the private
293key is written in unencrypted form.
294
295The B<cb> argument is the callback to use when querying for the pass
296phrase used for encrypted PEM structures (normally only private keys).
297
298For the PEM write routines if the B<kstr> parameter is not NULL then
299B<klen> bytes at B<kstr> are used as the passphrase and B<cb> is
300ignored.
301
302If the B<cb> parameters is set to NULL and the B<u> parameter is not
303NULL then the B<u> parameter is interpreted as a null terminated string
304to use as the passphrase. If both B<cb> and B<u> are NULL then the
305default callback routine is used which will typically prompt for the
306passphrase on the current terminal with echoing turned off.
307
308The default passphrase callback is sometimes inappropriate (for example
309in a GUI application) so an alternative can be supplied. The callback
310routine has the following form:
311
312 int cb(char *buf, int size, int rwflag, void *u);
313
314B<buf> is the buffer to write the passphrase to. B<size> is the maximum
315length of the passphrase (i.e. the size of buf). B<rwflag> is a flag
316which is set to 0 when reading and 1 when writing. A typical routine
317will ask the user to verify the passphrase (for example by prompting
318for it twice) if B<rwflag> is 1. The B<u> parameter has the same
319value as the B<u> parameter passed to the PEM routine. It allows
320arbitrary data to be passed to the callback by the application
321(for example a window handle in a GUI application). The callback
322B<must> return the number of characters in the passphrase or 0 if
323an error occurred.
324
325=head1 EXAMPLES
326
327Although the PEM routines take several arguments in almost all applications
328most of them are set to 0 or NULL.
329
330Read a certificate in PEM format from a BIO:
331
332 X509 *x;
333 x = PEM_read_bio_X509(bp, NULL, 0, NULL);
334 if (x == NULL)
335 {
336 /* Error */
337 }
338
339Alternative method:
340
341 X509 *x = NULL;
342 if (!PEM_read_bio_X509(bp, &x, 0, NULL))
343 {
344 /* Error */
345 }
346
347Write a certificate to a BIO:
348
349 if (!PEM_write_bio_X509(bp, x))
350 {
351 /* Error */
352 }
353
354Write an unencrypted private key to a FILE pointer:
355
356 if (!PEM_write_PrivateKey(fp, key, NULL, NULL, 0, 0, NULL))
357 {
358 /* Error */
359 }
360
361Write a private key (using traditional format) to a BIO using
362triple DES encryption, the pass phrase is prompted for:
363
364 if (!PEM_write_bio_PrivateKey(bp, key, EVP_des_ede3_cbc(), NULL, 0, 0, NULL))
365 {
366 /* Error */
367 }
368
369Write a private key (using PKCS#8 format) to a BIO using triple
370DES encryption, using the pass phrase "hello":
371
372 if (!PEM_write_bio_PKCS8PrivateKey(bp, key, EVP_des_ede3_cbc(), NULL, 0, 0, "hello"))
373 {
374 /* Error */
375 }
376
377Read a private key from a BIO using the pass phrase "hello":
378
379 key = PEM_read_bio_PrivateKey(bp, NULL, 0, "hello");
380 if (key == NULL)
381 {
382 /* Error */
383 }
384
385Read a private key from a BIO using a pass phrase callback:
386
387 key = PEM_read_bio_PrivateKey(bp, NULL, pass_cb, "My Private Key");
388 if (key == NULL)
389 {
390 /* Error */
391 }
392
393Skeleton pass phrase callback:
394
395 int pass_cb(char *buf, int size, int rwflag, void *u);
396 {
397 int len;
398 char *tmp;
399 /* We'd probably do something else if 'rwflag' is 1 */
400 printf("Enter pass phrase for \"%s\"\n", u);
401
402 /* get pass phrase, length 'len' into 'tmp' */
403 tmp = "hello";
404 len = strlen(tmp);
405
406 if (len <= 0) return 0;
407 /* if too long, truncate */
408 if (len > size) len = size;
409 memcpy(buf, tmp, len);
410 return len;
411 }
412
413=head1 NOTES
414
415The old B<PrivateKey> write routines are retained for compatibility.
416New applications should write private keys using the
417PEM_write_bio_PKCS8PrivateKey() or PEM_write_PKCS8PrivateKey() routines
418because they are more secure (they use an iteration count of 2048 whereas
419the traditional routines use a count of 1) unless compatibility with older
420versions of OpenSSL is important.
421
422The B<PrivateKey> read routines can be used in all applications because
423they handle all formats transparently.
424
425A frequent cause of problems is attempting to use the PEM routines like
426this:
427
428 X509 *x;
429 PEM_read_bio_X509(bp, &x, 0, NULL);
430
431this is a bug because an attempt will be made to reuse the data at B<x>
432which is an uninitialised pointer.
433
434=head1 PEM ENCRYPTION FORMAT
435
436This old B<PrivateKey> routines use a non standard technique for encryption.
437
438The private key (or other data) takes the following form:
439
440 -----BEGIN RSA PRIVATE KEY-----
441 Proc-Type: 4,ENCRYPTED
442 DEK-Info: DES-EDE3-CBC,3F17F5316E2BAC89
443
444 ...base64 encoded data...
445 -----END RSA PRIVATE KEY-----
446
447The line beginning DEK-Info contains two comma separated pieces of information:
448the encryption algorithm name as used by EVP_get_cipherbyname() and an 8
449byte B<salt> encoded as a set of hexadecimal digits.
450
451After this is the base64 encoded encrypted data.
452
453The encryption key is determined using EVP_bytestokey(), using B<salt> and an
454iteration count of 1. The IV used is the value of B<salt> and *not* the IV
455returned by EVP_bytestokey().
456
457=head1 BUGS
458
459The PEM read routines in some versions of OpenSSL will not correctly reuse
460an existing structure. Therefore the following:
461
462 PEM_read_bio_X509(bp, &x, 0, NULL);
463
464where B<x> already contains a valid certificate, may not work, whereas:
465
466 X509_free(x);
467 x = PEM_read_bio_X509(bp, NULL, 0, NULL);
468
469is guaranteed to work.
470
471=head1 RETURN CODES
472
473The read routines return either a pointer to the structure read or NULL
474if an error occurred.
475
476The write routines return 1 for success or 0 for failure.
diff --git a/src/lib/libssl/src/doc/crypto/RAND.pod b/src/lib/libssl/src/doc/crypto/RAND.pod
new file mode 100644
index 0000000000..e987414477
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/RAND.pod
@@ -0,0 +1,74 @@
1=pod
2
3=head1 NAME
4
5rand - pseudo-random number generator
6
7=head1 SYNOPSIS
8
9 #include <openssl/rand.h>
10
11 int RAND_set_rand_engine(ENGINE *engine);
12
13 int RAND_bytes(unsigned char *buf, int num);
14 int RAND_pseudo_bytes(unsigned char *buf, int num);
15
16 void RAND_seed(const void *buf, int num);
17 void RAND_add(const void *buf, int num, int entropy);
18 int RAND_status(void);
19
20 int RAND_load_file(const char *file, long max_bytes);
21 int RAND_write_file(const char *file);
22 const char *RAND_file_name(char *file, size_t num);
23
24 int RAND_egd(const char *path);
25
26 void RAND_set_rand_method(const RAND_METHOD *meth);
27 const RAND_METHOD *RAND_get_rand_method(void);
28 RAND_METHOD *RAND_SSLeay(void);
29
30 void RAND_cleanup(void);
31
32=head1 DESCRIPTION
33
34Since the introduction of the ENGINE API, the recommended way of controlling
35default implementations is by using the ENGINE API functions. The default
36B<RAND_METHOD>, as set by RAND_set_rand_method() and returned by
37RAND_get_rand_method(), is only used if no ENGINE has been set as the default
38"rand" implementation. Hence, these two functions are no longer the recommened
39way to control defaults.
40
41If an alternative B<RAND_METHOD> implementation is being used (either set
42directly or as provided by an ENGINE module), then it is entirely responsible
43for the generation and management of a cryptographically secure PRNG stream. The
44mechanisms described below relate solely to the software PRNG implementation
45built in to OpenSSL and used by default.
46
47These functions implement a cryptographically secure pseudo-random
48number generator (PRNG). It is used by other library functions for
49example to generate random keys, and applications can use it when they
50need randomness.
51
52A cryptographic PRNG must be seeded with unpredictable data such as
53mouse movements or keys pressed at random by the user. This is
54described in L<RAND_add(3)|RAND_add(3)>. Its state can be saved in a seed file
55(see L<RAND_load_file(3)|RAND_load_file(3)>) to avoid having to go through the
56seeding process whenever the application is started.
57
58L<RAND_bytes(3)|RAND_bytes(3)> describes how to obtain random data from the
59PRNG.
60
61=head1 INTERNALS
62
63The RAND_SSLeay() method implements a PRNG based on the systems'
64L<arc4random_buf(3)> random number generator.
65
66=head1 SEE ALSO
67
68L<BN_rand(3)|BN_rand(3)>, L<RAND_add(3)|RAND_add(3)>,
69L<RAND_load_file(3)|RAND_load_file(3)>, L<RAND_egd(3)|RAND_egd(3)>,
70L<RAND_bytes(3)|RAND_bytes(3)>,
71L<RAND_set_rand_method(3)|RAND_set_rand_method(3)>,
72L<RAND_cleanup(3)|RAND_cleanup(3)>
73
74=cut
diff --git a/src/lib/libssl/src/doc/crypto/RC4.pod b/src/lib/libssl/src/doc/crypto/RC4.pod
new file mode 100644
index 0000000000..b6d3a4342c
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/RC4.pod
@@ -0,0 +1,62 @@
1=pod
2
3=head1 NAME
4
5RC4_set_key, RC4 - RC4 encryption
6
7=head1 SYNOPSIS
8
9 #include <openssl/rc4.h>
10
11 void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
12
13 void RC4(RC4_KEY *key, unsigned long len, const unsigned char *indata,
14 unsigned char *outdata);
15
16=head1 DESCRIPTION
17
18This library implements the Alleged RC4 cipher, which is described for
19example in I<Applied Cryptography>. It is believed to be compatible
20with RC4[TM], a proprietary cipher of RSA Security Inc.
21
22RC4 is a stream cipher with variable key length. Typically, 128 bit
23(16 byte) keys are used for strong encryption, but shorter insecure
24key sizes have been widely used due to export restrictions.
25
26RC4 consists of a key setup phase and the actual encryption or
27decryption phase.
28
29RC4_set_key() sets up the B<RC4_KEY> B<key> using the B<len> bytes long
30key at B<data>.
31
32RC4() encrypts or decrypts the B<len> bytes of data at B<indata> using
33B<key> and places the result at B<outdata>. Repeated RC4() calls with
34the same B<key> yield a continuous key stream.
35
36Since RC4 is a stream cipher (the input is XORed with a pseudo-random
37key stream to produce the output), decryption uses the same function
38calls as encryption.
39
40Applications should use the higher level functions
41L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>
42etc. instead of calling the RC4 functions directly.
43
44=head1 RETURN VALUES
45
46RC4_set_key() and RC4() do not return values.
47
48=head1 NOTE
49
50Certain conditions have to be observed to securely use stream ciphers.
51It is not permissible to perform multiple encryptions using the same
52key stream.
53
54=head1 SEE ALSO
55
56L<blowfish(3)|blowfish(3)>, L<des(3)|des(3)>, L<rc2(3)|rc2(3)>
57
58=head1 HISTORY
59
60RC4_set_key() and RC4() are available in all versions of SSLeay and OpenSSL.
61
62=cut
diff --git a/src/lib/libssl/src/doc/crypto/RIPEMD160.pod b/src/lib/libssl/src/doc/crypto/RIPEMD160.pod
new file mode 100644
index 0000000000..264bb99ae7
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/RIPEMD160.pod
@@ -0,0 +1,66 @@
1=pod
2
3=head1 NAME
4
5RIPEMD160, RIPEMD160_Init, RIPEMD160_Update, RIPEMD160_Final -
6RIPEMD-160 hash function
7
8=head1 SYNOPSIS
9
10 #include <openssl/ripemd.h>
11
12 unsigned char *RIPEMD160(const unsigned char *d, unsigned long n,
13 unsigned char *md);
14
15 int RIPEMD160_Init(RIPEMD160_CTX *c);
16 int RIPEMD160_Update(RIPEMD_CTX *c, const void *data,
17 unsigned long len);
18 int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);
19
20=head1 DESCRIPTION
21
22RIPEMD-160 is a cryptographic hash function with a
23160 bit output.
24
25RIPEMD160() computes the RIPEMD-160 message digest of the B<n>
26bytes at B<d> and places it in B<md> (which must have space for
27RIPEMD160_DIGEST_LENGTH == 20 bytes of output). If B<md> is NULL, the digest
28is placed in a static array.
29
30The following functions may be used if the message is not completely
31stored in memory:
32
33RIPEMD160_Init() initializes a B<RIPEMD160_CTX> structure.
34
35RIPEMD160_Update() can be called repeatedly with chunks of the message to
36be hashed (B<len> bytes at B<data>).
37
38RIPEMD160_Final() places the message digest in B<md>, which must have
39space for RIPEMD160_DIGEST_LENGTH == 20 bytes of output, and erases
40the B<RIPEMD160_CTX>.
41
42Applications should use the higher level functions
43L<EVP_DigestInit(3)|EVP_DigestInit(3)> etc. instead of calling the
44hash functions directly.
45
46=head1 RETURN VALUES
47
48RIPEMD160() returns a pointer to the hash value.
49
50RIPEMD160_Init(), RIPEMD160_Update() and RIPEMD160_Final() return 1 for
51success, 0 otherwise.
52
53=head1 CONFORMING TO
54
55ISO/IEC 10118-3 (draft) (??)
56
57=head1 SEE ALSO
58
59L<sha(3)|sha(3)>, L<hmac(3)|hmac(3)>, L<EVP_DigestInit(3)|EVP_DigestInit(3)>
60
61=head1 HISTORY
62
63RIPEMD160(), RIPEMD160_Init(), RIPEMD160_Update() and
64RIPEMD160_Final() are available since SSLeay 0.9.0.
65
66=cut
diff --git a/src/lib/libssl/src/doc/crypto/SHA1.pod b/src/lib/libssl/src/doc/crypto/SHA1.pod
new file mode 100644
index 0000000000..94ab7bc724
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/SHA1.pod
@@ -0,0 +1,70 @@
1=pod
2
3=head1 NAME
4
5SHA1, SHA1_Init, SHA1_Update, SHA1_Final - Secure Hash Algorithm
6
7=head1 SYNOPSIS
8
9 #include <openssl/sha.h>
10
11 unsigned char *SHA1(const unsigned char *d, unsigned long n,
12 unsigned char *md);
13
14 int SHA1_Init(SHA_CTX *c);
15 int SHA1_Update(SHA_CTX *c, const void *data,
16 unsigned long len);
17 int SHA1_Final(unsigned char *md, SHA_CTX *c);
18
19=head1 DESCRIPTION
20
21SHA-1 (Secure Hash Algorithm) is a cryptographic hash function with a
22160 bit output.
23
24SHA1() computes the SHA-1 message digest of the B<n>
25bytes at B<d> and places it in B<md> (which must have space for
26SHA_DIGEST_LENGTH == 20 bytes of output). If B<md> is NULL, the digest
27is placed in a static array.
28
29The following functions may be used if the message is not completely
30stored in memory:
31
32SHA1_Init() initializes a B<SHA_CTX> structure.
33
34SHA1_Update() can be called repeatedly with chunks of the message to
35be hashed (B<len> bytes at B<data>).
36
37SHA1_Final() places the message digest in B<md>, which must have space
38for SHA_DIGEST_LENGTH == 20 bytes of output, and erases the B<SHA_CTX>.
39
40Applications should use the higher level functions
41L<EVP_DigestInit(3)|EVP_DigestInit(3)>
42etc. instead of calling the hash functions directly.
43
44The predecessor of SHA-1, SHA, is also implemented, but it should be
45used only when backward compatibility is required.
46
47=head1 RETURN VALUES
48
49SHA1() returns a pointer to the hash value.
50
51SHA1_Init(), SHA1_Update() and SHA1_Final() return 1 for success, 0 otherwise.
52
53=head1 CONFORMING TO
54
55SHA: US Federal Information Processing Standard FIPS PUB 180 (Secure Hash
56Standard),
57SHA-1: US Federal Information Processing Standard FIPS PUB 180-1 (Secure Hash
58Standard),
59ANSI X9.30
60
61=head1 SEE ALSO
62
63L<ripemd(3)|ripemd(3)>, L<hmac(3)|hmac(3)>, L<EVP_DigestInit(3)|EVP_DigestInit(3)>
64
65=head1 HISTORY
66
67SHA1(), SHA1_Init(), SHA1_Update() and SHA1_Final() are available in all
68versions of SSLeay and OpenSSL.
69
70=cut
diff --git a/src/lib/libssl/src/doc/crypto/BIO_f_ssl.pod b/src/lib/libssl/src/doc/ssl/BIO_f_ssl.pod
index bc5861ab34..bc5861ab34 100644
--- a/src/lib/libssl/src/doc/crypto/BIO_f_ssl.pod
+++ b/src/lib/libssl/src/doc/ssl/BIO_f_ssl.pod