summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/doc/DH_generate_parameters.pod46
-rw-r--r--src/lib/libcrypto/doc/DSA_generate_parameters.pod54
-rw-r--r--src/lib/libcrypto/doc/EC_GFp_simple_method.pod60
-rw-r--r--src/lib/libcrypto/doc/EC_GROUP_copy.pod174
-rw-r--r--src/lib/libcrypto/doc/EC_GROUP_new.pod95
-rw-r--r--src/lib/libcrypto/doc/EC_KEY_new.pod115
-rw-r--r--src/lib/libcrypto/doc/EC_POINT_add.pod72
-rw-r--r--src/lib/libcrypto/doc/EC_POINT_new.pod123
-rw-r--r--src/lib/libcrypto/doc/ERR_get_error.pod2
-rw-r--r--src/lib/libcrypto/doc/ERR_remove_state.pod21
-rw-r--r--src/lib/libcrypto/doc/EVP_BytesToKey.pod5
-rw-r--r--src/lib/libcrypto/doc/EVP_DigestInit.pod5
-rw-r--r--src/lib/libcrypto/doc/EVP_EncryptInit.pod20
-rw-r--r--src/lib/libcrypto/doc/EVP_PKEY_CTX_ctrl.pod10
-rw-r--r--src/lib/libcrypto/doc/EVP_SignInit.pod8
-rw-r--r--src/lib/libcrypto/doc/OPENSSL_config.pod2
-rw-r--r--src/lib/libcrypto/doc/OPENSSL_load_builtin_modules.pod2
-rw-r--r--src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod2
-rw-r--r--src/lib/libcrypto/doc/PKCS5_PBKDF2_HMAC.pod64
-rw-r--r--src/lib/libcrypto/doc/PKCS7_verify.pod2
-rw-r--r--src/lib/libcrypto/doc/RSA_generate_key.pod37
-rw-r--r--src/lib/libcrypto/doc/RSA_sign.pod4
-rw-r--r--src/lib/libcrypto/doc/X509_NAME_ENTRY_get_object.pod2
-rw-r--r--src/lib/libcrypto/doc/X509_STORE_CTX_get_ex_new_index.pod2
-rw-r--r--src/lib/libcrypto/doc/d2i_DSAPublicKey.pod2
-rw-r--r--src/lib/libcrypto/doc/d2i_ECPKParameters.pod84
-rw-r--r--src/lib/libcrypto/doc/d2i_X509_CRL.pod2
-rw-r--r--src/lib/libcrypto/doc/ec.pod201
-rw-r--r--src/lib/libcrypto/doc/evp.pod66
-rw-r--r--src/lib/libcrypto/doc/i2d_PKCS7_bio_stream.pod2
-rw-r--r--src/lib/libcrypto/man/Makefile183
-rw-r--r--src/lib/libssl/man/Makefile14
-rw-r--r--src/lib/libssl/src/doc/apps/verify.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/ASN1_STRING_length.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/ASN1_STRING_print_ex.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/ASN1_generate_nconf.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_f_base64.pod15
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_find_type.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_s_accept.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_s_connect.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_BLINDING_new.pod6
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_CTX_new.pod10
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_generate_prime.pod91
-rw-r--r--src/lib/libssl/src/doc/crypto/BN_rand.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/CMS_add0_cert.pod4
-rw-r--r--src/lib/libssl/src/doc/crypto/CMS_decrypt.pod16
-rw-r--r--src/lib/libssl/src/doc/crypto/CMS_get0_RecipientInfos.pod3
-rw-r--r--src/lib/libssl/src/doc/crypto/CMS_verify.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/CONF_modules_free.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/CONF_modules_load_file.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/DH_generate_parameters.pod46
-rw-r--r--src/lib/libssl/src/doc/crypto/DSA_generate_parameters.pod54
-rw-r--r--src/lib/libssl/src/doc/crypto/EC_GFp_simple_method.pod60
-rw-r--r--src/lib/libssl/src/doc/crypto/EC_GROUP_copy.pod174
-rw-r--r--src/lib/libssl/src/doc/crypto/EC_GROUP_new.pod95
-rw-r--r--src/lib/libssl/src/doc/crypto/EC_KEY_new.pod115
-rw-r--r--src/lib/libssl/src/doc/crypto/EC_POINT_add.pod72
-rw-r--r--src/lib/libssl/src/doc/crypto/EC_POINT_new.pod123
-rw-r--r--src/lib/libssl/src/doc/crypto/ERR_get_error.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/ERR_remove_state.pod21
-rw-r--r--src/lib/libssl/src/doc/crypto/EVP_BytesToKey.pod5
-rw-r--r--src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod5
-rw-r--r--src/lib/libssl/src/doc/crypto/EVP_EncryptInit.pod20
-rw-r--r--src/lib/libssl/src/doc/crypto/EVP_PKEY_CTX_ctrl.pod10
-rw-r--r--src/lib/libssl/src/doc/crypto/EVP_SignInit.pod8
-rw-r--r--src/lib/libssl/src/doc/crypto/OPENSSL_config.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/OPENSSL_load_builtin_modules.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/OpenSSL_add_all_algorithms.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/PKCS5_PBKDF2_HMAC.pod64
-rw-r--r--src/lib/libssl/src/doc/crypto/PKCS7_verify.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/RSA_generate_key.pod37
-rw-r--r--src/lib/libssl/src/doc/crypto/RSA_sign.pod4
-rw-r--r--src/lib/libssl/src/doc/crypto/X509_NAME_ENTRY_get_object.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/X509_STORE_CTX_get_ex_new_index.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/crypto.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/d2i_DSAPublicKey.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/d2i_ECPKParameters.pod84
-rw-r--r--src/lib/libssl/src/doc/crypto/d2i_X509_CRL.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/ec.pod201
-rw-r--r--src/lib/libssl/src/doc/crypto/ecdsa.pod2
-rw-r--r--src/lib/libssl/src/doc/crypto/evp.pod66
-rw-r--r--src/lib/libssl/src/doc/crypto/i2d_PKCS7_bio_stream.pod2
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CIPHER_get_name.pod15
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_add_extra_chain_cert.pod4
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_add_session.pod2
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_new.pod38
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_set_client_CA_list.pod2
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_set_client_cert_cb.pod4
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_set_info_callback.pod2
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_set_msg_callback.pod4
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_set_options.pod4
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod6
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_set_verify.pod4
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_get_fd.pod2
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_get_peer_cert_chain.pod8
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_get_rbio.pod2
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_get_session.pod2
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_get_version.pod14
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_set_fd.pod2
-rw-r--r--src/lib/libssl/src/doc/ssl/d2i_SSL_SESSION.pod13
100 files changed, 2781 insertions, 283 deletions
diff --git a/src/lib/libcrypto/doc/DH_generate_parameters.pod b/src/lib/libcrypto/doc/DH_generate_parameters.pod
index 3832c25315..bd0782cb0c 100644
--- a/src/lib/libcrypto/doc/DH_generate_parameters.pod
+++ b/src/lib/libcrypto/doc/DH_generate_parameters.pod
@@ -2,31 +2,37 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5DH_generate_parameters, DH_check - generate and check Diffie-Hellman parameters 5DH_generate_parameters_ex, DH_generate_parameters,
6DH_check - generate and check Diffie-Hellman parameters
6 7
7=head1 SYNOPSIS 8=head1 SYNOPSIS
8 9
9 #include <openssl/dh.h> 10 #include <openssl/dh.h>
10 11
11 DH *DH_generate_parameters(int prime_len, int generator, 12 int DH_generate_parameters_ex(DH *dh, int prime_len,int generator, BN_GENCB *cb);
12 void (*callback)(int, int, void *), void *cb_arg);
13 13
14 int DH_check(DH *dh, int *codes); 14 int DH_check(DH *dh, int *codes);
15 15
16Deprecated:
17
18 DH *DH_generate_parameters(int prime_len, int generator,
19 void (*callback)(int, int, void *), void *cb_arg);
20
16=head1 DESCRIPTION 21=head1 DESCRIPTION
17 22
18DH_generate_parameters() generates Diffie-Hellman parameters that can 23DH_generate_parameters_ex() generates Diffie-Hellman parameters that can
19be shared among a group of users, and returns them in a newly 24be shared among a group of users, and stores them in the provided B<DH>
20allocated B<DH> structure. 25structure.
21 26
22B<prime_len> is the length in bits of the safe prime to be generated. 27B<prime_len> is the length in bits of the safe prime to be generated.
23B<generator> is a small number E<gt> 1, typically 2 or 5. 28B<generator> is a small number E<gt> 1, typically 2 or 5.
24 29
25A callback function may be used to provide feedback about the progress of the 30A callback function may be used to provide feedback about the progress
26key generation. If B<callback> is not B<NULL>, it will be called as described 31of the key generation. If B<cb> is not B<NULL>, it will be
27in L<BN_generate_prime(3)|BN_generate_prime(3)> while a random prime number is 32called as described in L<BN_generate_prime(3)|BN_generate_prime(3)> while a random prime number is
28generated, and when a prime has been found, B<callback(3, 0, cb_arg)> is 33generated, and when a prime has been found, B<BN_GENCB_call(cb, 3, 0)> is
29called. 34called. See L<BN_generate_prime(3)|BN_generate_prime(3)> for information on
35the BN_GENCB_call() function.
30 36
31DH_check() validates Diffie-Hellman parameters. It checks that B<p> is 37DH_check() validates Diffie-Hellman parameters. It checks that B<p> is
32a safe prime, and that B<g> is a suitable generator. In the case of an 38a safe prime, and that B<g> is a suitable generator. In the case of an
@@ -37,19 +43,21 @@ checked, i.e. it does not equal 2 or 5.
37 43
38=head1 RETURN VALUES 44=head1 RETURN VALUES
39 45
40DH_generate_parameters() returns a pointer to the DH structure, or 46DH_generate_parameters_ex() and DH_check() return 1 if the check could be
41NULL if the parameter generation fails. The error codes can be 47performed, 0 otherwise.
42obtained by L<ERR_get_error(3)|ERR_get_error(3)>. 48
49DH_generate_parameters() (deprecated) returns a pointer to the DH structure, or
50NULL if the parameter generation fails.
43 51
44DH_check() returns 1 if the check could be performed, 0 otherwise. 52The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
45 53
46=head1 NOTES 54=head1 NOTES
47 55
48DH_generate_parameters() may run for several hours before finding a 56DH_generate_parameters_ex() and DH_generate_parameters() may run for several
49suitable prime. 57hours before finding a suitable prime.
50 58
51The parameters generated by DH_generate_parameters() are not to be 59The parameters generated by DH_generate_parameters_ex() and DH_generate_parameters()
52used in signature schemes. 60are not to be used in signature schemes.
53 61
54=head1 BUGS 62=head1 BUGS
55 63
diff --git a/src/lib/libcrypto/doc/DSA_generate_parameters.pod b/src/lib/libcrypto/doc/DSA_generate_parameters.pod
index b64f0ca546..698b555a0e 100644
--- a/src/lib/libcrypto/doc/DSA_generate_parameters.pod
+++ b/src/lib/libcrypto/doc/DSA_generate_parameters.pod
@@ -2,20 +2,26 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5DSA_generate_parameters - generate DSA parameters 5DSA_generate_parameters_ex, DSA_generate_parameters - generate DSA parameters
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/dsa.h> 9 #include <openssl/dsa.h>
10 10
11 int DSA_generate_parameters_ex(DSA *dsa, int bits,
12 const unsigned char *seed,int seed_len,
13 int *counter_ret, unsigned long *h_ret, BN_GENCB *cb);
14
15Deprecated:
16
11 DSA *DSA_generate_parameters(int bits, unsigned char *seed, 17 DSA *DSA_generate_parameters(int bits, unsigned char *seed,
12 int seed_len, int *counter_ret, unsigned long *h_ret, 18 int seed_len, int *counter_ret, unsigned long *h_ret,
13 void (*callback)(int, int, void *), void *cb_arg); 19 void (*callback)(int, int, void *), void *cb_arg);
14 20
15=head1 DESCRIPTION 21=head1 DESCRIPTION
16 22
17DSA_generate_parameters() generates primes p and q and a generator g 23DSA_generate_parameters_ex() generates primes p and q and a generator g
18for use in the DSA. 24for use in the DSA and stores the result in B<dsa>.
19 25
20B<bits> is the length of the prime to be generated; the DSS allows a 26B<bits> is the length of the prime to be generated; the DSS allows a
21maximum of 1024 bits. 27maximum of 1024 bits.
@@ -25,64 +31,74 @@ generated at random. Otherwise, the seed is used to generate
25them. If the given seed does not yield a prime q, a new random 31them. If the given seed does not yield a prime q, a new random
26seed is chosen and placed at B<seed>. 32seed is chosen and placed at B<seed>.
27 33
28DSA_generate_parameters() places the iteration count in 34DSA_generate_parameters_ex() places the iteration count in
29*B<counter_ret> and a counter used for finding a generator in 35*B<counter_ret> and a counter used for finding a generator in
30*B<h_ret>, unless these are B<NULL>. 36*B<h_ret>, unless these are B<NULL>.
31 37
32A callback function may be used to provide feedback about the progress 38A callback function may be used to provide feedback about the progress
33of the key generation. If B<callback> is not B<NULL>, it will be 39of the key generation. If B<cb> is not B<NULL>, it will be
34called as follows: 40called as shown below. For information on the BN_GENCB structure and the
41BN_GENCB_call function discussed below, refer to
42L<BN_generate_prime(3)|BN_generate_prime(3)>.
35 43
36=over 4 44=over 4
37 45
38=item * 46=item *
39 47
40When a candidate for q is generated, B<callback(0, m++, cb_arg)> is called 48When a candidate for q is generated, B<BN_GENCB_call(cb, 0, m++)> is called
41(m is 0 for the first candidate). 49(m is 0 for the first candidate).
42 50
43=item * 51=item *
44 52
45When a candidate for q has passed a test by trial division, 53When a candidate for q has passed a test by trial division,
46B<callback(1, -1, cb_arg)> is called. 54B<BN_GENCB_call(cb, 1, -1)> is called.
47While a candidate for q is tested by Miller-Rabin primality tests, 55While a candidate for q is tested by Miller-Rabin primality tests,
48B<callback(1, i, cb_arg)> is called in the outer loop 56B<BN_GENCB_call(cb, 1, i)> is called in the outer loop
49(once for each witness that confirms that the candidate may be prime); 57(once for each witness that confirms that the candidate may be prime);
50i is the loop counter (starting at 0). 58i is the loop counter (starting at 0).
51 59
52=item * 60=item *
53 61
54When a prime q has been found, B<callback(2, 0, cb_arg)> and 62When a prime q has been found, B<BN_GENCB_call(cb, 2, 0)> and
55B<callback(3, 0, cb_arg)> are called. 63B<BN_GENCB_call(cb, 3, 0)> are called.
56 64
57=item * 65=item *
58 66
59Before a candidate for p (other than the first) is generated and tested, 67Before a candidate for p (other than the first) is generated and tested,
60B<callback(0, counter, cb_arg)> is called. 68B<BN_GENCB_call(cb, 0, counter)> is called.
61 69
62=item * 70=item *
63 71
64When a candidate for p has passed the test by trial division, 72When a candidate for p has passed the test by trial division,
65B<callback(1, -1, cb_arg)> is called. 73B<BN_GENCB_call(cb, 1, -1)> is called.
66While it is tested by the Miller-Rabin primality test, 74While it is tested by the Miller-Rabin primality test,
67B<callback(1, i, cb_arg)> is called in the outer loop 75B<BN_GENCB_call(cb, 1, i)> is called in the outer loop
68(once for each witness that confirms that the candidate may be prime). 76(once for each witness that confirms that the candidate may be prime).
69i is the loop counter (starting at 0). 77i is the loop counter (starting at 0).
70 78
71=item * 79=item *
72 80
73When p has been found, B<callback(2, 1, cb_arg)> is called. 81When p has been found, B<BN_GENCB_call(cb, 2, 1)> is called.
74 82
75=item * 83=item *
76 84
77When the generator has been found, B<callback(3, 1, cb_arg)> is called. 85When the generator has been found, B<BN_GENCB_call(cb, 3, 1)> is called.
78 86
79=back 87=back
80 88
89DSA_generate_parameters() (deprecated) works in much the same way as for DSA_generate_parameters_ex, except that no B<dsa> parameter is passed and
90instead a newly allocated B<DSA> structure is returned. Additionally "old
91style" callbacks are used instead of the newer BN_GENCB based approach.
92Refer to L<BN_generate_prime(3)|BN_generate_prime(3)> for further information.
93
81=head1 RETURN VALUE 94=head1 RETURN VALUE
82 95
96DSA_generate_parameters_ex() returns a 1 on success, or 0 otherwise.
97
83DSA_generate_parameters() returns a pointer to the DSA structure, or 98DSA_generate_parameters() returns a pointer to the DSA structure, or
84B<NULL> if the parameter generation fails. The error codes can be 99B<NULL> if the parameter generation fails.
85obtained by L<ERR_get_error(3)|ERR_get_error(3)>. 100
101The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
86 102
87=head1 BUGS 103=head1 BUGS
88 104
@@ -91,7 +107,7 @@ Seed lengths E<gt> 20 are not supported.
91=head1 SEE ALSO 107=head1 SEE ALSO
92 108
93L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, 109L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>,
94L<DSA_free(3)|DSA_free(3)> 110L<DSA_free(3)|DSA_free(3)>, L<BN_generate_prime(3)|BN_generate_prime(3)>
95 111
96=head1 HISTORY 112=head1 HISTORY
97 113
diff --git a/src/lib/libcrypto/doc/EC_GFp_simple_method.pod b/src/lib/libcrypto/doc/EC_GFp_simple_method.pod
new file mode 100644
index 0000000000..aff20ac175
--- /dev/null
+++ b/src/lib/libcrypto/doc/EC_GFp_simple_method.pod
@@ -0,0 +1,60 @@
1=pod
2
3=head1 NAME
4
5EC_GFp_simple_method, EC_GFp_mont_method, EC_GFp_nist_method, EC_GFp_nistp224_method, EC_GFp_nistp256_method, EC_GFp_nistp521_method, EC_GF2m_simple_method, EC_METHOD_get_field_type - Functions for obtaining B<EC_METHOD> objects.
6
7=head1 SYNOPSIS
8
9 #include <openssl/ec.h>
10
11 const EC_METHOD *EC_GFp_simple_method(void);
12 const EC_METHOD *EC_GFp_mont_method(void);
13 const EC_METHOD *EC_GFp_nist_method(void);
14 const EC_METHOD *EC_GFp_nistp224_method(void);
15 const EC_METHOD *EC_GFp_nistp256_method(void);
16 const EC_METHOD *EC_GFp_nistp521_method(void);
17
18 const EC_METHOD *EC_GF2m_simple_method(void);
19
20 int EC_METHOD_get_field_type(const EC_METHOD *meth);
21
22=head1 DESCRIPTION
23
24The Elliptic Curve library provides a number of different implementations through a single common interface.
25When constructing a curve using EC_GROUP_new (see L<EC_GROUP_new(3)|EC_GROUP_new(3)>) an
26implementation method must be provided. The functions described here all return a const pointer to an
27B<EC_METHOD> structure that can be passed to EC_GROUP_NEW. It is important that the correct implementation
28type for the form of curve selected is used.
29
30For F2^m curves there is only one implementation choice, i.e. EC_GF2_simple_method.
31
32For Fp curves the lowest common denominator implementation is the EC_GFp_simple_method implementation. All
33other implementations are based on this one. EC_GFp_mont_method builds on EC_GFp_simple_method but adds the
34use of montgomery multiplication (see L<BN_mod_mul_montgomery(3)|BN_mod_mul_montgomery(3)>). EC_GFp_nist_method
35offers an implementation optimised for use with NIST recommended curves (NIST curves are available through
36EC_GROUP_new_by_curve_name as described in L<EC_GROUP_new(3)|EC_GROUP_new(3)>).
37
38The functions EC_GFp_nistp224_method, EC_GFp_nistp256_method and EC_GFp_nistp521_method offer 64 bit
39optimised implementations for the NIST P224, P256 and P521 curves respectively. Note, however, that these
40implementations are not available on all platforms.
41
42EC_METHOD_get_field_type identifies what type of field the EC_METHOD structure supports, which will be either
43F2^m or Fp. If the field type is Fp then the value B<NID_X9_62_prime_field> is returned. If the field type is
44F2^m then the value B<NID_X9_62_characteristic_two_field> is returned. These values are defined in the
45obj_mac.h header file.
46
47=head1 RETURN VALUES
48
49All EC_GFp* functions and EC_GF2m_simple_method always return a const pointer to an EC_METHOD structure.
50
51EC_METHOD_get_field_type returns an integer that identifies the type of field the EC_METHOD structure supports.
52
53=head1 SEE ALSO
54
55L<crypto(3)|crypto(3)>, L<ec(3)|ec(3)>, L<EC_GROUP_new(3)|EC_GROUP_new(3)>, L<EC_GROUP_copy(3)|EC_GROUP_copy(3)>,
56L<EC_POINT_new(3)|EC_POINT_new(3)>, L<EC_POINT_add(3)|EC_POINT_add(3)>, L<EC_KEY_new(3)|EC_KEY_new(3)>,
57L<d2i_ECPKParameters(3)|d2i_ECPKParameters(3)>,
58L<BN_mod_mul_montgomery(3)|BN_mod_mul_montgomery(3)>
59
60=cut
diff --git a/src/lib/libcrypto/doc/EC_GROUP_copy.pod b/src/lib/libcrypto/doc/EC_GROUP_copy.pod
new file mode 100644
index 0000000000..954af469d5
--- /dev/null
+++ b/src/lib/libcrypto/doc/EC_GROUP_copy.pod
@@ -0,0 +1,174 @@
1=pod
2
3=head1 NAME
4
5EC_GROUP_copy, EC_GROUP_dup, EC_GROUP_method_of, EC_GROUP_set_generator, EC_GROUP_get0_generator, EC_GROUP_get_order, EC_GROUP_get_cofactor, EC_GROUP_set_curve_name, EC_GROUP_get_curve_name, EC_GROUP_set_asn1_flag, EC_GROUP_get_asn1_flag, EC_GROUP_set_point_conversion_form, EC_GROUP_get_point_conversion_form, EC_GROUP_get0_seed, EC_GROUP_get_seed_len, EC_GROUP_set_seed, EC_GROUP_get_degree, EC_GROUP_check, EC_GROUP_check_discriminant, EC_GROUP_cmp, EC_GROUP_get_basis_type, EC_GROUP_get_trinomial_basis, EC_GROUP_get_pentanomial_basis - Functions for manipulating B<EC_GROUP> objects.
6
7=head1 SYNOPSIS
8
9 #include <openssl/ec.h>
10 #include <openssl/bn.h>
11
12 int EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src);
13 EC_GROUP *EC_GROUP_dup(const EC_GROUP *src);
14
15 const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group);
16
17 int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor);
18 const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group);
19
20 int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx);
21 int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx);
22
23 void EC_GROUP_set_curve_name(EC_GROUP *group, int nid);
24 int EC_GROUP_get_curve_name(const EC_GROUP *group);
25
26 void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag);
27 int EC_GROUP_get_asn1_flag(const EC_GROUP *group);
28
29 void EC_GROUP_set_point_conversion_form(EC_GROUP *group, point_conversion_form_t form);
30 point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *);
31
32 unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x);
33 size_t EC_GROUP_get_seed_len(const EC_GROUP *);
34 size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len);
35
36 int EC_GROUP_get_degree(const EC_GROUP *group);
37
38 int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx);
39
40 int EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx);
41
42 int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx);
43
44 int EC_GROUP_get_basis_type(const EC_GROUP *);
45 int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k);
46 int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
47 unsigned int *k2, unsigned int *k3);
48
49=head1 DESCRIPTION
50
51EC_GROUP_copy copies the curve B<src> into B<dst>. Both B<src> and B<dst> must use the same EC_METHOD.
52
53EC_GROUP_dup creates a new EC_GROUP object and copies the content from B<src> to the newly created
54EC_GROUP object.
55
56EC_GROUP_method_of obtains the EC_METHOD of B<group>.
57
58EC_GROUP_set_generator sets curve paramaters that must be agreed by all participants using the curve. These
59paramaters include the B<generator>, the B<order> and the B<cofactor>. The B<generator> is a well defined point on the
60curve chosen for cryptographic operations. Integers used for point multiplications will be between 0 and
61n-1 where n is the B<order>. The B<order> multipied by the B<cofactor> gives the number of points on the curve.
62
63EC_GROUP_get0_generator returns the generator for the identified B<group>.
64
65The functions EC_GROUP_get_order and EC_GROUP_get_cofactor populate the provided B<order> and B<cofactor> parameters
66with the respective order and cofactors for the B<group>.
67
68The functions EC_GROUP_set_curve_name and EC_GROUP_get_curve_name, set and get the NID for the curve respectively
69(see L<EC_GROUP_new(3)|EC_GROUP_new(3)>). If a curve does not have a NID associated with it, then EC_GROUP_get_curve_name
70will return 0.
71
72The asn1_flag value on a curve is used to determine whether there is a specific ASN1 OID to describe the curve or not.
73If the asn1_flag is 1 then this is a named curve with an associated ASN1 OID. If not then asn1_flag is 0. The functions
74EC_GROUP_get_asn1_flag and EC_GROUP_set_asn1_flag get and set the status of the asn1_flag for the curve. If set then
75the curve_name must also be set.
76
77The point_coversion_form for a curve controls how EC_POINT data is encoded as ASN1 as defined in X9.62 (ECDSA).
78point_conversion_form_t is an enum defined as follows:
79
80 typedef enum {
81 /** the point is encoded as z||x, where the octet z specifies
82 * which solution of the quadratic equation y is */
83 POINT_CONVERSION_COMPRESSED = 2,
84 /** the point is encoded as z||x||y, where z is the octet 0x02 */
85 POINT_CONVERSION_UNCOMPRESSED = 4,
86 /** the point is encoded as z||x||y, where the octet z specifies
87 * which solution of the quadratic equation y is */
88 POINT_CONVERSION_HYBRID = 6
89 } point_conversion_form_t;
90
91
92For POINT_CONVERSION_UNCOMPRESSED the point is encoded as an octet signifying the UNCOMPRESSED form has been used followed by
93the octets for x, followed by the octets for y.
94
95For any given x co-ordinate for a point on a curve it is possible to derive two possible y values. For
96POINT_CONVERSION_COMPRESSED the point is encoded as an octet signifying that the COMPRESSED form has been used AND which of
97the two possible solutions for y has been used, followed by the octets for x.
98
99For POINT_CONVERSION_HYBRID the point is encoded as an octet signifying the HYBRID form has been used AND which of the two
100possible solutions for y has been used, followed by the octets for x, followed by the octets for y.
101
102The functions EC_GROUP_set_point_conversion_form and EC_GROUP_get_point_conversion_form set and get the point_conversion_form
103for the curve respectively.
104
105ANSI X9.62 (ECDSA standard) defines a method of generating the curve parameter b from a random number. This provides advantages
106in that a parameter obtained in this way is highly unlikely to be susceptible to special purpose attacks, or have any trapdoors in it.
107If the seed is present for a curve then the b parameter was generated in a verifiable fashion using that seed. The OpenSSL EC library
108does not use this seed value but does enable you to inspect it using EC_GROUP_get0_seed. This returns a pointer to a memory block
109containing the seed that was used. The length of the memory block can be obtained using EC_GROUP_get_seed_len. A number of the
110builtin curves within the library provide seed values that can be obtained. It is also possible to set a custom seed using
111EC_GROUP_set_seed and passing a pointer to a memory block, along with the length of the seed. Again, the EC library will not use
112this seed value, although it will be preserved in any ASN1 based communications.
113
114EC_GROUP_get_degree gets the degree of the field. For Fp fields this will be the number of bits in p. For F2^m fields this will be
115the value m.
116
117The function EC_GROUP_check_discriminant calculates the discriminant for the curve and verifies that it is valid.
118For a curve defined over Fp the discriminant is given by the formula 4*a^3 + 27*b^2 whilst for F2^m curves the discriminant is
119simply b. In either case for the curve to be valid the discriminant must be non zero.
120
121The function EC_GROUP_check performs a number of checks on a curve to verify that it is valid. Checks performed include
122verifying that the discriminant is non zero; that a generator has been defined; that the generator is on the curve and has
123the correct order.
124
125EC_GROUP_cmp compares B<a> and B<b> to determine whether they represent the same curve or not.
126
127The functions EC_GROUP_get_basis_type, EC_GROUP_get_trinomial_basis and EC_GROUP_get_pentanomial_basis should only be called for curves
128defined over an F2^m field. Addition and multiplication operations within an F2^m field are performed using an irreducible polynomial
129function f(x). This function is either a trinomial of the form:
130
131f(x) = x^m + x^k + 1 with m > k >= 1
132
133or a pentanomial of the form:
134
135f(x) = x^m + x^k3 + x^k2 + x^k1 + 1 with m > k3 > k2 > k1 >= 1
136
137The function EC_GROUP_get_basis_type returns a NID identifying whether a trinomial or pentanomial is in use for the field. The
138function EC_GROUP_get_trinomial_basis must only be called where f(x) is of the trinomial form, and returns the value of B<k>. Similary
139the function EC_GROUP_get_pentanomial_basis must only be called where f(x) is of the pentanomial form, and returns the values of B<k1>,
140B<k2> and B<k3> respectively.
141
142=head1 RETURN VALUES
143
144The following functions return 1 on success or 0 on error: EC_GROUP_copy, EC_GROUP_set_generator, EC_GROUP_check,
145EC_GROUP_check_discriminant, EC_GROUP_get_trinomial_basis and EC_GROUP_get_pentanomial_basis.
146
147EC_GROUP_dup returns a pointer to the duplicated curve, or NULL on error.
148
149EC_GROUP_method_of returns the EC_METHOD implementation in use for the given curve or NULL on error.
150
151EC_GROUP_get0_generator returns the generator for the given curve or NULL on error.
152
153EC_GROUP_get_order, EC_GROUP_get_cofactor, EC_GROUP_get_curve_name, EC_GROUP_get_asn1_flag, EC_GROUP_get_point_conversion_form
154and EC_GROUP_get_degree return the order, cofactor, curve name (NID), ASN1 flag, point_conversion_form and degree for the
155specified curve respectively. If there is no curve name associated with a curve then EC_GROUP_get_curve_name will return 0.
156
157EC_GROUP_get0_seed returns a pointer to the seed that was used to generate the parameter b, or NULL if the seed is not
158specified. EC_GROUP_get_seed_len returns the length of the seed or 0 if the seed is not specified.
159
160EC_GROUP_set_seed returns the length of the seed that has been set. If the supplied seed is NULL, or the supplied seed length is
1610, the the return value will be 1. On error 0 is returned.
162
163EC_GROUP_cmp returns 0 if the curves are equal, 1 if they are not equal, or -1 on error.
164
165EC_GROUP_get_basis_type returns the values NID_X9_62_tpBasis or NID_X9_62_ppBasis (as defined in <openssl/obj_mac.h>) for a
166trinomial or pentanomial respectively. Alternatively in the event of an error a 0 is returned.
167
168=head1 SEE ALSO
169
170L<crypto(3)|crypto(3)>, L<ec(3)|ec(3)>, L<EC_GROUP_new(3)|EC_GROUP_new(3)>,
171L<EC_POINT_new(3)|EC_POINT_new(3)>, L<EC_POINT_add(3)|EC_POINT_add(3)>, L<EC_KEY_new(3)|EC_KEY_new(3)>,
172L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>, L<d2i_ECPKParameters(3)|d2i_ECPKParameters(3)>
173
174=cut
diff --git a/src/lib/libcrypto/doc/EC_GROUP_new.pod b/src/lib/libcrypto/doc/EC_GROUP_new.pod
new file mode 100644
index 0000000000..ff55bf33a3
--- /dev/null
+++ b/src/lib/libcrypto/doc/EC_GROUP_new.pod
@@ -0,0 +1,95 @@
1=pod
2
3=head1 NAME
4
5EC_GROUP_new, EC_GROUP_free, EC_GROUP_clear_free, EC_GROUP_new_curve_GFp, EC_GROUP_new_curve_GF2m, EC_GROUP_new_by_curve_name, EC_GROUP_set_curve_GFp, EC_GROUP_get_curve_GFp, EC_GROUP_set_curve_GF2m, EC_GROUP_get_curve_GF2m, EC_get_builtin_curves - Functions for creating and destroying B<EC_GROUP> objects.
6
7=head1 SYNOPSIS
8
9 #include <openssl/ec.h>
10 #include <openssl/bn.h>
11
12 EC_GROUP *EC_GROUP_new(const EC_METHOD *meth);
13 void EC_GROUP_free(EC_GROUP *group);
14 void EC_GROUP_clear_free(EC_GROUP *group);
15
16 EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
17 EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
18 EC_GROUP *EC_GROUP_new_by_curve_name(int nid);
19
20 int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
21 int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
22 int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
23 int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
24
25 size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);
26
27=head1 DESCRIPTION
28
29Within the library there are two forms of elliptic curve that are of interest. The first form is those defined over the
30prime field Fp. The elements of Fp are the integers 0 to p-1, where p is a prime number. This gives us a revised
31elliptic curve equation as follows:
32
33y^2 mod p = x^3 +ax + b mod p
34
35The second form is those defined over a binary field F2^m where the elements of the field are integers of length at
36most m bits. For this form the elliptic curve equation is modified to:
37
38y^2 + xy = x^3 + ax^2 + b (where b != 0)
39
40Operations in a binary field are performed relative to an B<irreducible polynomial>. All such curves with OpenSSL
41use a trinomial or a pentanomial for this parameter.
42
43A new curve can be constructed by calling EC_GROUP_new, using the implementation provided by B<meth> (see
44L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>). It is then necessary to call either EC_GROUP_set_curve_GFp or
45EC_GROUP_set_curve_GF2m as appropriate to create a curve defined over Fp or over F2^m respectively.
46
47EC_GROUP_set_curve_GFp sets the curve parameters B<p>, B<a> and B<b> for a curve over Fp stored in B<group>.
48EC_group_get_curve_GFp obtains the previously set curve parameters.
49
50EC_GROUP_set_curve_GF2m sets the equivalent curve parameters for a curve over F2^m. In this case B<p> represents
51the irreducible polybnomial - each bit represents a term in the polynomial. Therefore there will either be three
52or five bits set dependant on whether the polynomial is a trinomial or a pentanomial.
53EC_group_get_curve_GF2m obtains the previously set curve parameters.
54
55The functions EC_GROUP_new_curve_GFp and EC_GROUP_new_curve_GF2m are shortcuts for calling EC_GROUP_new and the
56appropriate EC_group_set_curve function. An appropriate default implementation method will be used.
57
58Whilst the library can be used to create any curve using the functions described above, there are also a number of
59predefined curves that are available. In order to obtain a list of all of the predefined curves, call the function
60EC_get_builtin_curves. The parameter B<r> should be an array of EC_builtin_curve structures of size B<nitems>. The function
61will populate the B<r> array with information about the builtin curves. If B<nitems> is less than the total number of
62curves available, then the first B<nitems> curves will be returned. Otherwise the total number of curves will be
63provided. The return value is the total number of curves available (whether that number has been populated in B<r> or
64not). Passing a NULL B<r>, or setting B<nitems> to 0 will do nothing other than return the total number of curves available.
65The EC_builtin_curve structure is defined as follows:
66
67 typedef struct {
68 int nid;
69 const char *comment;
70 } EC_builtin_curve;
71
72Each EC_builtin_curve item has a unique integer id (B<nid>), and a human readable comment string describing the curve.
73
74In order to construct a builtin curve use the function EC_GROUP_new_by_curve_name and provide the B<nid> of the curve to
75be constructed.
76
77EC_GROUP_free frees the memory associated with the EC_GROUP.
78
79EC_GROUP_clear_free destroys any sensitive data held within the EC_GROUP and then frees its memory.
80
81=head1 RETURN VALUES
82
83All EC_GROUP_new* functions return a pointer to the newly constructed group, or NULL on error.
84
85EC_get_builtin_curves returns the number of builtin curves that are available.
86
87EC_GROUP_set_curve_GFp, EC_GROUP_get_curve_GFp, EC_GROUP_set_curve_GF2m, EC_GROUP_get_curve_GF2m return 1 on success or 0 on error.
88
89=head1 SEE ALSO
90
91L<crypto(3)|crypto(3)>, L<ec(3)|ec(3)>, L<EC_GROUP_copy(3)|EC_GROUP_copy(3)>,
92L<EC_POINT_new(3)|EC_POINT_new(3)>, L<EC_POINT_add(3)|EC_POINT_add(3)>, L<EC_KEY_new(3)|EC_KEY_new(3)>,
93L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>, L<d2i_ECPKParameters(3)|d2i_ECPKParameters(3)>
94
95=cut
diff --git a/src/lib/libcrypto/doc/EC_KEY_new.pod b/src/lib/libcrypto/doc/EC_KEY_new.pod
new file mode 100644
index 0000000000..b762cbcb73
--- /dev/null
+++ b/src/lib/libcrypto/doc/EC_KEY_new.pod
@@ -0,0 +1,115 @@
1=pod
2
3=head1 NAME
4
5EC_KEY_new, EC_KEY_get_flags, EC_KEY_set_flags, EC_KEY_clear_flags, EC_KEY_new_by_curve_name, EC_KEY_free, EC_KEY_copy, EC_KEY_dup, EC_KEY_up_ref, EC_KEY_get0_group, EC_KEY_set_group, EC_KEY_get0_private_key, EC_KEY_set_private_key, EC_KEY_get0_public_key, EC_KEY_set_public_key, EC_KEY_get_enc_flags, EC_KEY_set_enc_flags, EC_KEY_get_conv_form, EC_KEY_set_conv_form, EC_KEY_get_key_method_data, EC_KEY_insert_key_method_data, EC_KEY_set_asn1_flag, EC_KEY_precompute_mult, EC_KEY_generate_key, EC_KEY_check_key, EC_KEY_set_public_key_affine_coordinates - Functions for creating, destroying and manipulating B<EC_KEY> objects.
6
7=head1 SYNOPSIS
8
9 #include <openssl/ec.h>
10 #include <openssl/bn.h>
11
12 EC_KEY *EC_KEY_new(void);
13 int EC_KEY_get_flags(const EC_KEY *key);
14 void EC_KEY_set_flags(EC_KEY *key, int flags);
15 void EC_KEY_clear_flags(EC_KEY *key, int flags);
16 EC_KEY *EC_KEY_new_by_curve_name(int nid);
17 void EC_KEY_free(EC_KEY *key);
18 EC_KEY *EC_KEY_copy(EC_KEY *dst, const EC_KEY *src);
19 EC_KEY *EC_KEY_dup(const EC_KEY *src);
20 int EC_KEY_up_ref(EC_KEY *key);
21 const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key);
22 int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group);
23 const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key);
24 int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv);
25 const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key);
26 int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub);
27 unsigned int EC_KEY_get_enc_flags(const EC_KEY *key);
28 void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags);
29 point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key);
30 void EC_KEY_set_conv_form(EC_KEY *eckey, point_conversion_form_t cform);
31 void *EC_KEY_get_key_method_data(EC_KEY *key,
32 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
33 void EC_KEY_insert_key_method_data(EC_KEY *key, void *data,
34 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
35 void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag);
36 int EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx);
37 int EC_KEY_generate_key(EC_KEY *key);
38 int EC_KEY_check_key(const EC_KEY *key);
39 int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, BIGNUM *y);
40
41=head1 DESCRIPTION
42
43An EC_KEY represents a public key and (optionaly) an associated private key. A new EC_KEY (with no associated curve) can be constructed by calling EC_KEY_new.
44The reference count for the newly created EC_KEY is initially set to 1. A curve can be associated with the EC_KEY by calling
45EC_KEY_set_group.
46
47Alternatively a new EC_KEY can be constructed by calling EC_KEY_new_by_curve_name and supplying the nid of the associated curve. Refer to L<EC_GROUP_new(3)|EC_GROUP_new(3)> for a description of curve names. This function simply wraps calls to EC_KEY_new and
48EC_GROUP_new_by_curve_name.
49
50Calling EC_KEY_free decrements the reference count for the EC_KEY object, and if it has dropped to zero then frees the memory associated
51with it.
52
53EC_KEY_copy copies the contents of the EC_KEY in B<src> into B<dest>.
54
55EC_KEY_dup creates a new EC_KEY object and copies B<ec_key> into it.
56
57EC_KEY_up_ref increments the reference count associated with the EC_KEY object.
58
59EC_KEY_generate_key generates a new public and private key for the supplied B<eckey> object. B<eckey> must have an EC_GROUP object
60associated with it before calling this function. The private key is a random integer (0 < priv_key < order, where order is the order
61of the EC_GROUP object). The public key is an EC_POINT on the curve calculated by multiplying the generator for the curve by the
62private key.
63
64EC_KEY_check_key performs various sanity checks on the EC_KEY object to confirm that it is valid.
65
66EC_KEY_set_public_key_affine_coordinates sets the public key for B<key> based on its affine co-ordinates, i.e. it constructs an EC_POINT
67object based on the supplied B<x> and B<y> values and sets the public key to be this EC_POINT. It will also performs certain sanity checks
68on the key to confirm that it is valid.
69
70The functions EC_KEY_get0_group, EC_KEY_set_group, EC_KEY_get0_private_key, EC_KEY_set_private_key, EC_KEY_get0_public_key, and EC_KEY_set_public_key get and set the EC_GROUP object, the private key and the EC_POINT public key for the B<key> respectively.
71
72The functions EC_KEY_get_enc_flags and EC_KEY_set_enc_flags get and set the value of the encoding flags for the B<key>. There are two encoding
73flags currently defined - EC_PKEY_NO_PARAMETERS and EC_PKEY_NO_PUBKEY. These flags define the behaviour of how the B<key> is
74converted into ASN1 in a call to i2d_ECPrivateKey. If EC_PKEY_NO_PARAMETERS is set then the public parameters for the curve are not encoded
75along with the private key. If EC_PKEY_NO_PUBKEY is set then the public key is not encoded along with the private key.
76
77The functions EC_KEY_get_conv_form and EC_KEY_set_conv_form get and set the point_conversion_form for the B<key>. For a description
78of point_conversion_forms please refer to L<EC_POINT_new(3)|EC_POINT_new(3)>.
79
80EC_KEY_insert_key_method_data and EC_KEY_get_key_method_data enable the caller to associate arbitary additional data specific to the
81elliptic curve scheme being used with the EC_KEY object. This data is treated as a "black box" by the ec library. The data to be stored by EC_KEY_insert_key_method_data is provided in the B<data> parameter, which must have have associated functions for duplicating, freeing and "clear_freeing" the data item. If a subsequent EC_KEY_get_key_method_data call is issued, the functions for duplicating, freeing and "clear_freeing" the data item must be provided again, and they must be the same as they were when the data item was inserted.
82
83EC_KEY_set_flags sets the flags in the B<flags> parameter on the EC_KEY object. Any flags that are already set are left set. The currently defined standard flags are EC_FLAG_NON_FIPS_ALLOW and EC_FLAG_FIPS_CHECKED. In addition there is the flag EC_FLAG_COFACTOR_ECDH which is specific to ECDH and is defined in ecdh.h. EC_KEY_get_flags returns the current flags that are set for this EC_KEY. EC_KEY_clear_flags clears the flags indicated by the B<flags> parameter. All other flags are left in their existing state.
84
85EC_KEY_set_asn1_flag sets the asn1_flag on the underlying EC_GROUP object (if set). Refer to L<EC_GROUP_copy(3)|EC_GROUP_copy(3)> for further information on the asn1_flag.
86
87EC_KEY_precompute_mult stores multiples of the underlying EC_GROUP generator for faster point multiplication. See also L<EC_POINT_add(3)|EC_POINT_add(3)>.
88
89
90=head1 RETURN VALUES
91
92EC_KEY_new, EC_KEY_new_by_curve_name and EC_KEY_dup return a pointer to the newly created EC_KEY object, or NULL on error.
93
94EC_KEY_get_flags returns the flags associated with the EC_KEY object as an integer.
95
96EC_KEY_copy returns a pointer to the destination key, or NULL on error.
97
98EC_KEY_up_ref, EC_KEY_set_group, EC_KEY_set_private_key, EC_KEY_set_public_key, EC_KEY_precompute_mult, EC_KEY_generate_key, EC_KEY_check_key and EC_KEY_set_public_key_affine_coordinates return 1 on success or 0 on error.
99
100EC_KEY_get0_group returns the EC_GROUP associated with the EC_KEY.
101
102EC_KEY_get0_private_key returns the private key associated with the EC_KEY.
103
104EC_KEY_get_enc_flags returns the value of the current encoding flags for the EC_KEY.
105
106EC_KEY_get_conv_form return the point_conversion_form for the EC_KEY.
107
108
109=head1 SEE ALSO
110
111L<crypto(3)|crypto(3)>, L<ec(3)|ec(3)>, L<EC_GROUP_new(3)|EC_GROUP_new(3)>, L<EC_GROUP_copy(3)|EC_GROUP_copy(3)>,
112L<EC_POINT_new(3)|EC_POINT_new(3)>, L<EC_POINT_add(3)|EC_POINT_add(3)>,
113L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>, L<d2i_ECPKParameters(3)|d2i_ECPKParameters(3)>
114
115=cut
diff --git a/src/lib/libcrypto/doc/EC_POINT_add.pod b/src/lib/libcrypto/doc/EC_POINT_add.pod
new file mode 100644
index 0000000000..ae92640843
--- /dev/null
+++ b/src/lib/libcrypto/doc/EC_POINT_add.pod
@@ -0,0 +1,72 @@
1=pod
2
3=head1 NAME
4
5EC_POINT_add, EC_POINT_dbl, EC_POINT_invert, EC_POINT_is_at_infinity, EC_POINT_is_on_curve, EC_POINT_cmp, EC_POINT_make_affine, EC_POINTs_make_affine, EC_POINTs_mul, EC_POINT_mul, EC_GROUP_precompute_mult, EC_GROUP_have_precompute_mult - Functions for performing mathematical operations and tests on B<EC_POINT> objects.
6
7=head1 SYNOPSIS
8
9 #include <openssl/ec.h>
10 #include <openssl/bn.h>
11
12 int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx);
13 int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx);
14 int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx);
15 int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *p);
16 int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx);
17 int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx);
18 int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx);
19 int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], BN_CTX *ctx);
20 int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, size_t num, const EC_POINT *p[], const BIGNUM *m[], BN_CTX *ctx);
21 int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx);
22 int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx);
23 int EC_GROUP_have_precompute_mult(const EC_GROUP *group);
24
25
26=head1 DESCRIPTION
27
28EC_POINT_add adds the two points B<a> and B<b> and places the result in B<r>. Similarly EC_POINT_dbl doubles the point B<a> and places the
29result in B<r>. In both cases it is valid for B<r> to be one of B<a> or B<b>.
30
31EC_POINT_invert calculates the inverse of the supplied point B<a>. The result is placed back in B<a>.
32
33The function EC_POINT_is_at_infinity tests whether the supplied point is at infinity or not.
34
35EC_POINT_is_on_curve tests whether the supplied point is on the curve or not.
36
37EC_POINT_cmp compares the two supplied points and tests whether or not they are equal.
38
39The functions EC_POINT_make_affine and EC_POINTs_make_affine force the internal representation of the EC_POINT(s) into the affine
40co-ordinate system. In the case of EC_POINTs_make_affine the value B<num> provides the number of points in the array B<points> to be
41forced.
42
43EC_POINT_mul calculates the value generator * B<n> + B<q> * B<m> and stores the result in B<r>. The value B<n> may be NULL in which case the result is just B<q> * B<m>.
44
45EC_POINTs_mul calculates the value generator * B<n> + B<q[0]> * B<m[0]> + ... + B<q[num-1]> * B<m[num-1]>. As for EC_POINT_mul the value
46B<n> may be NULL.
47
48The function EC_GROUP_precompute_mult stores multiples of the generator for faster point multiplication, whilst
49EC_GROUP_have_precompute_mult tests whether precomputation has already been done. See L<EC_GROUP_copy(3)|EC_GROUP_copy(3)> for information
50about the generator.
51
52
53=head1 RETURN VALUES
54
55The following functions return 1 on success or 0 on error: EC_POINT_add, EC_POINT_dbl, EC_POINT_invert, EC_POINT_make_affine,
56EC_POINTs_make_affine, EC_POINTs_make_affine, EC_POINT_mul, EC_POINTs_mul and EC_GROUP_precompute_mult.
57
58EC_POINT_is_at_infinity returns 1 if the point is at infinity, or 0 otherwise.
59
60EC_POINT_is_on_curve returns 1 if the point is on the curve, 0 if not, or -1 on error.
61
62EC_POINT_cmp returns 1 if the points are not equal, 0 if they are, or -1 on error.
63
64EC_GROUP_have_precompute_mult return 1 if a precomputation has been done, or 0 if not.
65
66=head1 SEE ALSO
67
68L<crypto(3)|crypto(3)>, L<ec(3)|ec(3)>, L<EC_GROUP_new(3)|EC_GROUP_new(3)>, L<EC_GROUP_copy(3)|EC_GROUP_copy(3)>,
69L<EC_POINT_new(3)|EC_POINT_new(3)>, L<EC_KEY_new(3)|EC_KEY_new(3)>,
70L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>, L<d2i_ECPKParameters(3)|d2i_ECPKParameters(3)>
71
72=cut
diff --git a/src/lib/libcrypto/doc/EC_POINT_new.pod b/src/lib/libcrypto/doc/EC_POINT_new.pod
new file mode 100644
index 0000000000..69eb0d1a09
--- /dev/null
+++ b/src/lib/libcrypto/doc/EC_POINT_new.pod
@@ -0,0 +1,123 @@
1=pod
2
3=head1 NAME
4
5EC_POINT_new, EC_POINT_free, EC_POINT_clear_free, EC_POINT_copy, EC_POINT_dup, EC_POINT_method_of, EC_POINT_set_to_infinity, EC_POINT_set_Jprojective_coordinates, EC_POINT_get_Jprojective_coordinates_GFp, EC_POINT_set_affine_coordinates_GFp, EC_POINT_get_affine_coordinates_GFp, EC_POINT_set_compressed_coordinates_GFp, EC_POINT_set_affine_coordinates_GF2m, EC_POINT_get_affine_coordinates_GF2m, EC_POINT_set_compressed_coordinates_GF2m, EC_POINT_point2oct, EC_POINT_oct2point, EC_POINT_point2bn, EC_POINT_bn2point, EC_POINT_point2hex, EC_POINT_hex2point - Functions for creating, destroying and manipulating B<EC_POINT> objects.
6
7=head1 SYNOPSIS
8
9 #include <openssl/ec.h>
10 #include <openssl/bn.h>
11
12 EC_POINT *EC_POINT_new(const EC_GROUP *group);
13 void EC_POINT_free(EC_POINT *point);
14 void EC_POINT_clear_free(EC_POINT *point);
15 int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src);
16 EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group);
17 const EC_METHOD *EC_POINT_method_of(const EC_POINT *point);
18 int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);
19 int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
20 const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx);
21 int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
22 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx);
23 int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
24 const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
25 int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
26 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
27 int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
28 const BIGNUM *x, int y_bit, BN_CTX *ctx);
29 int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
30 const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
31 int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
32 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
33 int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
34 const BIGNUM *x, int y_bit, BN_CTX *ctx);
35 size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p,
36 point_conversion_form_t form,
37 unsigned char *buf, size_t len, BN_CTX *ctx);
38 int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p,
39 const unsigned char *buf, size_t len, BN_CTX *ctx);
40 BIGNUM *EC_POINT_point2bn(const EC_GROUP *, const EC_POINT *,
41 point_conversion_form_t form, BIGNUM *, BN_CTX *);
42 EC_POINT *EC_POINT_bn2point(const EC_GROUP *, const BIGNUM *,
43 EC_POINT *, BN_CTX *);
44 char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *,
45 point_conversion_form_t form, BN_CTX *);
46 EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *,
47 EC_POINT *, BN_CTX *);
48
49
50=head1 DESCRIPTION
51
52An EC_POINT represents a point on a curve. A new point is constructed by calling the function EC_POINT_new and providing the B<group>
53object that the point relates to.
54
55EC_POINT_free frees the memory associated with the EC_POINT.
56
57EC_POINT_clear_free destroys any sensitive data held within the EC_POINT and then frees its memory.
58
59EC_POINT_copy copies the point B<src> into B<dst>. Both B<src> and B<dst> must use the same EC_METHOD.
60
61EC_POINT_dup creates a new EC_POINT object and copies the content from B<src> to the newly created
62EC_POINT object.
63
64EC_POINT_method_of obtains the EC_METHOD associated with B<point>.
65
66A valid point on a curve is the special point at infinity. A point is set to be at infinity by calling EC_POINT_set_to_infinity.
67
68The affine co-ordinates for a point describe a point in terms of its x and y position. The functions
69EC_POINT_set_affine_coordinates_GFp and EC_POINT_set_affine_coordinates_GF2m set the B<x> and B<y> co-ordinates for the point
70B<p> defined over the curve given in B<group>.
71
72As well as the affine co-ordinates, a point can alternatively be described in terms of its Jacobian
73projective co-ordinates (for Fp curves only). Jacobian projective co-ordinates are expressed as three values x, y and z. Working in
74this co-ordinate system provides more efficient point multiplication operations.
75A mapping exists between Jacobian projective co-ordinates and affine co-ordinates. A Jacobian projective co-ordinate (x, y, z) can be written as an affine co-ordinate as (x/(z^2), y/(z^3)). Conversion to Jacobian projective to affine co-ordinates is simple. The co-ordinate (x, y) is
76mapped to (x, y, 1). To set or get the projective co-ordinates use EC_POINT_set_Jprojective_coordinates_GFp and
77EC_POINT_get_Jprojective_coordinates_GFp respectively.
78
79Points can also be described in terms of their compressed co-ordinates. For a point (x, y), for any given value for x such that the point is
80on the curve there will only ever be two possible values for y. Therefore a point can be set using the EC_POINT_set_compressed_coordinates_GFp
81and EC_POINT_set_compressed_coordinates_GF2m functions where B<x> is the x co-ordinate and B<y_bit> is a value 0 or 1 to identify which of
82the two possible values for y should be used.
83
84In addition EC_POINTs can be converted to and from various external representations. Supported representations are octet strings, BIGNUMs and hexadecimal. The format of the external representation is described by the point_conversion_form. See L<EC_GROUP_copy(3)|EC_GROUP_copy(3)> for
85a description of point_conversion_form. Octet strings are stored in a buffer along with an associated buffer length. A point held in a BIGNUM is calculated by converting the point to an octet string and then converting that octet string into a BIGNUM integer. Points in hexadecimal format are stored in a NULL terminated character string where each character is one of the printable values 0-9 or A-F (or a-f).
86
87The functions EC_POINT_point2oct, EC_POINT_oct2point, EC_POINT_point2bn, EC_POINT_bn2point, EC_POINT_point2hex and EC_POINT_hex2point convert
88from and to EC_POINTs for the formats: octet string, BIGNUM and hexadecimal respectively.
89
90The function EC_POINT_point2oct must be supplied with a buffer long enough to store the octet string. The return value provides the number of
91octets stored. Calling the function with a NULL buffer will not perform the conversion but will still return the required buffer length.
92
93The function EC_POINT_point2hex will allocate sufficient memory to store the hexadecimal string. It is the caller's responsibility to free
94this memory with a subsequent call to OPENSSL_free().
95
96=head1 RETURN VALUES
97
98EC_POINT_new and EC_POINT_dup return the newly allocated EC_POINT or NULL on error.
99
100The following functions return 1 on success or 0 on error: EC_POINT_copy, EC_POINT_set_to_infinity, EC_POINT_set_Jprojective_coordinates_GFp,
101EC_POINT_get_Jprojective_coordinates_GFp, EC_POINT_set_affine_coordinates_GFp, EC_POINT_get_affine_coordinates_GFp,
102EC_POINT_set_compressed_coordinates_GFp, EC_POINT_set_affine_coordinates_GF2m, EC_POINT_get_affine_coordinates_GF2m,
103EC_POINT_set_compressed_coordinates_GF2m and EC_POINT_oct2point.
104
105EC_POINT_method_of returns the EC_METHOD associated with the supplied EC_POINT.
106
107EC_POINT_point2oct returns the length of the required buffer, or 0 on error.
108
109EC_POINT_point2bn returns the pointer to the BIGNUM supplied, or NULL on error.
110
111EC_POINT_bn2point returns the pointer to the EC_POINT supplied, or NULL on error.
112
113EC_POINT_point2hex returns a pointer to the hex string, or NULL on error.
114
115EC_POINT_hex2point returns the pointer to the EC_POINT supplied, or NULL on error.
116
117=head1 SEE ALSO
118
119L<crypto(3)|crypto(3)>, L<ec(3)|ec(3)>, L<EC_GROUP_new(3)|EC_GROUP_new(3)>, L<EC_GROUP_copy(3)|EC_GROUP_copy(3)>,
120L<EC_POINT_add(3)|EC_POINT_add(3)>, L<EC_KEY_new(3)|EC_KEY_new(3)>,
121L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>, L<d2i_ECPKParameters(3)|d2i_ECPKParameters(3)>
122
123=cut
diff --git a/src/lib/libcrypto/doc/ERR_get_error.pod b/src/lib/libcrypto/doc/ERR_get_error.pod
index 1a765f7aff..01e196c95f 100644
--- a/src/lib/libcrypto/doc/ERR_get_error.pod
+++ b/src/lib/libcrypto/doc/ERR_get_error.pod
@@ -49,7 +49,7 @@ additionally store the file name and line number where
49the error occurred in *B<file> and *B<line>, unless these are B<NULL>. 49the error occurred in *B<file> and *B<line>, unless these are B<NULL>.
50 50
51ERR_get_error_line_data(), ERR_peek_error_line_data() and 51ERR_get_error_line_data(), ERR_peek_error_line_data() and
52ERR_get_last_error_line_data() store additional data and flags 52ERR_peek_last_error_line_data() store additional data and flags
53associated with the error code in *B<data> 53associated with the error code in *B<data>
54and *B<flags>, unless these are B<NULL>. *B<data> contains a string 54and *B<flags>, unless these are B<NULL>. *B<data> contains a string
55if *B<flags>&B<ERR_TXT_STRING> is true. 55if *B<flags>&B<ERR_TXT_STRING> is true.
diff --git a/src/lib/libcrypto/doc/ERR_remove_state.pod b/src/lib/libcrypto/doc/ERR_remove_state.pod
index 72925fb9f4..a4d38c17fd 100644
--- a/src/lib/libcrypto/doc/ERR_remove_state.pod
+++ b/src/lib/libcrypto/doc/ERR_remove_state.pod
@@ -2,26 +2,35 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5ERR_remove_state - free a thread's error queue 5ERR_remove_thread_state, ERR_remove_state - free a thread's error queue
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/err.h> 9 #include <openssl/err.h>
10 10
11 void ERR_remove_thread_state(const CRYPTO_THREADID *tid);
12
13Deprecated:
14
11 void ERR_remove_state(unsigned long pid); 15 void ERR_remove_state(unsigned long pid);
12 16
13=head1 DESCRIPTION 17=head1 DESCRIPTION
14 18
15ERR_remove_state() frees the error queue associated with thread B<pid>. 19ERR_remove_thread_state() frees the error queue associated with thread B<tid>.
16If B<pid> == 0, the current thread will have its error queue removed. 20If B<tid> == B<NULL>, the current thread will have its error queue removed.
17 21
18Since error queue data structures are allocated automatically for new 22Since error queue data structures are allocated automatically for new
19threads, they must be freed when threads are terminated in order to 23threads, they must be freed when threads are terminated in order to
20avoid memory leaks. 24avoid memory leaks.
21 25
26ERR_remove_state is deprecated and has been replaced by
27ERR_remove_thread_state. Since threads in OpenSSL are no longer identified
28by unsigned long values any argument to this function is ignored. Calling
29ERR_remove_state is equivalent to B<ERR_remove_thread_state(NULL)>.
30
22=head1 RETURN VALUE 31=head1 RETURN VALUE
23 32
24ERR_remove_state() returns no value. 33ERR_remove_thread_state and ERR_remove_state() return no value.
25 34
26=head1 SEE ALSO 35=head1 SEE ALSO
27 36
@@ -29,6 +38,8 @@ L<err(3)|err(3)>
29 38
30=head1 HISTORY 39=head1 HISTORY
31 40
32ERR_remove_state() is available in all versions of SSLeay and OpenSSL. 41ERR_remove_state() is available in all versions of SSLeay and OpenSSL. It
42was deprecated in OpenSSL 1.0.0 when ERR_remove_thread_state was introduced
43and thread IDs were introduced to identify threads instead of 'unsigned long'.
33 44
34=cut 45=cut
diff --git a/src/lib/libcrypto/doc/EVP_BytesToKey.pod b/src/lib/libcrypto/doc/EVP_BytesToKey.pod
index 0ea7d55c0f..fe4c0a9194 100644
--- a/src/lib/libcrypto/doc/EVP_BytesToKey.pod
+++ b/src/lib/libcrypto/doc/EVP_BytesToKey.pod
@@ -36,8 +36,8 @@ If the total key and IV length is less than the digest length and
36B<MD5> is used then the derivation algorithm is compatible with PKCS#5 v1.5 36B<MD5> is used then the derivation algorithm is compatible with PKCS#5 v1.5
37otherwise a non standard extension is used to derive the extra data. 37otherwise a non standard extension is used to derive the extra data.
38 38
39Newer applications should use more standard algorithms such as PKCS#5 39Newer applications should use more standard algorithms such as PBKDF2 as
40v2.0 for key derivation. 40defined in PKCS#5v2.1 for key derivation.
41 41
42=head1 KEY DERIVATION ALGORITHM 42=head1 KEY DERIVATION ALGORITHM
43 43
@@ -60,6 +60,7 @@ EVP_BytesToKey() returns the size of the derived key in bytes.
60=head1 SEE ALSO 60=head1 SEE ALSO
61 61
62L<evp(3)|evp(3)>, L<rand(3)|rand(3)>, 62L<evp(3)|evp(3)>, L<rand(3)|rand(3)>,
63L<PKCS5_PBKDF2_HMAC(3)|PKCS5_PBKDF2_HMAC(3)>,
63L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> 64L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>
64 65
65=head1 HISTORY 66=head1 HISTORY
diff --git a/src/lib/libcrypto/doc/EVP_DigestInit.pod b/src/lib/libcrypto/doc/EVP_DigestInit.pod
index f2c1cfdbf0..3a71efd23d 100644
--- a/src/lib/libcrypto/doc/EVP_DigestInit.pod
+++ b/src/lib/libcrypto/doc/EVP_DigestInit.pod
@@ -161,9 +161,8 @@ EVP_MD_CTX_copy_ex() returns 1 if successful or 0 for failure.
161EVP_MD_type(), EVP_MD_pkey_type() and EVP_MD_type() return the NID of the 161EVP_MD_type(), EVP_MD_pkey_type() and EVP_MD_type() return the NID of the
162corresponding OBJECT IDENTIFIER or NID_undef if none exists. 162corresponding OBJECT IDENTIFIER or NID_undef if none exists.
163 163
164EVP_MD_size(), EVP_MD_block_size(), EVP_MD_CTX_size(e), EVP_MD_size(), 164EVP_MD_size(), EVP_MD_block_size(), EVP_MD_CTX_size() and
165EVP_MD_CTX_block_size() and EVP_MD_block_size() return the digest or block 165EVP_MD_CTX_block_size() return the digest or block size in bytes.
166size in bytes.
167 166
168EVP_md_null(), EVP_md2(), EVP_md5(), EVP_sha(), EVP_sha1(), EVP_dss(), 167EVP_md_null(), EVP_md2(), EVP_md5(), EVP_sha(), EVP_sha1(), EVP_dss(),
169EVP_dss1(), EVP_mdc2() and EVP_ripemd160() return pointers to the 168EVP_dss1(), EVP_mdc2() and EVP_ripemd160() return pointers to the
diff --git a/src/lib/libcrypto/doc/EVP_EncryptInit.pod b/src/lib/libcrypto/doc/EVP_EncryptInit.pod
index b2211ea6d3..a0a782e772 100644
--- a/src/lib/libcrypto/doc/EVP_EncryptInit.pod
+++ b/src/lib/libcrypto/doc/EVP_EncryptInit.pod
@@ -16,7 +16,16 @@ EVP_CIPHER_CTX_nid, EVP_CIPHER_CTX_block_size, EVP_CIPHER_CTX_key_length,
16EVP_CIPHER_CTX_iv_length, EVP_CIPHER_CTX_get_app_data, 16EVP_CIPHER_CTX_iv_length, EVP_CIPHER_CTX_get_app_data,
17EVP_CIPHER_CTX_set_app_data, EVP_CIPHER_CTX_type, EVP_CIPHER_CTX_flags, 17EVP_CIPHER_CTX_set_app_data, EVP_CIPHER_CTX_type, EVP_CIPHER_CTX_flags,
18EVP_CIPHER_CTX_mode, EVP_CIPHER_param_to_asn1, EVP_CIPHER_asn1_to_param, 18EVP_CIPHER_CTX_mode, EVP_CIPHER_param_to_asn1, EVP_CIPHER_asn1_to_param,
19EVP_CIPHER_CTX_set_padding - EVP cipher routines 19EVP_CIPHER_CTX_set_padding, EVP_enc_null, EVP_des_cbc, EVP_des_ecb,
20EVP_des_cfb, EVP_des_ofb, EVP_des_ede_cbc, EVP_des_ede, EVP_des_ede_ofb,
21EVP_des_ede_cfb, EVP_des_ede3_cbc, EVP_des_ede3, EVP_des_ede3_ofb,
22EVP_des_ede3_cfb, EVP_desx_cbc, EVP_rc4, EVP_rc4_40, EVP_idea_cbc,
23EVP_idea_ecb, EVP_idea_cfb, EVP_idea_ofb, EVP_idea_cbc, EVP_rc2_cbc,
24EVP_rc2_ecb, EVP_rc2_cfb, EVP_rc2_ofb, EVP_rc2_40_cbc, EVP_rc2_64_cbc,
25EVP_bf_cbc, EVP_bf_ecb, EVP_bf_cfb, EVP_bf_ofb, EVP_cast5_cbc,
26EVP_cast5_ecb, EVP_cast5_cfb, EVP_cast5_ofb,
27EVP_aes_128_gcm, EVP_aes_192_gcm, EVP_aes_256_gcm, EVP_aes_128_ccm,
28EVP_aes_192_ccm, EVP_aes_256_ccm - EVP cipher routines
20 29
21=head1 SYNOPSIS 30=head1 SYNOPSIS
22 31
@@ -155,10 +164,11 @@ similar way to EVP_EncryptInit_ex(), EVP_DecryptInit_ex and
155EVP_CipherInit_ex() except the B<ctx> parameter does not need to be 164EVP_CipherInit_ex() except the B<ctx> parameter does not need to be
156initialized and they always use the default cipher implementation. 165initialized and they always use the default cipher implementation.
157 166
158EVP_EncryptFinal(), EVP_DecryptFinal() and EVP_CipherFinal() behave in a 167EVP_EncryptFinal(), EVP_DecryptFinal() and EVP_CipherFinal() are
159similar way to EVP_EncryptFinal_ex(), EVP_DecryptFinal_ex() and 168identical to EVP_EncryptFinal_ex(), EVP_DecryptFinal_ex() and
160EVP_CipherFinal_ex() except B<ctx> is automatically cleaned up 169EVP_CipherFinal_ex(). In previous releases they also used to clean up
161after the call. 170the B<ctx>, but this is no longer done and EVP_CIPHER_CTX_clean()
171must be called to free any context resources.
162 172
163EVP_get_cipherbyname(), EVP_get_cipherbynid() and EVP_get_cipherbyobj() 173EVP_get_cipherbyname(), EVP_get_cipherbynid() and EVP_get_cipherbyobj()
164return an EVP_CIPHER structure when passed a cipher name, a NID or an 174return an EVP_CIPHER structure when passed a cipher name, a NID or an
diff --git a/src/lib/libcrypto/doc/EVP_PKEY_CTX_ctrl.pod b/src/lib/libcrypto/doc/EVP_PKEY_CTX_ctrl.pod
index ba6e51100b..91125da62e 100644
--- a/src/lib/libcrypto/doc/EVP_PKEY_CTX_ctrl.pod
+++ b/src/lib/libcrypto/doc/EVP_PKEY_CTX_ctrl.pod
@@ -2,7 +2,13 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5EVP_PKEY_ctrl, EVP_PKEY_ctrl_str - algorithm specific control operations 5EVP_PKEY_CTX_ctrl, EVP_PKEY_CTX_ctrl_str, EVP_PKEY_get_default_digest_nid,
6EVP_PKEY_CTX_set_signature_md, EVP_PKEY_CTX_set_rsa_padding,
7EVP_PKEY_CTX_set_rsa_pss_saltlen, EVP_PKEY_CTX_set_rsa_rsa_keygen_bits,
8EVP_PKEY_CTX_set_rsa_keygen_pubexp, EVP_PKEY_CTX_set_dsa_paramgen_bits,
9EVP_PKEY_CTX_set_dh_paramgen_prime_len,
10EVP_PKEY_CTX_set_dh_paramgen_generator,
11EVP_PKEY_CTX_set_ec_paramgen_curve_nid - algorithm specific control operations
6 12
7=head1 SYNOPSIS 13=head1 SYNOPSIS
8 14
@@ -45,7 +51,7 @@ B<p1> and B<p2>.
45Applications will not normally call EVP_PKEY_CTX_ctrl() directly but will 51Applications will not normally call EVP_PKEY_CTX_ctrl() directly but will
46instead call one of the algorithm specific macros below. 52instead call one of the algorithm specific macros below.
47 53
48The function EVP_PKEY_ctrl_str() allows an application to send an algorithm 54The function EVP_PKEY_CTX_ctrl_str() allows an application to send an algorithm
49specific control operation to a context B<ctx> in string form. This is 55specific control operation to a context B<ctx> in string form. This is
50intended to be used for options specified on the command line or in text 56intended to be used for options specified on the command line or in text
51files. The commands supported are documented in the openssl utility 57files. The commands supported are documented in the openssl utility
diff --git a/src/lib/libcrypto/doc/EVP_SignInit.pod b/src/lib/libcrypto/doc/EVP_SignInit.pod
index 6ea6df655e..5a1b67e006 100644
--- a/src/lib/libcrypto/doc/EVP_SignInit.pod
+++ b/src/lib/libcrypto/doc/EVP_SignInit.pod
@@ -30,9 +30,11 @@ signature context B<ctx>. This function can be called several times on the
30same B<ctx> to include additional data. 30same B<ctx> to include additional data.
31 31
32EVP_SignFinal() signs the data in B<ctx> using the private key B<pkey> and 32EVP_SignFinal() signs the data in B<ctx> using the private key B<pkey> and
33places the signature in B<sig>. The number of bytes of data written (i.e. the 33places the signature in B<sig>. B<sig> must be at least EVP_PKEY_size(pkey)
34length of the signature) will be written to the integer at B<s>, at most 34bytes in size. B<s> is an OUT parameter, and not used as an IN parameter.
35EVP_PKEY_size(pkey) bytes will be written. 35The number of bytes of data written (i.e. the length of the signature)
36will be written to the integer at B<s>, at most EVP_PKEY_size(pkey) bytes
37will be written.
36 38
37EVP_SignInit() initializes a signing context B<ctx> to use the default 39EVP_SignInit() initializes a signing context B<ctx> to use the default
38implementation of digest B<type>. 40implementation of digest B<type>.
diff --git a/src/lib/libcrypto/doc/OPENSSL_config.pod b/src/lib/libcrypto/doc/OPENSSL_config.pod
index 552ed956ab..897d2cce59 100644
--- a/src/lib/libcrypto/doc/OPENSSL_config.pod
+++ b/src/lib/libcrypto/doc/OPENSSL_config.pod
@@ -73,7 +73,7 @@ Neither OPENSSL_config() nor OPENSSL_no_config() return a value.
73=head1 SEE ALSO 73=head1 SEE ALSO
74 74
75L<conf(5)|conf(5)>, L<CONF_load_modules_file(3)|CONF_load_modules_file(3)>, 75L<conf(5)|conf(5)>, L<CONF_load_modules_file(3)|CONF_load_modules_file(3)>,
76L<CONF_modules_free(3),CONF_modules_free(3)> 76L<CONF_modules_free(3)|CONF_modules_free(3)>
77 77
78=head1 HISTORY 78=head1 HISTORY
79 79
diff --git a/src/lib/libcrypto/doc/OPENSSL_load_builtin_modules.pod b/src/lib/libcrypto/doc/OPENSSL_load_builtin_modules.pod
index 6c99170197..828fec651d 100644
--- a/src/lib/libcrypto/doc/OPENSSL_load_builtin_modules.pod
+++ b/src/lib/libcrypto/doc/OPENSSL_load_builtin_modules.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5OPENSSL_load_builtin_modules - add standard configuration modules 5OPENSSL_load_builtin_modules, ASN1_add_oid_module, ENGINE_add_conf_module - add standard configuration modules
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
diff --git a/src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod b/src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod
index cc6c07fa24..1bba4d0212 100644
--- a/src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod
+++ b/src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5OpenSSL_add_all_algorithms, OpenSSL_add_all_ciphers, OpenSSL_add_all_digests - 5OpenSSL_add_all_algorithms, OpenSSL_add_all_ciphers, OpenSSL_add_all_digests, EVP_cleanup -
6add algorithms to internal table 6add algorithms to internal table
7 7
8=head1 SYNOPSIS 8=head1 SYNOPSIS
diff --git a/src/lib/libcrypto/doc/PKCS5_PBKDF2_HMAC.pod b/src/lib/libcrypto/doc/PKCS5_PBKDF2_HMAC.pod
new file mode 100644
index 0000000000..7a2b8e6187
--- /dev/null
+++ b/src/lib/libcrypto/doc/PKCS5_PBKDF2_HMAC.pod
@@ -0,0 +1,64 @@
1=pod
2
3=head1 NAME
4
5PKCS5_PBKDF2_HMAC, PKCS5_PBKDF2_HMAC_SHA1 - password based derivation routines with salt and iteration count
6
7=head1 SYNOPSIS
8
9 #include <openssl/evp.h>
10
11 int PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
12 const unsigned char *salt, int saltlen, int iter,
13 const EVP_MD *digest,
14 int keylen, unsigned char *out);
15
16int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,
17 const unsigned char *salt, int saltlen, int iter,
18 int keylen, unsigned char *out);
19
20=head1 DESCRIPTION
21
22PKCS5_PBKDF2_HMAC() derives a key from a password using a salt and iteration count
23as specified in RFC 2898.
24
25B<pass> is the password used in the derivation of length B<passlen>. B<pass>
26is an optional parameter and can be NULL. If B<passlen> is -1, then the
27function will calculate the length of B<pass> using strlen().
28
29B<salt> is the salt used in the derivation of length B<saltlen>. If the
30B<salt> is NULL, then B<saltlen> must be 0. The function will not
31attempt to calculate the length of the B<salt> because it is not assumed to
32be NULL terminated.
33
34B<iter> is the iteration count and its value should be greater than or
35equal to 1. RFC 2898 suggests an iteration count of at least 1000. Any
36B<iter> less than 1 is treated as a single iteration.
37
38B<digest> is the message digest function used in the derivation. Values include
39any of the EVP_* message digests. PKCS5_PBKDF2_HMAC_SHA1() calls
40PKCS5_PBKDF2_HMAC() with EVP_sha1().
41
42The derived key will be written to B<out>. The size of the B<out> buffer
43is specified via B<keylen>.
44
45=head1 NOTES
46
47A typical application of this function is to derive keying material for an
48encryption algorithm from a password in the B<pass>, a salt in B<salt>,
49and an iteration count.
50
51Increasing the B<iter> parameter slows down the algorithm which makes it
52harder for an attacker to peform a brute force attack using a large number
53of candidate passwords.
54
55=head1 RETURN VALUES
56
57PKCS5_PBKDF2_HMAC() and PBKCS5_PBKDF2_HMAC_SHA1() return 1 on success or 0 on error.
58
59=head1 SEE ALSO
60
61L<evp(3)|evp(3)>, L<rand(3)|rand(3)>,
62L<EVP_BytesToKey(3)|EVP_BytesToKey(3)>
63
64=cut
diff --git a/src/lib/libcrypto/doc/PKCS7_verify.pod b/src/lib/libcrypto/doc/PKCS7_verify.pod
index f88e66632b..781c6108a9 100644
--- a/src/lib/libcrypto/doc/PKCS7_verify.pod
+++ b/src/lib/libcrypto/doc/PKCS7_verify.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5PKCS7_verify - verify a PKCS#7 signedData structure 5PKCS7_verify, PKCS7_get0_signers - verify a PKCS#7 signedData structure
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
diff --git a/src/lib/libcrypto/doc/RSA_generate_key.pod b/src/lib/libcrypto/doc/RSA_generate_key.pod
index 867390884b..00026f04df 100644
--- a/src/lib/libcrypto/doc/RSA_generate_key.pod
+++ b/src/lib/libcrypto/doc/RSA_generate_key.pod
@@ -2,27 +2,32 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5RSA_generate_key - generate RSA key pair 5RSA_generate_key_ex, RSA_generate_key - generate RSA key pair
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/rsa.h> 9 #include <openssl/rsa.h>
10 10
11 int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
12
13Deprecated:
14
11 RSA *RSA_generate_key(int num, unsigned long e, 15 RSA *RSA_generate_key(int num, unsigned long e,
12 void (*callback)(int,int,void *), void *cb_arg); 16 void (*callback)(int,int,void *), void *cb_arg);
13 17
14=head1 DESCRIPTION 18=head1 DESCRIPTION
15 19
16RSA_generate_key() generates a key pair and returns it in a newly 20RSA_generate_key_ex() generates a key pair and stores it in the B<RSA>
17allocated B<RSA> structure. 21structure provided in B<rsa>.
18 22
19The modulus size will be B<num> bits, and the public exponent will be 23The modulus size will be of length B<bits>, and the public exponent will be
20B<e>. Key sizes with B<num> E<lt> 1024 should be considered insecure. 24B<e>. Key sizes with B<num> E<lt> 1024 should be considered insecure.
21The exponent is an odd number, typically 3, 17 or 65537. 25The exponent is an odd number, typically 3, 17 or 65537.
22 26
23A callback function may be used to provide feedback about the 27A callback function may be used to provide feedback about the
24progress of the key generation. If B<callback> is not B<NULL>, it 28progress of the key generation. If B<cb> is not B<NULL>, it
25will be called as follows: 29will be called as follows using the BN_GENCB_call() function
30described on the L<BN_generate_prime(3)|BN_generate_prime(3)> page:
26 31
27=over 4 32=over 4
28 33
@@ -34,32 +39,38 @@ described in L<BN_generate_prime(3)|BN_generate_prime(3)>.
34=item * 39=item *
35 40
36When the n-th randomly generated prime is rejected as not 41When the n-th randomly generated prime is rejected as not
37suitable for the key, B<callback(2, n, cb_arg)> is called. 42suitable for the key, B<BN_GENCB_call(cb, 2, n)> is called.
38 43
39=item * 44=item *
40 45
41When a random p has been found with p-1 relatively prime to B<e>, 46When a random p has been found with p-1 relatively prime to B<e>,
42it is called as B<callback(3, 0, cb_arg)>. 47it is called as B<BN_GENCB_call(cb, 3, 0)>.
43 48
44=back 49=back
45 50
46The process is then repeated for prime q with B<callback(3, 1, cb_arg)>. 51The process is then repeated for prime q with B<BN_GENCB_call(cb, 3, 1)>.
52
53RSA_generate_key is deprecated (new applications should use
54RSA_generate_key_ex instead). RSA_generate_key works in the same was as
55RSA_generate_key_ex except it uses "old style" call backs. See
56L<BN_generate_prime(3)|BN_generate_prime(3)> for further details.
47 57
48=head1 RETURN VALUE 58=head1 RETURN VALUE
49 59
50If key generation fails, RSA_generate_key() returns B<NULL>; the 60If key generation fails, RSA_generate_key() returns B<NULL>.
51error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. 61
62The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
52 63
53=head1 BUGS 64=head1 BUGS
54 65
55B<callback(2, x, cb_arg)> is used with two different meanings. 66B<BN_GENCB_call(cb, 2, x)> is used with two different meanings.
56 67
57RSA_generate_key() goes into an infinite loop for illegal input values. 68RSA_generate_key() goes into an infinite loop for illegal input values.
58 69
59=head1 SEE ALSO 70=head1 SEE ALSO
60 71
61L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, 72L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>,
62L<RSA_free(3)|RSA_free(3)> 73L<RSA_free(3)|RSA_free(3)>, L<BN_generate_prime(3)|BN_generate_prime(3)>
63 74
64=head1 HISTORY 75=head1 HISTORY
65 76
diff --git a/src/lib/libcrypto/doc/RSA_sign.pod b/src/lib/libcrypto/doc/RSA_sign.pod
index a82f221909..51587bdc41 100644
--- a/src/lib/libcrypto/doc/RSA_sign.pod
+++ b/src/lib/libcrypto/doc/RSA_sign.pod
@@ -20,6 +20,10 @@ RSA_sign() signs the message digest B<m> of size B<m_len> using the
20private key B<rsa> as specified in PKCS #1 v2.0. It stores the 20private key B<rsa> as specified in PKCS #1 v2.0. It stores the
21signature in B<sigret> and the signature size in B<siglen>. B<sigret> 21signature in B<sigret> and the signature size in B<siglen>. B<sigret>
22must point to RSA_size(B<rsa>) bytes of memory. 22must point to RSA_size(B<rsa>) bytes of memory.
23Note that PKCS #1 adds meta-data, placing limits on the size of the
24key that can be used.
25See L<RSA_private_encrypt(3)|RSA_private_encrypt(3)> for lower-level
26operations.
23 27
24B<type> denotes the message digest algorithm that was used to generate 28B<type> denotes the message digest algorithm that was used to generate
25B<m>. It usually is one of B<NID_sha1>, B<NID_ripemd160> and B<NID_md5>; 29B<m>. It usually is one of B<NID_sha1>, B<NID_ripemd160> and B<NID_md5>;
diff --git a/src/lib/libcrypto/doc/X509_NAME_ENTRY_get_object.pod b/src/lib/libcrypto/doc/X509_NAME_ENTRY_get_object.pod
index 86242f8242..4603202db8 100644
--- a/src/lib/libcrypto/doc/X509_NAME_ENTRY_get_object.pod
+++ b/src/lib/libcrypto/doc/X509_NAME_ENTRY_get_object.pod
@@ -65,6 +65,6 @@ set first so the relevant field information can be looked up internally.
65=head1 SEE ALSO 65=head1 SEE ALSO
66 66
67L<ERR_get_error(3)|ERR_get_error(3)>, L<d2i_X509_NAME(3)|d2i_X509_NAME(3)>, 67L<ERR_get_error(3)|ERR_get_error(3)>, L<d2i_X509_NAME(3)|d2i_X509_NAME(3)>,
68L<OBJ_nid2obj(3),OBJ_nid2obj(3)> 68L<OBJ_nid2obj(3)|OBJ_nid2obj(3)>
69 69
70=cut 70=cut
diff --git a/src/lib/libcrypto/doc/X509_STORE_CTX_get_ex_new_index.pod b/src/lib/libcrypto/doc/X509_STORE_CTX_get_ex_new_index.pod
index 392b36c3ae..25224cef1b 100644
--- a/src/lib/libcrypto/doc/X509_STORE_CTX_get_ex_new_index.pod
+++ b/src/lib/libcrypto/doc/X509_STORE_CTX_get_ex_new_index.pod
@@ -17,7 +17,7 @@ structures
17 17
18 int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *d, int idx, void *arg); 18 int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *d, int idx, void *arg);
19 19
20 char *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *d, int idx); 20 void *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *d, int idx);
21 21
22=head1 DESCRIPTION 22=head1 DESCRIPTION
23 23
diff --git a/src/lib/libcrypto/doc/d2i_DSAPublicKey.pod b/src/lib/libcrypto/doc/d2i_DSAPublicKey.pod
index e890841311..eeb96c485f 100644
--- a/src/lib/libcrypto/doc/d2i_DSAPublicKey.pod
+++ b/src/lib/libcrypto/doc/d2i_DSAPublicKey.pod
@@ -3,7 +3,7 @@
3=head1 NAME 3=head1 NAME
4 4
5d2i_DSAPublicKey, i2d_DSAPublicKey, d2i_DSAPrivateKey, i2d_DSAPrivateKey, 5d2i_DSAPublicKey, i2d_DSAPublicKey, d2i_DSAPrivateKey, i2d_DSAPrivateKey,
6d2i_DSA_PUBKEY, i2d_DSA_PUBKEY, d2i_DSA_SIG, i2d_DSA_SIG - DSA key encoding 6d2i_DSA_PUBKEY, i2d_DSA_PUBKEY, d2i_DSAparams, i2d_DSAparams, d2i_DSA_SIG, i2d_DSA_SIG - DSA key encoding
7and parsing functions. 7and parsing functions.
8 8
9=head1 SYNOPSIS 9=head1 SYNOPSIS
diff --git a/src/lib/libcrypto/doc/d2i_ECPKParameters.pod b/src/lib/libcrypto/doc/d2i_ECPKParameters.pod
new file mode 100644
index 0000000000..704b4ab352
--- /dev/null
+++ b/src/lib/libcrypto/doc/d2i_ECPKParameters.pod
@@ -0,0 +1,84 @@
1=pod
2
3=head1 NAME
4
5d2i_ECPKParameters, i2d_ECPKParameters, d2i_ECPKParameters_bio, i2d_ECPKParameters_bio, d2i_ECPKParameters_fp, i2d_ECPKParameters_fp, ECPKParameters_print, ECPKParameters_print_fp - Functions for decoding and encoding ASN1 representations of elliptic curve entities
6
7=head1 SYNOPSIS
8
9 #include <openssl/ec.h>
10
11 EC_GROUP *d2i_ECPKParameters(EC_GROUP **px, const unsigned char **in, long len);
12 int i2d_ECPKParameters(const EC_GROUP *x, unsigned char **out);
13 #define d2i_ECPKParameters_bio(bp,x) ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x)
14 #define i2d_ECPKParameters_bio(bp,x) ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x)
15 #define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL, \
16 (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x))
17 #define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), \
18 (unsigned char *)(x))
19 int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off);
20 int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off);
21
22
23=head1 DESCRIPTION
24
25The ECPKParameters encode and decode routines encode and parse the public parameters for an
26B<EC_GROUP> structure, which represents a curve.
27
28d2i_ECPKParameters() attempts to decode B<len> bytes at B<*in>. If
29successful a pointer to the B<EC_GROUP> structure is returned. If an error
30occurred then B<NULL> is returned. If B<px> is not B<NULL> then the
31returned structure is written to B<*px>. If B<*px> is not B<NULL>
32then it is assumed that B<*px> contains a valid B<EC_GROUP>
33structure and an attempt is made to reuse it. If the call is
34successful B<*in> is incremented to the byte following the
35parsed data.
36
37i2d_ECPKParameters() encodes the structure pointed to by B<x> into DER format.
38If B<out> is not B<NULL> is writes the DER encoded data to the buffer
39at B<*out>, and increments it to point after the data just written.
40If the return value is negative an error occurred, otherwise it
41returns the length of the encoded data.
42
43If B<*out> is B<NULL> memory will be allocated for a buffer and the encoded
44data written to it. In this case B<*out> is not incremented and it points to
45the start of the data just written.
46
47d2i_ECPKParameters_bio() is similar to d2i_ECPKParameters() except it attempts
48to parse data from BIO B<bp>.
49
50d2i_ECPKParameters_fp() is similar to d2i_ECPKParameters() except it attempts
51to parse data from FILE pointer B<fp>.
52
53i2d_ECPKParameters_bio() is similar to i2d_ECPKParameters() except it writes
54the encoding of the structure B<x> to BIO B<bp> and it
55returns 1 for success and 0 for failure.
56
57i2d_ECPKParameters_fp() is similar to i2d_ECPKParameters() except it writes
58the encoding of the structure B<x> to BIO B<bp> and it
59returns 1 for success and 0 for failure.
60
61These functions are very similar to the X509 functions described in L<d2i_X509(3)|d2i_X509(3)>,
62where further notes and examples are available.
63
64The ECPKParameters_print and ECPKParameters_print_fp functions print a human-readable output
65of the public parameters of the EC_GROUP to B<bp> or B<fp>. The output lines are indented by B<off> spaces.
66
67=head1 RETURN VALUES
68
69d2i_ECPKParameters(), d2i_ECPKParameters_bio() and d2i_ECPKParameters_fp() return a valid B<EC_GROUP> structure
70or B<NULL> if an error occurs.
71
72i2d_ECPKParameters() returns the number of bytes successfully encoded or a negative
73value if an error occurs.
74
75i2d_ECPKParameters_bio(), i2d_ECPKParameters_fp(), ECPKParameters_print and ECPKParameters_print_fp
76return 1 for success and 0 if an error occurs.
77
78=head1 SEE ALSO
79
80L<crypto(3)|crypto(3)>, L<ec(3)|ec(3)>, L<EC_GROUP_new(3)|EC_GROUP_new(3)>, L<EC_GROUP_copy(3)|EC_GROUP_copy(3)>,
81L<EC_POINT_new(3)|EC_POINT_new(3)>, L<EC_POINT_add(3)|EC_POINT_add(3)>, L<EC_KEY_new(3)|EC_KEY_new(3)>,
82L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>, L<d2i_X509(3)|d2i_X509(3)>
83
84=cut
diff --git a/src/lib/libcrypto/doc/d2i_X509_CRL.pod b/src/lib/libcrypto/doc/d2i_X509_CRL.pod
index dcdc86994d..563e4de8e0 100644
--- a/src/lib/libcrypto/doc/d2i_X509_CRL.pod
+++ b/src/lib/libcrypto/doc/d2i_X509_CRL.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5d2i_X509_CRL, i2d_X509_CRL, d2i_X509_CRL_bio, d2i_509_CRL_fp, 5d2i_X509_CRL, i2d_X509_CRL, d2i_X509_CRL_bio, d2i_X509_CRL_fp,
6i2d_X509_CRL_bio, i2d_X509_CRL_fp - PKCS#10 certificate request functions. 6i2d_X509_CRL_bio, i2d_X509_CRL_fp - PKCS#10 certificate request functions.
7 7
8=head1 SYNOPSIS 8=head1 SYNOPSIS
diff --git a/src/lib/libcrypto/doc/ec.pod b/src/lib/libcrypto/doc/ec.pod
new file mode 100644
index 0000000000..7d57ba8ea0
--- /dev/null
+++ b/src/lib/libcrypto/doc/ec.pod
@@ -0,0 +1,201 @@
1=pod
2
3=head1 NAME
4
5ec - Elliptic Curve functions
6
7=head1 SYNOPSIS
8
9 #include <openssl/ec.h>
10 #include <openssl/bn.h>
11
12 const EC_METHOD *EC_GFp_simple_method(void);
13 const EC_METHOD *EC_GFp_mont_method(void);
14 const EC_METHOD *EC_GFp_nist_method(void);
15 const EC_METHOD *EC_GFp_nistp224_method(void);
16 const EC_METHOD *EC_GFp_nistp256_method(void);
17 const EC_METHOD *EC_GFp_nistp521_method(void);
18
19 const EC_METHOD *EC_GF2m_simple_method(void);
20
21 EC_GROUP *EC_GROUP_new(const EC_METHOD *meth);
22 void EC_GROUP_free(EC_GROUP *group);
23 void EC_GROUP_clear_free(EC_GROUP *group);
24 int EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src);
25 EC_GROUP *EC_GROUP_dup(const EC_GROUP *src);
26 const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group);
27 int EC_METHOD_get_field_type(const EC_METHOD *meth);
28 int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor);
29 const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group);
30 int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx);
31 int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx);
32 void EC_GROUP_set_curve_name(EC_GROUP *group, int nid);
33 int EC_GROUP_get_curve_name(const EC_GROUP *group);
34 void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag);
35 int EC_GROUP_get_asn1_flag(const EC_GROUP *group);
36 void EC_GROUP_set_point_conversion_form(EC_GROUP *group, point_conversion_form_t form);
37 point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *);
38 unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x);
39 size_t EC_GROUP_get_seed_len(const EC_GROUP *);
40 size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len);
41 int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
42 int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
43 int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
44 int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
45 int EC_GROUP_get_degree(const EC_GROUP *group);
46 int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx);
47 int EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx);
48 int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx);
49 EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
50 EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
51 EC_GROUP *EC_GROUP_new_by_curve_name(int nid);
52
53 size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);
54
55 EC_POINT *EC_POINT_new(const EC_GROUP *group);
56 void EC_POINT_free(EC_POINT *point);
57 void EC_POINT_clear_free(EC_POINT *point);
58 int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src);
59 EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group);
60 const EC_METHOD *EC_POINT_method_of(const EC_POINT *point);
61 int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);
62 int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
63 const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx);
64 int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
65 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx);
66 int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
67 const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
68 int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
69 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
70 int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
71 const BIGNUM *x, int y_bit, BN_CTX *ctx);
72 int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
73 const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
74 int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
75 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
76 int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
77 const BIGNUM *x, int y_bit, BN_CTX *ctx);
78 size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p,
79 point_conversion_form_t form,
80 unsigned char *buf, size_t len, BN_CTX *ctx);
81 int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p,
82 const unsigned char *buf, size_t len, BN_CTX *ctx);
83 BIGNUM *EC_POINT_point2bn(const EC_GROUP *, const EC_POINT *,
84 point_conversion_form_t form, BIGNUM *, BN_CTX *);
85 EC_POINT *EC_POINT_bn2point(const EC_GROUP *, const BIGNUM *,
86 EC_POINT *, BN_CTX *);
87 char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *,
88 point_conversion_form_t form, BN_CTX *);
89 EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *,
90 EC_POINT *, BN_CTX *);
91
92 int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx);
93 int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx);
94 int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx);
95 int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *p);
96 int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx);
97 int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx);
98 int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx);
99 int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], BN_CTX *ctx);
100 int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, size_t num, const EC_POINT *p[], const BIGNUM *m[], BN_CTX *ctx);
101 int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx);
102 int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx);
103 int EC_GROUP_have_precompute_mult(const EC_GROUP *group);
104
105 int EC_GROUP_get_basis_type(const EC_GROUP *);
106 int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k);
107 int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
108 unsigned int *k2, unsigned int *k3);
109 EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len);
110 int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out);
111 #define d2i_ECPKParameters_bio(bp,x) ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x)
112 #define i2d_ECPKParameters_bio(bp,x) ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x)
113 #define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL, \
114 (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x))
115 #define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), \
116 (unsigned char *)(x))
117 int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off);
118 int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off);
119
120 EC_KEY *EC_KEY_new(void);
121 int EC_KEY_get_flags(const EC_KEY *key);
122 void EC_KEY_set_flags(EC_KEY *key, int flags);
123 void EC_KEY_clear_flags(EC_KEY *key, int flags);
124 EC_KEY *EC_KEY_new_by_curve_name(int nid);
125 void EC_KEY_free(EC_KEY *key);
126 EC_KEY *EC_KEY_copy(EC_KEY *dst, const EC_KEY *src);
127 EC_KEY *EC_KEY_dup(const EC_KEY *src);
128 int EC_KEY_up_ref(EC_KEY *key);
129 const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key);
130 int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group);
131 const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key);
132 int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv);
133 const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key);
134 int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub);
135 unsigned EC_KEY_get_enc_flags(const EC_KEY *key);
136 void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags);
137 point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key);
138 void EC_KEY_set_conv_form(EC_KEY *eckey, point_conversion_form_t cform);
139 void *EC_KEY_get_key_method_data(EC_KEY *key,
140 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
141 void EC_KEY_insert_key_method_data(EC_KEY *key, void *data,
142 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
143 void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag);
144 int EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx);
145 int EC_KEY_generate_key(EC_KEY *key);
146 int EC_KEY_check_key(const EC_KEY *key);
147 int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, BIGNUM *y);
148
149 EC_KEY *d2i_ECPrivateKey(EC_KEY **key, const unsigned char **in, long len);
150 int i2d_ECPrivateKey(EC_KEY *key, unsigned char **out);
151
152 EC_KEY *d2i_ECParameters(EC_KEY **key, const unsigned char **in, long len);
153 int i2d_ECParameters(EC_KEY *key, unsigned char **out);
154
155 EC_KEY *o2i_ECPublicKey(EC_KEY **key, const unsigned char **in, long len);
156 int i2o_ECPublicKey(EC_KEY *key, unsigned char **out);
157 int ECParameters_print(BIO *bp, const EC_KEY *key);
158 int EC_KEY_print(BIO *bp, const EC_KEY *key, int off);
159 int ECParameters_print_fp(FILE *fp, const EC_KEY *key);
160 int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off);
161 #define ECParameters_dup(x) ASN1_dup_of(EC_KEY,i2d_ECParameters,d2i_ECParameters,x)
162 #define EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, nid) \
163 EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_PARAMGEN, \
164 EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID, nid, NULL)
165
166
167=head1 DESCRIPTION
168
169This library provides an extensive set of functions for performing operations on elliptic curves over finite fields.
170In general an elliptic curve is one with an equation of the form:
171
172y^2 = x^3 + ax + b
173
174An B<EC_GROUP> structure is used to represent the definition of an elliptic curve. Points on a curve are stored using an
175B<EC_POINT> structure. An B<EC_KEY> is used to hold a private/public key pair, where a private key is simply a BIGNUM and a
176public key is a point on a curve (represented by an B<EC_POINT>).
177
178The library contains a number of alternative implementations of the different functions. Each implementation is optimised
179for different scenarios. No matter which implementation is being used, the interface remains the same. The library
180handles calling the correct implementation when an interface function is invoked. An implementation is represented by
181an B<EC_METHOD> structure.
182
183The creation and destruction of B<EC_GROUP> objects is described in L<EC_GROUP_new(3)|EC_GROUP_new(3)>. Functions for
184manipulating B<EC_GROUP> objects are described in L<EC_GROUP_copy(3)|EC_GROUP_copy(3)>.
185
186Functions for creating, destroying and manipulating B<EC_POINT> objects are explained in L<EC_POINT_new(3)|EC_POINT_new(3)>,
187whilst functions for performing mathematical operations and tests on B<EC_POINTs> are coverd in L<EC_POINT_add(3)|EC_POINT_add(3)>.
188
189For working with private and public keys refer to L<EC_KEY_new(3)|EC_KEY_new(3)>. Implementations are covered in
190L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>.
191
192For information on encoding and decoding curve parameters to and from ASN1 see L<d2i_ECPKParameters(3)|d2i_ECPKParameters(3)>.
193
194=head1 SEE ALSO
195
196L<crypto(3)|crypto(3)>, L<EC_GROUP_new(3)|EC_GROUP_new(3)>, L<EC_GROUP_copy(3)|EC_GROUP_copy(3)>,
197L<EC_POINT_new(3)|EC_POINT_new(3)>, L<EC_POINT_add(3)|EC_POINT_add(3)>, L<EC_KEY_new(3)|EC_KEY_new(3)>,
198L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>, L<d2i_ECPKParameters(3)|d2i_ECPKParameters(3)>
199
200
201=cut
diff --git a/src/lib/libcrypto/doc/evp.pod b/src/lib/libcrypto/doc/evp.pod
index 33ce7cb6d6..57c761d01f 100644
--- a/src/lib/libcrypto/doc/evp.pod
+++ b/src/lib/libcrypto/doc/evp.pod
@@ -13,22 +13,58 @@ evp - high-level cryptographic functions
13The EVP library provides a high-level interface to cryptographic 13The EVP library provides a high-level interface to cryptographic
14functions. 14functions.
15 15
16B<EVP_Seal>I<...> and B<EVP_Open>I<...> provide public key encryption 16L<B<EVP_Seal>I<...>|EVP_SealInit(3)> and L<B<EVP_Open>I<...>|EVP_OpenInit(3)>
17and decryption to implement digital "envelopes". 17provide public key encryption and decryption to implement digital "envelopes".
18 18
19The B<EVP_Sign>I<...> and B<EVP_Verify>I<...> functions implement 19The L<B<EVP_DigestSign>I<...>|EVP_DigestSignInit(3)> and
20digital signatures. 20L<B<EVP_DigestVerify>I<...>|EVP_DigestVerifyInit(3)> functions implement
21digital signatures and Message Authentication Codes (MACs). Also see the older
22L<B<EVP_Sign>I<...>|EVP_SignInit(3)> and L<B<EVP_Verify>I<...>|EVP_VerifyInit(3)>
23functions.
21 24
22Symmetric encryption is available with the B<EVP_Encrypt>I<...> 25Symmetric encryption is available with the L<B<EVP_Encrypt>I<...>|EVP_EncryptInit(3)>
23functions. The B<EVP_Digest>I<...> functions provide message digests. 26functions. The L<B<EVP_Digest>I<...>|EVP_DigestInit(3)> functions provide message digests.
24 27
25The B<EVP_PKEY>I<...> functions provide a high level interface to 28The B<EVP_PKEY>I<...> functions provide a high level interface to
26asymmetric algorithms. 29asymmetric algorithms. To create a new EVP_PKEY see
30L<EVP_PKEY_new(3)|EVP_PKEY_new(3)>. EVP_PKEYs can be associated
31with a private key of a particular algorithm by using the functions
32described on the L<EVP_PKEY_set1_RSA(3)|EVP_PKEY_set1_RSA(3)> page, or
33new keys can be generated using L<EVP_PKEY_keygen(3)|EVP_PKEY_keygen(3)>.
34EVP_PKEYs can be compared using L<EVP_PKEY_cmp(3)|EVP_PKEY_cmp(3)>, or printed using
35L<EVP_PKEY_print_private(3)|EVP_PKEY_print_private(3)>.
36
37The EVP_PKEY functions support the full range of asymmetric algorithm operations:
38
39=over
40
41=item For key agreement see L<EVP_PKEY_derive(3)|EVP_PKEY_derive(3)>
42
43=item For signing and verifying see L<EVP_PKEY_sign(3)|EVP_PKEY_sign(3)>,
44L<EVP_PKEY_verify(3)|EVP_PKEY_verify(3)> and L<EVP_PKEY_verify_recover(3)|EVP_PKEY_verify_recover(3)>.
45However, note that
46these functions do not perform a digest of the data to be signed. Therefore
47normally you would use the L<B<EVP_DigestSign>I<...>|EVP_DigestSignInit(3)>
48functions for this purpose.
49
50=item For encryption and decryption see L<EVP_PKEY_encrypt(3)|EVP_PKEY_encrypt(3)>
51and L<EVP_PKEY_decrypt(3)|EVP_PKEY_decrypt(3)> respectively. However, note that
52these functions perform encryption and decryption only. As public key
53encryption is an expensive operation, normally you would wrap
54an encrypted message in a "digital envelope" using the L<B<EVP_Seal>I<...>|EVP_SealInit(3)> and
55L<B<EVP_Open>I<...>|EVP_OpenInit(3)> functions.
56
57=back
58
59The L<EVP_BytesToKey(3)|EVP_BytesToKey(3)> function provides some limited support for password
60based encryption. Careful selection of the parameters will provide a PKCS#5 PBKDF1 compatible
61implementation. However, new applications should not typically use this (preferring, for example,
62PBKDF2 from PCKS#5).
27 63
28Algorithms are loaded with OpenSSL_add_all_algorithms(3). 64Algorithms are loaded with L<OpenSSL_add_all_algorithms(3)|OpenSSL_add_all_algorithms(3)>.
29 65
30All the symmetric algorithms (ciphers), digests and asymmetric algorithms 66All the symmetric algorithms (ciphers), digests and asymmetric algorithms
31(public key algorithms) can be replaced by ENGINE modules providing alternative 67(public key algorithms) can be replaced by L<ENGINE|engine(3)> modules providing alternative
32implementations. If ENGINE implementations of ciphers or digests are registered 68implementations. If ENGINE implementations of ciphers or digests are registered
33as defaults, then the various EVP functions will automatically use those 69as defaults, then the various EVP functions will automatically use those
34implementations automatically in preference to built in software 70implementations automatically in preference to built in software
@@ -47,8 +83,20 @@ L<EVP_DigestInit(3)|EVP_DigestInit(3)>,
47L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>, 83L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>,
48L<EVP_OpenInit(3)|EVP_OpenInit(3)>, 84L<EVP_OpenInit(3)|EVP_OpenInit(3)>,
49L<EVP_SealInit(3)|EVP_SealInit(3)>, 85L<EVP_SealInit(3)|EVP_SealInit(3)>,
86L<EVP_DigestSignInit(3)|EVP_DigestSignInit(3)>,
50L<EVP_SignInit(3)|EVP_SignInit(3)>, 87L<EVP_SignInit(3)|EVP_SignInit(3)>,
51L<EVP_VerifyInit(3)|EVP_VerifyInit(3)>, 88L<EVP_VerifyInit(3)|EVP_VerifyInit(3)>,
89L<EVP_PKEY_new(3)|EVP_PKEY_new(3)>,
90L<EVP_PKEY_set1_RSA(3)|EVP_PKEY_set1_RSA(3)>,
91L<EVP_PKEY_keygen(3)|EVP_PKEY_keygen(3)>,
92L<EVP_PKEY_print_private(3)|EVP_PKEY_print_private(3)>,
93L<EVP_PKEY_decrypt(3)|EVP_PKEY_decrypt(3)>,
94L<EVP_PKEY_encrypt(3)|EVP_PKEY_encrypt(3)>,
95L<EVP_PKEY_sign(3)|EVP_PKEY_sign(3)>,
96L<EVP_PKEY_verify(3)|EVP_PKEY_verify(3)>,
97L<EVP_PKEY_verify_recover(3)|EVP_PKEY_verify_recover(3)>,
98L<EVP_PKEY_derive(3)|EVP_PKEY_derive(3)>,
99L<EVP_BytesToKey(3)|EVP_BytesToKey(3)>,
52L<OpenSSL_add_all_algorithms(3)|OpenSSL_add_all_algorithms(3)>, 100L<OpenSSL_add_all_algorithms(3)|OpenSSL_add_all_algorithms(3)>,
53L<engine(3)|engine(3)> 101L<engine(3)|engine(3)>
54 102
diff --git a/src/lib/libcrypto/doc/i2d_PKCS7_bio_stream.pod b/src/lib/libcrypto/doc/i2d_PKCS7_bio_stream.pod
index dc4d884c59..a37231e267 100644
--- a/src/lib/libcrypto/doc/i2d_PKCS7_bio_stream.pod
+++ b/src/lib/libcrypto/doc/i2d_PKCS7_bio_stream.pod
@@ -23,7 +23,7 @@ streaming.
23 23
24=head1 BUGS 24=head1 BUGS
25 25
26The prefix "d2i" is arguably wrong because the function outputs BER format. 26The prefix "i2d" is arguably wrong because the function outputs BER format.
27 27
28=head1 RETURN VALUES 28=head1 RETURN VALUES
29 29
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile
index bd0434d9e7..1e3b90321a 100644
--- a/src/lib/libcrypto/man/Makefile
+++ b/src/lib/libcrypto/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.8 2014/07/11 13:35:57 beck Exp $ 1# $OpenBSD: Makefile,v 1.9 2014/07/11 16:18:13 miod Exp $
2 2
3.include <bsd.own.mk> # for NOMAN 3.include <bsd.own.mk> # for NOMAN
4 4
@@ -73,6 +73,12 @@ MAN= \
73 DSA_set_method.3 \ 73 DSA_set_method.3 \
74 DSA_sign.3 \ 74 DSA_sign.3 \
75 DSA_size.3 \ 75 DSA_size.3 \
76 EC_GFp_simple_method.3 \
77 EC_GROUP_copy.3 \
78 EC_GROUP_new.3 \
79 EC_KEY_new.3 \
80 EC_POINT_add.3 \
81 EC_POINT_new.3 \
76 ERR.3 \ 82 ERR.3 \
77 ERR_GET_LIB.3 \ 83 ERR_GET_LIB.3 \
78 ERR_clear_error.3 \ 84 ERR_clear_error.3 \
@@ -114,6 +120,7 @@ MAN= \
114 OPENSSL_config.3 \ 120 OPENSSL_config.3 \
115 OPENSSL_load_builtin_modules.3 \ 121 OPENSSL_load_builtin_modules.3 \
116 OpenSSL_add_all_algorithms.3 \ 122 OpenSSL_add_all_algorithms.3 \
123 PKCS5_PBKDF2_HMAC.3 \
117 PEM_read_bio_PrivateKey.3 \ 124 PEM_read_bio_PrivateKey.3 \
118 PEM_write_bio_PKCS7_stream.3 \ 125 PEM_write_bio_PKCS7_stream.3 \
119 PKCS12_create.3 \ 126 PKCS12_create.3 \
@@ -165,6 +172,7 @@ MAN= \
165 d2i_ASN1_OBJECT.3 \ 172 d2i_ASN1_OBJECT.3 \
166 d2i_DHparams.3 \ 173 d2i_DHparams.3 \
167 d2i_DSAPublicKey.3 \ 174 d2i_DSAPublicKey.3 \
175 d2i_ECPKParameters.3 \
168 d2i_PKCS8PrivateKey.3 \ 176 d2i_PKCS8PrivateKey.3 \
169 d2i_RSAPublicKey.3 \ 177 d2i_RSAPublicKey.3 \
170 d2i_X509.3 \ 178 d2i_X509.3 \
@@ -175,6 +183,7 @@ MAN= \
175 d2i_X509_SIG.3 \ 183 d2i_X509_SIG.3 \
176 dh.3 \ 184 dh.3 \
177 dsa.3 \ 185 dsa.3 \
186 ec.3 \
178 ecdsa.3 \ 187 ecdsa.3 \
179 engine.3 \ 188 engine.3 \
180 evp.3 \ 189 evp.3 \
@@ -267,6 +276,7 @@ MLINKS+=\
267 BIO_s_accept.3 BIO_do_accept.3 \ 276 BIO_s_accept.3 BIO_do_accept.3 \
268 BIO_s_accept.3 BIO_get_accept_port.3 \ 277 BIO_s_accept.3 BIO_get_accept_port.3 \
269 BIO_s_accept.3 BIO_get_bind_mode.3 \ 278 BIO_s_accept.3 BIO_get_bind_mode.3 \
279 BIO_s_accept.3 BIO_new_accept.3 \
270 BIO_s_accept.3 BIO_set_accept_bios.3 \ 280 BIO_s_accept.3 BIO_set_accept_bios.3 \
271 BIO_s_accept.3 BIO_set_accept_port.3 \ 281 BIO_s_accept.3 BIO_set_accept_port.3 \
272 BIO_s_accept.3 BIO_set_bind_mode.3 \ 282 BIO_s_accept.3 BIO_set_bind_mode.3 \
@@ -287,6 +297,7 @@ MLINKS+=\
287 BIO_s_connect.3 BIO_get_conn_int_port.3 \ 297 BIO_s_connect.3 BIO_get_conn_int_port.3 \
288 BIO_s_connect.3 BIO_get_conn_ip.3 \ 298 BIO_s_connect.3 BIO_get_conn_ip.3 \
289 BIO_s_connect.3 BIO_get_conn_port.3 \ 299 BIO_s_connect.3 BIO_get_conn_port.3 \
300 BIO_s_connect.3 BIO_new_connect.3 \
290 BIO_s_connect.3 BIO_set_conn_hostname.3 \ 301 BIO_s_connect.3 BIO_set_conn_hostname.3 \
291 BIO_s_connect.3 BIO_set_conn_int_port.3 \ 302 BIO_s_connect.3 BIO_set_conn_int_port.3 \
292 BIO_s_connect.3 BIO_set_conn_ip.3 \ 303 BIO_s_connect.3 BIO_set_conn_ip.3 \
@@ -329,6 +340,7 @@ MLINKS+=\
329 BN_BLINDING_new.3 BN_BLINDING_get_flags.3 \ 340 BN_BLINDING_new.3 BN_BLINDING_get_flags.3 \
330 BN_BLINDING_new.3 BN_BLINDING_set_flags.3 \ 341 BN_BLINDING_new.3 BN_BLINDING_set_flags.3 \
331 BN_BLINDING_new.3 BN_BLINDING_set_thread_id.3 \ 342 BN_BLINDING_new.3 BN_BLINDING_set_thread_id.3 \
343 BN_BLINDING_new.3 BN_BLINDING_thread_id.3 \
332 BN_BLINDING_new.3 BN_BLINDING_update.3 \ 344 BN_BLINDING_new.3 BN_BLINDING_update.3 \
333 BN_CTX_new.3 BN_CTX_free.3 \ 345 BN_CTX_new.3 BN_CTX_free.3 \
334 BN_CTX_new.3 BN_CTX_init.3 \ 346 BN_CTX_new.3 BN_CTX_init.3 \
@@ -362,8 +374,13 @@ MLINKS+=\
362 BN_cmp.3 BN_is_zero.3 \ 374 BN_cmp.3 BN_is_zero.3 \
363 BN_cmp.3 BN_ucmp.3 \ 375 BN_cmp.3 BN_ucmp.3 \
364 BN_copy.3 BN_dup.3 \ 376 BN_copy.3 BN_dup.3 \
377 BN_generate_prime.3 BN_GENCB_call.3 \
378 BN_generate_prime.3 BN_GENCB_set.3 \
379 BN_generate_prime.3 BN_GENCB_set_old.3 \
365 BN_generate_prime.3 BN_is_prime.3 \ 380 BN_generate_prime.3 BN_is_prime.3 \
381 BN_generate_prime.3 BN_is_prime_ex.3 \
366 BN_generate_prime.3 BN_is_prime_fasttest.3 \ 382 BN_generate_prime.3 BN_is_prime_fasttest.3 \
383 BN_generate_prime.3 BN_is_prime_fasttest_ex.3 \
367 BN_mod_mul_montgomery.3 BN_MONT_CTX_copy.3 \ 384 BN_mod_mul_montgomery.3 BN_MONT_CTX_copy.3 \
368 BN_mod_mul_montgomery.3 BN_MONT_CTX_free.3 \ 385 BN_mod_mul_montgomery.3 BN_MONT_CTX_free.3 \
369 BN_mod_mul_montgomery.3 BN_MONT_CTX_init.3 \ 386 BN_mod_mul_montgomery.3 BN_MONT_CTX_init.3 \
@@ -383,6 +400,7 @@ MLINKS+=\
383 BN_num_bytes.3 BN_num_bits.3 \ 400 BN_num_bytes.3 BN_num_bits.3 \
384 BN_num_bytes.3 BN_num_bits_word.3 \ 401 BN_num_bytes.3 BN_num_bits_word.3 \
385 BN_rand.3 BN_pseudo_rand.3 \ 402 BN_rand.3 BN_pseudo_rand.3 \
403 BN_rand.3 BN_pseudo_rand_range.3 \
386 BN_rand.3 BN_rand_range.3 \ 404 BN_rand.3 BN_rand_range.3 \
387 BN_set_bit.3 BN_clear_bit.3 \ 405 BN_set_bit.3 BN_clear_bit.3 \
388 BN_set_bit.3 BN_is_bit_set.3 \ 406 BN_set_bit.3 BN_is_bit_set.3 \
@@ -418,6 +436,7 @@ MLINKS+=\
418 CRYPTO_set_locking_callback.3 CRYPTO_w_unlock.3 \ 436 CRYPTO_set_locking_callback.3 CRYPTO_w_unlock.3 \
419 DH_generate_key.3 DH_compute_key.3 \ 437 DH_generate_key.3 DH_compute_key.3 \
420 DH_generate_parameters.3 DH_check.3 \ 438 DH_generate_parameters.3 DH_check.3 \
439 DH_generate_parameters.3 DH_generate_parameters_ex.3 \
421 DH_get_ex_new_index.3 DH_get_ex_data.3 \ 440 DH_get_ex_new_index.3 DH_get_ex_data.3 \
422 DH_get_ex_new_index.3 DH_set_ex_data.3 \ 441 DH_get_ex_new_index.3 DH_set_ex_data.3 \
423 DH_new.3 DH_free.3 \ 442 DH_new.3 DH_free.3 \
@@ -427,6 +446,7 @@ MLINKS+=\
427 DH_set_method.3 DH_new_method.3 \ 446 DH_set_method.3 DH_new_method.3 \
428 DH_set_method.3 DH_set_default_method.3 \ 447 DH_set_method.3 DH_set_default_method.3 \
429 DH_set_method.3 DH_set_default_openssl_method.3 \ 448 DH_set_method.3 DH_set_default_openssl_method.3 \
449 DSA_generate_parameters.3 DSA_generate_parameters_ex.3 \
430 DSA_new.3 DSA_free.3 \ 450 DSA_new.3 DSA_free.3 \
431 DSA_set_method.3 DSA_OpenSSL.3 \ 451 DSA_set_method.3 DSA_OpenSSL.3 \
432 DSA_set_method.3 DSA_get_default_method.3 \ 452 DSA_set_method.3 DSA_get_default_method.3 \
@@ -436,6 +456,101 @@ MLINKS+=\
436 DSA_set_method.3 DSA_set_default_openssl_method.3 \ 456 DSA_set_method.3 DSA_set_default_openssl_method.3 \
437 DSA_sign.3 DSA_sign_setup.3 \ 457 DSA_sign.3 DSA_sign_setup.3 \
438 DSA_sign.3 DSA_verify.3 \ 458 DSA_sign.3 DSA_verify.3 \
459 EC_GFp_simple_method.3 EC_GF2m_simple_method.3 \
460 EC_GFp_simple_method.3 EC_GFp_mont_method.3 \
461 EC_GFp_simple_method.3 EC_GFp_nist_method.3 \
462 EC_GFp_simple_method.3 EC_GFp_nistp224_method.3 \
463 EC_GFp_simple_method.3 EC_GFp_nistp256_method.3 \
464 EC_GFp_simple_method.3 EC_GFp_nistp521_method.3 \
465 EC_GFp_simple_method.3 EC_METHOD_get_field_type.3 \
466 EC_GROUP_copy.3 EC_GROUP_check.3 \
467 EC_GROUP_copy.3 EC_GROUP_check_discriminant.3 \
468 EC_GROUP_copy.3 EC_GROUP_cmp.3 \
469 EC_GROUP_copy.3 EC_GROUP_dup.3 \
470 EC_GROUP_copy.3 EC_GROUP_get0_generator.3 \
471 EC_GROUP_copy.3 EC_GROUP_get0_seed.3 \
472 EC_GROUP_copy.3 EC_GROUP_get_asn1_flag.3 \
473 EC_GROUP_copy.3 EC_GROUP_get_basis_type.3 \
474 EC_GROUP_copy.3 EC_GROUP_get_cofactor.3 \
475 EC_GROUP_copy.3 EC_GROUP_get_curve_name.3 \
476 EC_GROUP_copy.3 EC_GROUP_get_degree.3 \
477 EC_GROUP_copy.3 EC_GROUP_get_order.3 \
478 EC_GROUP_copy.3 EC_GROUP_get_pentanomial_basis.3 \
479 EC_GROUP_copy.3 EC_GROUP_get_point_conversion_form.3 \
480 EC_GROUP_copy.3 EC_GROUP_get_seed_len.3 \
481 EC_GROUP_copy.3 EC_GROUP_get_trinomial_basis.3 \
482 EC_GROUP_copy.3 EC_GROUP_method_of.3 \
483 EC_GROUP_copy.3 EC_GROUP_set_asn1_flag.3 \
484 EC_GROUP_copy.3 EC_GROUP_set_curve_name.3 \
485 EC_GROUP_copy.3 EC_GROUP_set_point_conversion_form.3 \
486 EC_GROUP_copy.3 EC_GROUP_set_seed.3 \
487 EC_GROUP_copy.3 EC_GROUP_set_generator.3 \
488 EC_GROUP_new.3 EC_GROUP_clear_free.3 \
489 EC_GROUP_new.3 EC_GROUP_free.3 \
490 EC_GROUP_new.3 EC_GROUP_get_curve_GF2m.3 \
491 EC_GROUP_new.3 EC_GROUP_get_curve_GFp.3 \
492 EC_GROUP_new.3 EC_GROUP_new_by_curve_name.3 \
493 EC_GROUP_new.3 EC_GROUP_new_curve_GF2m.3 \
494 EC_GROUP_new.3 EC_GROUP_new_curve_GFp.3 \
495 EC_GROUP_new.3 EC_GROUP_set_curve_GF2m.3 \
496 EC_GROUP_new.3 EC_GROUP_set_curve_GFp.3 \
497 EC_GROUP_new.3 EC_get_builtin_curves.3 \
498 EC_KEY_new.3 EC_KEY_check_key.3 \
499 EC_KEY_new.3 EC_KEY_clear_flags.3 \
500 EC_KEY_new.3 EC_KEY_copy.3 \
501 EC_KEY_new.3 EC_KEY_dup.3 \
502 EC_KEY_new.3 EC_KEY_free.3 \
503 EC_KEY_new.3 EC_KEY_generate_key.3 \
504 EC_KEY_new.3 EC_KEY_get0_group.3 \
505 EC_KEY_new.3 EC_KEY_get0_private_key.3 \
506 EC_KEY_new.3 EC_KEY_get0_public_key.3 \
507 EC_KEY_new.3 EC_KEY_get_conv_form.3 \
508 EC_KEY_new.3 EC_KEY_get_enc_flags.3 \
509 EC_KEY_new.3 EC_KEY_get_flags.3 \
510 EC_KEY_new.3 EC_KEY_get_key_method_data.3 \
511 EC_KEY_new.3 EC_KEY_insert_key_method_data.3 \
512 EC_KEY_new.3 EC_KEY_new_by_curve_name.3 \
513 EC_KEY_new.3 EC_KEY_precompute_mult.3 \
514 EC_KEY_new.3 EC_KEY_set_asn1_flag.3 \
515 EC_KEY_new.3 EC_KEY_set_conv_form.3 \
516 EC_KEY_new.3 EC_KEY_set_enc_flags.3 \
517 EC_KEY_new.3 EC_KEY_set_flags.3 \
518 EC_KEY_new.3 EC_KEY_set_group.3 \
519 EC_KEY_new.3 EC_KEY_set_private_key.3 \
520 EC_KEY_new.3 EC_KEY_set_public_key.3 \
521 EC_KEY_new.3 EC_KEY_set_public_key_affine_coordinates.3 \
522 EC_KEY_new.3 EC_KEY_up_ref.3 \
523 EC_POINT_add.3 EC_GROUP_have_precompute_mult.3 \
524 EC_POINT_add.3 EC_GROUP_precompute_mult.3 \
525 EC_POINT_add.3 EC_POINT_cmp.3 \
526 EC_POINT_add.3 EC_POINT_dbl.3 \
527 EC_POINT_add.3 EC_POINT_invert.3 \
528 EC_POINT_add.3 EC_POINT_is_at_infinity.3 \
529 EC_POINT_add.3 EC_POINT_is_on_curve.3 \
530 EC_POINT_add.3 EC_POINT_make_affine.3 \
531 EC_POINT_add.3 EC_POINT_mul.3 \
532 EC_POINT_add.3 EC_POINTs_make_affine.3 \
533 EC_POINT_add.3 EC_POINTs_mul.3 \
534 EC_POINT_new.3 EC_POINT_bn2point.3 \
535 EC_POINT_new.3 EC_POINT_clear_free.3 \
536 EC_POINT_new.3 EC_POINT_copy.3 \
537 EC_POINT_new.3 EC_POINT_dup.3 \
538 EC_POINT_new.3 EC_POINT_free.3 \
539 EC_POINT_new.3 EC_POINT_get_Jprojective_coordinates_GFp.3 \
540 EC_POINT_new.3 EC_POINT_get_affine_coordinates_GF2m.3 \
541 EC_POINT_new.3 EC_POINT_get_affine_coordinates_GFp.3 \
542 EC_POINT_new.3 EC_POINT_hex2point.3 \
543 EC_POINT_new.3 EC_POINT_method_of.3 \
544 EC_POINT_new.3 EC_POINT_oct2point.3 \
545 EC_POINT_new.3 EC_POINT_point2bn.3 \
546 EC_POINT_new.3 EC_POINT_point2hex.3 \
547 EC_POINT_new.3 EC_POINT_point2oct.3 \
548 EC_POINT_new.3 EC_POINT_set_Jprojective_coordinates.3 \
549 EC_POINT_new.3 EC_POINT_set_affine_coordinates_GF2m.3 \
550 EC_POINT_new.3 EC_POINT_set_affine_coordinates_GFp.3 \
551 EC_POINT_new.3 EC_POINT_set_compressed_coordinates_GF2m.3 \
552 EC_POINT_new.3 EC_POINT_set_compressed_coordinates_GFp.3 \
553 EC_POINT_new.3 EC_POINT_set_to_infinity.3 \
439 ERR_GET_LIB.3 ERR_GET_FUNC.3 \ 554 ERR_GET_LIB.3 ERR_GET_FUNC.3 \
440 ERR_GET_LIB.3 ERR_GET_REASON.3 \ 555 ERR_GET_LIB.3 ERR_GET_REASON.3 \
441 ERR_error_string.3 ERR_error_string_n.3 \ 556 ERR_error_string.3 ERR_error_string_n.3 \
@@ -452,6 +567,7 @@ MLINKS+=\
452 ERR_load_strings.3 ERR_get_next_error_library.3 \ 567 ERR_load_strings.3 ERR_get_next_error_library.3 \
453 ERR_print_errors.3 ERR_print_errors_fp.3 \ 568 ERR_print_errors.3 ERR_print_errors_fp.3 \
454 ERR_put_error.3 ERR_add_error_data.3 \ 569 ERR_put_error.3 ERR_add_error_data.3 \
570 ERR_remove_state.3 ERR_remove_thread_state.3 \
455 ERR_set_mark.3 ERR_pop_to_mark.3 \ 571 ERR_set_mark.3 ERR_pop_to_mark.3 \
456 EVP_DigestInit.3 EVP_DigestFinal.3 \ 572 EVP_DigestInit.3 EVP_DigestFinal.3 \
457 EVP_DigestInit.3 EVP_DigestUpdate.3 \ 573 EVP_DigestInit.3 EVP_DigestUpdate.3 \
@@ -504,12 +620,67 @@ MLINKS+=\
504 EVP_EncryptInit.3 EVP_DecryptUpdate.3 \ 620 EVP_EncryptInit.3 EVP_DecryptUpdate.3 \
505 EVP_EncryptInit.3 EVP_EncryptFinal.3 \ 621 EVP_EncryptInit.3 EVP_EncryptFinal.3 \
506 EVP_EncryptInit.3 EVP_EncryptUpdate.3 \ 622 EVP_EncryptInit.3 EVP_EncryptUpdate.3 \
623 EVP_EncryptInit.3 EVP_aes_128_ccm.3 \
624 EVP_EncryptInit.3 EVP_aes_128_gcm.3 \
625 EVP_EncryptInit.3 EVP_aes_192_ccm.3 \
626 EVP_EncryptInit.3 EVP_aes_192_gcm.3 \
627 EVP_EncryptInit.3 EVP_aes_256_ccm.3 \
628 EVP_EncryptInit.3 EVP_aes_256_gcm.3 \
629 EVP_EncryptInit.3 EVP_bf_cbc.3 \
630 EVP_EncryptInit.3 EVP_bf_cfb.3 \
631 EVP_EncryptInit.3 EVP_bf_ecb.3 \
632 EVP_EncryptInit.3 EVP_bf_ofb.3 \
633 EVP_EncryptInit.3 EVP_cast5_cbc.3 \
634 EVP_EncryptInit.3 EVP_cast5_cfb.3 \
635 EVP_EncryptInit.3 EVP_cast5_ecb.3 \
636 EVP_EncryptInit.3 EVP_cast5_ofb.3 \
637 EVP_EncryptInit.3 EVP_des_cbc.3 \
638 EVP_EncryptInit.3 EVP_des_cfb.3 \
639 EVP_EncryptInit.3 EVP_des_ecb.3 \
640 EVP_EncryptInit.3 EVP_des_ede.3 \
641 EVP_EncryptInit.3 EVP_des_ede3.3 \
642 EVP_EncryptInit.3 EVP_des_ede3_cbc.3 \
643 EVP_EncryptInit.3 EVP_des_ede3_cfb.3 \
644 EVP_EncryptInit.3 EVP_des_ede3_ofb.3 \
645 EVP_EncryptInit.3 EVP_des_ede_cbc.3 \
646 EVP_EncryptInit.3 EVP_des_ede_cfb.3 \
647 EVP_EncryptInit.3 EVP_des_ede_ofb.3 \
648 EVP_EncryptInit.3 EVP_des_ofb.3 \
649 EVP_EncryptInit.3 EVP_desx_cbc.3 \
650 EVP_EncryptInit.3 EVP_enc_null.3 \
507 EVP_EncryptInit.3 EVP_get_cipherbyname.3 \ 651 EVP_EncryptInit.3 EVP_get_cipherbyname.3 \
508 EVP_EncryptInit.3 EVP_get_cipherbynid.3 \ 652 EVP_EncryptInit.3 EVP_get_cipherbynid.3 \
509 EVP_EncryptInit.3 EVP_get_cipherbyobj.3 \ 653 EVP_EncryptInit.3 EVP_get_cipherbyobj.3 \
654 EVP_EncryptInit.3 EVP_idea_cbc.3 \
655 EVP_EncryptInit.3 EVP_idea_cbc.3 \
656 EVP_EncryptInit.3 EVP_idea_cfb.3 \
657 EVP_EncryptInit.3 EVP_idea_ecb.3 \
658 EVP_EncryptInit.3 EVP_idea_ofb.3 \
659 EVP_EncryptInit.3 EVP_rc2_40_cbc.3 \
660 EVP_EncryptInit.3 EVP_rc2_64_cbc.3 \
661 EVP_EncryptInit.3 EVP_rc2_cbc.3 \
662 EVP_EncryptInit.3 EVP_rc2_cfb.3 \
663 EVP_EncryptInit.3 EVP_rc2_ecb.3 \
664 EVP_EncryptInit.3 EVP_rc2_ofb.3 \
665 EVP_EncryptInit.3 EVP_rc4.3 \
666 EVP_EncryptInit.3 EVP_rc4_40.3 \
667 EVP_EncryptInit.3 EVP_rc5_32_12_16_cbc.3 \
668 EVP_EncryptInit.3 EVP_rc5_32_12_16_cfb.3 \
669 EVP_EncryptInit.3 EVP_rc5_32_12_16_ecb.3 \
670 EVP_EncryptInit.3 EVP_rc5_32_12_16_ofb.3 \
510 EVP_OpenInit.3 EVP_OpenFinal.3 \ 671 EVP_OpenInit.3 EVP_OpenFinal.3 \
511 EVP_OpenInit.3 EVP_OpenUpdate.3 \ 672 EVP_OpenInit.3 EVP_OpenUpdate.3 \
673 EVP_PKEY_CTX_ctrl.3 EVP_PKEY_CTX_set_dh_paramgen_generator.3 \
674 EVP_PKEY_CTX_ctrl.3 EVP_PKEY_CTX_set_dh_paramgen_prime_len.3 \
675 EVP_PKEY_CTX_ctrl.3 EVP_PKEY_CTX_set_dsa_paramgen_bits.3 \
676 EVP_PKEY_CTX_ctrl.3 EVP_PKEY_CTX_set_ec_paramgen_curve_nid.3 \
677 EVP_PKEY_CTX_ctrl.3 EVP_PKEY_CTX_set_rsa_keygen_pubexp.3 \
678 EVP_PKEY_CTX_ctrl.3 EVP_PKEY_CTX_set_rsa_padding.3 \
679 EVP_PKEY_CTX_ctrl.3 EVP_PKEY_CTX_set_rsa_pss_saltlen.3 \
680 EVP_PKEY_CTX_ctrl.3 EVP_PKEY_CTX_set_rsa_rsa_keygen_bits.3 \
681 EVP_PKEY_CTX_ctrl.3 EVP_PKEY_CTX_set_signature_md.3 \
512 EVP_PKEY_CTX_ctrl.3 EVP_PKEY_ctrl_str.3 \ 682 EVP_PKEY_CTX_ctrl.3 EVP_PKEY_ctrl_str.3 \
683 EVP_PKEY_CTX_ctrl.3 EVP_PKEY_get_default_digest_nid.3 \
513 EVP_PKEY_CTX_new.3 EVP_PKEY_CTX_new_id.3 \ 684 EVP_PKEY_CTX_new.3 EVP_PKEY_CTX_new_id.3 \
514 EVP_PKEY_CTX_new.3 EVP_PKEY_CTX_dup.3 \ 685 EVP_PKEY_CTX_new.3 EVP_PKEY_CTX_dup.3 \
515 EVP_PKEY_CTX_new.3 EVP_PKEY_CTX_free.3 \ 686 EVP_PKEY_CTX_new.3 EVP_PKEY_CTX_free.3 \
@@ -589,6 +760,7 @@ MLINKS+=\
589 OpenSSL_add_all_algorithms.3 EVP_cleanup.3 \ 760 OpenSSL_add_all_algorithms.3 EVP_cleanup.3 \
590 OpenSSL_add_all_algorithms.3 OpenSSL_add_all_ciphers.3 \ 761 OpenSSL_add_all_algorithms.3 OpenSSL_add_all_ciphers.3 \
591 OpenSSL_add_all_algorithms.3 OpenSSL_add_all_digests.3 \ 762 OpenSSL_add_all_algorithms.3 OpenSSL_add_all_digests.3 \
763 PKCS5_PBKDF2_HMAC.3 PKCS5_PBKDF2_HMAC_SHA1.3 \
592 PEM_read_bio_PrivateKey.3 PEM_read_DHparams.3 \ 764 PEM_read_bio_PrivateKey.3 PEM_read_DHparams.3 \
593 PEM_read_bio_PrivateKey.3 PEM_read_DSAPrivateKey.3 \ 765 PEM_read_bio_PrivateKey.3 PEM_read_DSAPrivateKey.3 \
594 PEM_read_bio_PrivateKey.3 PEM_read_DSA_PUBKEY.3 \ 766 PEM_read_bio_PrivateKey.3 PEM_read_DSA_PUBKEY.3 \
@@ -654,6 +826,7 @@ MLINKS+=\
654 PEM_read_bio_PrivateKey.3 PEM_write_bio_X509_CRL.3 \ 826 PEM_read_bio_PrivateKey.3 PEM_write_bio_X509_CRL.3 \
655 PEM_read_bio_PrivateKey.3 PEM_write_bio_X509_REQ.3 \ 827 PEM_read_bio_PrivateKey.3 PEM_write_bio_X509_REQ.3 \
656 PEM_read_bio_PrivateKey.3 PEM_write_bio_X509_REQ_NEW.3 \ 828 PEM_read_bio_PrivateKey.3 PEM_write_bio_X509_REQ_NEW.3 \
829 PKCS7_verify.3 PKCS7_get0_signers.3 \
657 RAND_add.3 RAND_seed.3 \ 830 RAND_add.3 RAND_seed.3 \
658 RAND_add.3 RAND_status.3 \ 831 RAND_add.3 RAND_status.3 \
659 RAND_bytes.3 RAND_pseudo_bytes.3 \ 832 RAND_bytes.3 RAND_pseudo_bytes.3 \
@@ -666,6 +839,7 @@ MLINKS+=\
666 RIPEMD160.3 RIPEMD160_Init.3 \ 839 RIPEMD160.3 RIPEMD160_Init.3 \
667 RIPEMD160.3 RIPEMD160_Update.3 \ 840 RIPEMD160.3 RIPEMD160_Update.3 \
668 RSA_blinding_on.3 RSA_blinding_off.3 \ 841 RSA_blinding_on.3 RSA_blinding_off.3 \
842 RSA_generate_key.3 RSA_generate_key_ex.3 \
669 RSA_get_ex_new_index.3 RSA_get_ex_data.3 \ 843 RSA_get_ex_new_index.3 RSA_get_ex_data.3 \
670 RSA_get_ex_new_index.3 RSA_set_ex_data.3 \ 844 RSA_get_ex_new_index.3 RSA_set_ex_data.3 \
671 RSA_new.3 RSA_free.3 \ 845 RSA_new.3 RSA_free.3 \
@@ -783,6 +957,13 @@ MLINKS+=\
783 d2i_DSAPublicKey.3 i2d_DSA_PUBKEY.3 \ 957 d2i_DSAPublicKey.3 i2d_DSA_PUBKEY.3 \
784 d2i_DSAPublicKey.3 i2d_DSA_SIG.3 \ 958 d2i_DSAPublicKey.3 i2d_DSA_SIG.3 \
785 d2i_DSAPublicKey.3 i2d_DSAparams.3 \ 959 d2i_DSAPublicKey.3 i2d_DSAparams.3 \
960 d2i_ECPKParameters.3 ECPKParameters_print.3 \
961 d2i_ECPKParameters.3 ECPKParameters_print_fp.3 \
962 d2i_ECPKParameters.3 d2i_ECPKParameters_bio.3 \
963 d2i_ECPKParameters.3 d2i_ECPKParameters_fp.3 \
964 d2i_ECPKParameters.3 i2d_ECPKParameters.3 \
965 d2i_ECPKParameters.3 i2d_ECPKParameters_bio.3 \
966 d2i_ECPKParameters.3 i2d_ECPKParameters_fp.3 \
786 d2i_PKCS8PrivateKey.3 d2i_PKCS8PrivateKey_bio.3 \ 967 d2i_PKCS8PrivateKey.3 d2i_PKCS8PrivateKey_bio.3 \
787 d2i_PKCS8PrivateKey.3 d2i_PKCS8PrivateKey_fp.3 \ 968 d2i_PKCS8PrivateKey.3 d2i_PKCS8PrivateKey_fp.3 \
788 d2i_PKCS8PrivateKey.3 i2d_PKCS8PrivateKey_bio.3 \ 969 d2i_PKCS8PrivateKey.3 i2d_PKCS8PrivateKey_bio.3 \
diff --git a/src/lib/libssl/man/Makefile b/src/lib/libssl/man/Makefile
index 00414ad322..8af3072702 100644
--- a/src/lib/libssl/man/Makefile
+++ b/src/lib/libssl/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.25 2014/04/16 09:50:10 mpi Exp $ 1# $OpenBSD: Makefile,v 1.26 2014/07/11 16:18:13 miod Exp $
2 2
3.include <bsd.own.mk> # for NOMAN 3.include <bsd.own.mk> # for NOMAN
4 4
@@ -122,6 +122,18 @@ MLINKS+=\
122 SSL_CTX_get_verify_mode.3 SSL_get_verify_callback.3 \ 122 SSL_CTX_get_verify_mode.3 SSL_get_verify_callback.3 \
123 SSL_CTX_get_verify_mode.3 SSL_get_verify_depth.3 \ 123 SSL_CTX_get_verify_mode.3 SSL_get_verify_depth.3 \
124 SSL_CTX_get_verify_mode.3 SSL_get_verify_mode.3 \ 124 SSL_CTX_get_verify_mode.3 SSL_get_verify_mode.3 \
125 SSL_CTX_new.3 SSLv23_client_method.3 \
126 SSL_CTX_new.3 SSLv23_method.3 \
127 SSL_CTX_new.3 SSLv23_server_method.3 \
128 SSL_CTX_new.3 SSLv3_client_method.3 \
129 SSL_CTX_new.3 SSLv3_method.3 \
130 SSL_CTX_new.3 SSLv3_server_method.3 \
131 SSL_CTX_new.3 TLSv1_1_client_method.3 \
132 SSL_CTX_new.3 TLSv1_1_method.3 \
133 SSL_CTX_new.3 TLSv1_1_server_method.3 \
134 SSL_CTX_new.3 TLSv1_client_method.3 \
135 SSL_CTX_new.3 TLSv1_method.3 \
136 SSL_CTX_new.3 TLSv1_server_method.3 \
125 SSL_CTX_sess_number.3 SSL_CTX_sess_accept.3 \ 137 SSL_CTX_sess_number.3 SSL_CTX_sess_accept.3 \
126 SSL_CTX_sess_number.3 SSL_CTX_sess_accept_good.3 \ 138 SSL_CTX_sess_number.3 SSL_CTX_sess_accept_good.3 \
127 SSL_CTX_sess_number.3 SSL_CTX_sess_accept_renegotiate.3 \ 139 SSL_CTX_sess_number.3 SSL_CTX_sess_accept_renegotiate.3 \
diff --git a/src/lib/libssl/src/doc/apps/verify.pod b/src/lib/libssl/src/doc/apps/verify.pod
index df448ce40d..427d463dae 100644
--- a/src/lib/libssl/src/doc/apps/verify.pod
+++ b/src/lib/libssl/src/doc/apps/verify.pod
@@ -385,7 +385,7 @@ an application specific error. Unused.
385 385
386=head1 BUGS 386=head1 BUGS
387 387
388Although the issuer checks are a considerably improvement over the old technique they still 388Although the issuer checks are a considerable improvement over the old technique they still
389suffer from limitations in the underlying X509_LOOKUP API. One consequence of this is that 389suffer from limitations in the underlying X509_LOOKUP API. One consequence of this is that
390trusted certificates with matching subject name must either appear in a file (as specified by the 390trusted certificates with matching subject name must either appear in a file (as specified by the
391B<-CAfile> option) or a directory (as specified by B<-CApath>. If they occur in both then only 391B<-CAfile> option) or a directory (as specified by B<-CApath>. If they occur in both then only
diff --git a/src/lib/libssl/src/doc/crypto/ASN1_STRING_length.pod b/src/lib/libssl/src/doc/crypto/ASN1_STRING_length.pod
index a08e9a0fa4..f651e4f2ae 100644
--- a/src/lib/libssl/src/doc/crypto/ASN1_STRING_length.pod
+++ b/src/lib/libssl/src/doc/crypto/ASN1_STRING_length.pod
@@ -3,7 +3,7 @@
3=head1 NAME 3=head1 NAME
4 4
5ASN1_STRING_dup, ASN1_STRING_cmp, ASN1_STRING_set, ASN1_STRING_length, 5ASN1_STRING_dup, ASN1_STRING_cmp, ASN1_STRING_set, ASN1_STRING_length,
6ASN1_STRING_length_set, ASN1_STRING_type, ASN1_STRING_data - 6ASN1_STRING_length_set, ASN1_STRING_type, ASN1_STRING_data, ASN1_STRING_to_UTF8 -
7ASN1_STRING utility functions 7ASN1_STRING utility functions
8 8
9=head1 SYNOPSIS 9=head1 SYNOPSIS
diff --git a/src/lib/libssl/src/doc/crypto/ASN1_STRING_print_ex.pod b/src/lib/libssl/src/doc/crypto/ASN1_STRING_print_ex.pod
index 666ac551cd..a93047a040 100644
--- a/src/lib/libssl/src/doc/crypto/ASN1_STRING_print_ex.pod
+++ b/src/lib/libssl/src/doc/crypto/ASN1_STRING_print_ex.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5ASN1_STRING_print_ex, ASN1_STRING_print_ex_fp - ASN1_STRING output routines. 5ASN1_STRING_print_ex, ASN1_STRING_print_ex_fp, ASN1_STRING_print - ASN1_STRING output routines.
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
diff --git a/src/lib/libssl/src/doc/crypto/ASN1_generate_nconf.pod b/src/lib/libssl/src/doc/crypto/ASN1_generate_nconf.pod
index fee7398bd4..4b8a937a66 100644
--- a/src/lib/libssl/src/doc/crypto/ASN1_generate_nconf.pod
+++ b/src/lib/libssl/src/doc/crypto/ASN1_generate_nconf.pod
@@ -61,7 +61,7 @@ Encode the B<NULL> type, the B<value> string must not be present.
61=item B<INTEGER>, B<INT> 61=item B<INTEGER>, B<INT>
62 62
63Encodes an ASN1 B<INTEGER> type. The B<value> string represents 63Encodes an ASN1 B<INTEGER> type. The B<value> string represents
64the value of the integer, it can be preceeded by a minus sign and 64the value of the integer, it can be prefaced by a minus sign and
65is normally interpreted as a decimal value unless the prefix B<0x> 65is normally interpreted as a decimal value unless the prefix B<0x>
66is included. 66is included.
67 67
diff --git a/src/lib/libssl/src/doc/crypto/BIO_f_base64.pod b/src/lib/libssl/src/doc/crypto/BIO_f_base64.pod
index d9ec3b518b..c1c3137d5e 100644
--- a/src/lib/libssl/src/doc/crypto/BIO_f_base64.pod
+++ b/src/lib/libssl/src/doc/crypto/BIO_f_base64.pod
@@ -46,11 +46,11 @@ to standard output:
46 46
47 b64 = BIO_new(BIO_f_base64()); 47 b64 = BIO_new(BIO_f_base64());
48 bio = BIO_new_fp(stdout, BIO_NOCLOSE); 48 bio = BIO_new_fp(stdout, BIO_NOCLOSE);
49 bio = BIO_push(b64, bio); 49 BIO_push(b64, bio);
50 BIO_write(bio, message, strlen(message)); 50 BIO_write(b64, message, strlen(message));
51 BIO_flush(bio); 51 BIO_flush(b64);
52 52
53 BIO_free_all(bio); 53 BIO_free_all(b64);
54 54
55Read Base64 encoded data from standard input and write the decoded 55Read Base64 encoded data from standard input and write the decoded
56data to standard output: 56data to standard output:
@@ -62,11 +62,12 @@ data to standard output:
62 b64 = BIO_new(BIO_f_base64()); 62 b64 = BIO_new(BIO_f_base64());
63 bio = BIO_new_fp(stdin, BIO_NOCLOSE); 63 bio = BIO_new_fp(stdin, BIO_NOCLOSE);
64 bio_out = BIO_new_fp(stdout, BIO_NOCLOSE); 64 bio_out = BIO_new_fp(stdout, BIO_NOCLOSE);
65 bio = BIO_push(b64, bio); 65 BIO_push(b64, bio);
66 while((inlen = BIO_read(bio, inbuf, 512)) > 0) 66 while((inlen = BIO_read(b64, inbuf, 512)) > 0)
67 BIO_write(bio_out, inbuf, inlen); 67 BIO_write(bio_out, inbuf, inlen);
68 68
69 BIO_free_all(bio); 69 BIO_flush(bio_out);
70 BIO_free_all(b64);
70 71
71=head1 BUGS 72=head1 BUGS
72 73
diff --git a/src/lib/libssl/src/doc/crypto/BIO_find_type.pod b/src/lib/libssl/src/doc/crypto/BIO_find_type.pod
index 03200a1b6b..a57d42f526 100644
--- a/src/lib/libssl/src/doc/crypto/BIO_find_type.pod
+++ b/src/lib/libssl/src/doc/crypto/BIO_find_type.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5BIO_find_type, BIO_next - BIO chain traversal 5BIO_find_type, BIO_next, BIO_method_type - BIO chain traversal
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
diff --git a/src/lib/libssl/src/doc/crypto/BIO_s_accept.pod b/src/lib/libssl/src/doc/crypto/BIO_s_accept.pod
index 935d464748..5729d38193 100644
--- a/src/lib/libssl/src/doc/crypto/BIO_s_accept.pod
+++ b/src/lib/libssl/src/doc/crypto/BIO_s_accept.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5BIO_s_accept, BIO_set_accept_port, BIO_get_accept_port, 5BIO_s_accept, BIO_set_accept_port, BIO_get_accept_port, BIO_new_accept,
6BIO_set_nbio_accept, BIO_set_accept_bios, BIO_set_bind_mode, 6BIO_set_nbio_accept, BIO_set_accept_bios, BIO_set_bind_mode,
7BIO_get_bind_mode, BIO_do_accept - accept BIO 7BIO_get_bind_mode, BIO_do_accept - accept BIO
8 8
diff --git a/src/lib/libssl/src/doc/crypto/BIO_s_connect.pod b/src/lib/libssl/src/doc/crypto/BIO_s_connect.pod
index 7cad0e3f0f..45832e52f3 100644
--- a/src/lib/libssl/src/doc/crypto/BIO_s_connect.pod
+++ b/src/lib/libssl/src/doc/crypto/BIO_s_connect.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5BIO_s_connect, BIO_set_conn_hostname, BIO_set_conn_port, 5BIO_s_connect, BIO_new_connect, BIO_set_conn_hostname, BIO_set_conn_port,
6BIO_set_conn_ip, BIO_set_conn_int_port, BIO_get_conn_hostname, 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, 7BIO_get_conn_port, BIO_get_conn_ip, BIO_get_conn_int_port,
8BIO_set_nbio, BIO_do_connect - connect BIO 8BIO_set_nbio, BIO_do_connect - connect BIO
diff --git a/src/lib/libssl/src/doc/crypto/BN_BLINDING_new.pod b/src/lib/libssl/src/doc/crypto/BN_BLINDING_new.pod
index 3e783ff8ac..1c586ac54e 100644
--- a/src/lib/libssl/src/doc/crypto/BN_BLINDING_new.pod
+++ b/src/lib/libssl/src/doc/crypto/BN_BLINDING_new.pod
@@ -4,9 +4,9 @@
4 4
5BN_BLINDING_new, BN_BLINDING_free, BN_BLINDING_update, BN_BLINDING_convert, 5BN_BLINDING_new, BN_BLINDING_free, BN_BLINDING_update, BN_BLINDING_convert,
6BN_BLINDING_invert, BN_BLINDING_convert_ex, BN_BLINDING_invert_ex, 6BN_BLINDING_invert, BN_BLINDING_convert_ex, BN_BLINDING_invert_ex,
7BN_BLINDING_get_thread_id, BN_BLINDING_set_thread_id, BN_BLINDING_get_flags, 7BN_BLINDING_get_thread_id, BN_BLINDING_set_thread_id, BN_BLINDING_thread_id,
8BN_BLINDING_set_flags, BN_BLINDING_create_param - blinding related BIGNUM 8BN_BLINDING_get_flags, BN_BLINDING_set_flags,
9functions. 9BN_BLINDING_create_param - blinding related BIGNUM functions.
10 10
11=head1 SYNOPSIS 11=head1 SYNOPSIS
12 12
diff --git a/src/lib/libssl/src/doc/crypto/BN_CTX_new.pod b/src/lib/libssl/src/doc/crypto/BN_CTX_new.pod
index ad8d07db89..bbedbb1778 100644
--- a/src/lib/libssl/src/doc/crypto/BN_CTX_new.pod
+++ b/src/lib/libssl/src/doc/crypto/BN_CTX_new.pod
@@ -10,9 +10,12 @@ BN_CTX_new, BN_CTX_init, BN_CTX_free - allocate and free BN_CTX structures
10 10
11 BN_CTX *BN_CTX_new(void); 11 BN_CTX *BN_CTX_new(void);
12 12
13 void BN_CTX_free(BN_CTX *c);
14
15Deprecated:
16
13 void BN_CTX_init(BN_CTX *c); 17 void BN_CTX_init(BN_CTX *c);
14 18
15 void BN_CTX_free(BN_CTX *c);
16 19
17=head1 DESCRIPTION 20=head1 DESCRIPTION
18 21
@@ -22,8 +25,7 @@ is rather expensive when used in conjunction with repeated subroutine
22calls, the B<BN_CTX> structure is used. 25calls, the B<BN_CTX> structure is used.
23 26
24BN_CTX_new() allocates and initializes a B<BN_CTX> 27BN_CTX_new() allocates and initializes a B<BN_CTX>
25structure. BN_CTX_init() initializes an existing uninitialized 28structure.
26B<BN_CTX>.
27 29
28BN_CTX_free() frees the components of the B<BN_CTX>, and if it was 30BN_CTX_free() frees the components of the B<BN_CTX>, and if it was
29created by BN_CTX_new(), also the structure itself. 31created by BN_CTX_new(), also the structure itself.
@@ -31,6 +33,8 @@ If L<BN_CTX_start(3)|BN_CTX_start(3)> has been used on the B<BN_CTX>,
31L<BN_CTX_end(3)|BN_CTX_end(3)> must be called before the B<BN_CTX> 33L<BN_CTX_end(3)|BN_CTX_end(3)> must be called before the B<BN_CTX>
32may be freed by BN_CTX_free(). 34may be freed by BN_CTX_free().
33 35
36BN_CTX_init() (deprecated) initializes an existing uninitialized B<BN_CTX>.
37This should not be used for new programs. Use BN_CTX_new() instead.
34 38
35=head1 RETURN VALUES 39=head1 RETURN VALUES
36 40
diff --git a/src/lib/libssl/src/doc/crypto/BN_generate_prime.pod b/src/lib/libssl/src/doc/crypto/BN_generate_prime.pod
index 2c5e6fae0f..0a95633d54 100644
--- a/src/lib/libssl/src/doc/crypto/BN_generate_prime.pod
+++ b/src/lib/libssl/src/doc/crypto/BN_generate_prime.pod
@@ -2,14 +2,32 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5BN_generate_prime, BN_is_prime, BN_is_prime_fasttest - generate primes and test 5BN_generate_prime, BN_is_prime_ex, BN_is_prime_fasttest_ex, BN_GENCB_call,
6for primality 6BN_GENCB_set_old, BN_GENCB_set, BN_generate_prime, BN_is_prime,
7BN_is_prime_fasttest - generate primes and test for primality
7 8
8=head1 SYNOPSIS 9=head1 SYNOPSIS
9 10
10 #include <openssl/bn.h> 11 #include <openssl/bn.h>
11 12
12 BIGNUM *BN_generate_prime(BIGNUM *ret, int num, int safe, BIGNUM *add, 13 int BN_generate_prime_ex(BIGNUM *ret,int bits,int safe, const BIGNUM *add,
14 const BIGNUM *rem, BN_GENCB *cb);
15
16 int BN_is_prime_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, BN_GENCB *cb);
17
18 int BN_is_prime_fasttest_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx,
19 int do_trial_division, BN_GENCB *cb);
20
21 int BN_GENCB_call(BN_GENCB *cb, int a, int b);
22
23 #define BN_GENCB_set_old(gencb, callback, cb_arg) ...
24
25 #define BN_GENCB_set(gencb, callback, cb_arg) ...
26
27
28Deprecated:
29
30BIGNUM *BN_generate_prime(BIGNUM *ret, int num, int safe, BIGNUM *add,
13 BIGNUM *rem, void (*callback)(int, int, void *), void *cb_arg); 31 BIGNUM *rem, void (*callback)(int, int, void *), void *cb_arg);
14 32
15 int BN_is_prime(const BIGNUM *a, int checks, void (*callback)(int, int, 33 int BN_is_prime(const BIGNUM *a, int checks, void (*callback)(int, int,
@@ -21,27 +39,27 @@ for primality
21 39
22=head1 DESCRIPTION 40=head1 DESCRIPTION
23 41
24BN_generate_prime() generates a pseudo-random prime number of B<num> 42BN_generate_prime_ex() generates a pseudo-random prime number of
25bits. 43bit length B<bits>.
26If B<ret> is not B<NULL>, it will be used to store the number. 44If B<ret> is not B<NULL>, it will be used to store the number.
27 45
28If B<callback> is not B<NULL>, it is called as follows: 46If B<cb> is not B<NULL>, it is used as follows:
29 47
30=over 4 48=over 4
31 49
32=item * 50=item *
33 51
34B<callback(0, i, cb_arg)> is called after generating the i-th 52B<BN_GENCB_call(cb, 0, i)> is called after generating the i-th
35potential prime number. 53potential prime number.
36 54
37=item * 55=item *
38 56
39While the number is being tested for primality, B<callback(1, j, 57While the number is being tested for primality,
40cb_arg)> is called as described below. 58B<BN_GENCB_call(cb, 1, j)> is called as described below.
41 59
42=item * 60=item *
43 61
44When a prime has been found, B<callback(2, i, cb_arg)> is called. 62When a prime has been found, B<BN_GENCB_call(cb, 2, i)> is called.
45 63
46=back 64=back
47 65
@@ -57,35 +75,64 @@ that (p-1)/2 is also prime).
57 75
58The prime number generation has a negligible error probability. 76The prime number generation has a negligible error probability.
59 77
60BN_is_prime() and BN_is_prime_fasttest() test if the number B<a> is 78BN_is_prime_ex() and BN_is_prime_fasttest_ex() test if the number B<p> is
61prime. The following tests are performed until one of them shows that 79prime. The following tests are performed until one of them shows that
62B<a> is composite; if B<a> passes all these tests, it is considered 80B<p> is composite; if B<p> passes all these tests, it is considered
63prime. 81prime.
64 82
65BN_is_prime_fasttest(), when called with B<do_trial_division == 1>, 83BN_is_prime_fasttest_ex(), when called with B<do_trial_division == 1>,
66first attempts trial division by a number of small primes; 84first attempts trial division by a number of small primes;
67if no divisors are found by this test and B<callback> is not B<NULL>, 85if no divisors are found by this test and B<cb> is not B<NULL>,
68B<callback(1, -1, cb_arg)> is called. 86B<BN_GENCB_call(cb, 1, -1)> is called.
69If B<do_trial_division == 0>, this test is skipped. 87If B<do_trial_division == 0>, this test is skipped.
70 88
71Both BN_is_prime() and BN_is_prime_fasttest() perform a Miller-Rabin 89Both BN_is_prime_ex() and BN_is_prime_fasttest_ex() perform a Miller-Rabin
72probabilistic primality test with B<checks> iterations. If 90probabilistic primality test with B<nchecks> iterations. If
73B<checks == BN_prime_checks>, a number of iterations is used that 91B<nchecks == BN_prime_checks>, a number of iterations is used that
74yields a false positive rate of at most 2^-80 for random input. 92yields a false positive rate of at most 2^-80 for random input.
75 93
76If B<callback> is not B<NULL>, B<callback(1, j, cb_arg)> is called 94If B<cb> is not B<NULL>, B<BN_GENCB_call(cb, 1, j)> is called
77after the j-th iteration (j = 0, 1, ...). B<ctx> is a 95after the j-th iteration (j = 0, 1, ...). B<ctx> is a
78pre-allocated B<BN_CTX> (to save the overhead of allocating and 96pre-allocated B<BN_CTX> (to save the overhead of allocating and
79freeing the structure in a loop), or B<NULL>. 97freeing the structure in a loop), or B<NULL>.
80 98
99BN_GENCB_call calls the callback function held in the B<BN_GENCB> structure
100and passes the ints B<a> and B<b> as arguments. There are two types of
101B<BN_GENCB> structure that are supported: "new" style and "old" style. New
102programs should prefer the "new" style, whilst the "old" style is provided
103for backwards compatibility purposes.
104
105For "new" style callbacks a BN_GENCB structure should be initialised with a
106call to BN_GENCB_set, where B<gencb> is a B<BN_GENCB *>, B<callback> is of
107type B<int (*callback)(int, int, BN_GENCB *)> and B<cb_arg> is a B<void *>.
108"Old" style callbacks are the same except they are initialised with a call
109to BN_GENCB_set_old and B<callback> is of type
110B<void (*callback)(int, int, void *)>.
111
112A callback is invoked through a call to B<BN_GENCB_call>. This will check
113the type of the callback and will invoke B<callback(a, b, gencb)> for new
114style callbacks or B<callback(a, b, cb_arg)> for old style.
115
116BN_generate_prime (deprecated) works in the same way as
117BN_generate_prime_ex but expects an old style callback function
118directly in the B<callback> parameter, and an argument to pass to it in
119the B<cb_arg>. Similarly BN_is_prime and BN_is_prime_fasttest are
120deprecated and can be compared to BN_is_prime_ex and
121BN_is_prime_fasttest_ex respectively.
122
81=head1 RETURN VALUES 123=head1 RETURN VALUES
82 124
83BN_generate_prime() returns the prime number on success, B<NULL> otherwise. 125BN_generate_prime_ex() returns 1 on success or 0 on error.
84 126
85BN_is_prime() returns 0 if the number is composite, 1 if it is 127BN_is_prime_ex(), BN_is_prime_fasttest_ex(), BN_is_prime() and
86prime with an error probability of less than 0.25^B<checks>, and 128BN_is_prime_fasttest() return 0 if the number is composite, 1 if it is
129prime with an error probability of less than 0.25^B<nchecks>, and
87-1 on error. 130-1 on error.
88 131
132BN_generate_prime() returns the prime number on success, B<NULL> otherwise.
133
134Callback functions should return 1 on success or 0 on error.
135
89The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. 136The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
90 137
91=head1 SEE ALSO 138=head1 SEE ALSO
diff --git a/src/lib/libssl/src/doc/crypto/BN_rand.pod b/src/lib/libssl/src/doc/crypto/BN_rand.pod
index 70f435b203..471010cbb0 100644
--- a/src/lib/libssl/src/doc/crypto/BN_rand.pod
+++ b/src/lib/libssl/src/doc/crypto/BN_rand.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5BN_rand, BN_pseudo_rand - generate pseudo-random number 5BN_rand, BN_pseudo_rand, BN_rand_range, BN_pseudo_rand_range - generate pseudo-random number
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
diff --git a/src/lib/libssl/src/doc/crypto/CMS_add0_cert.pod b/src/lib/libssl/src/doc/crypto/CMS_add0_cert.pod
index 3f042dc302..b289237ec2 100644
--- a/src/lib/libssl/src/doc/crypto/CMS_add0_cert.pod
+++ b/src/lib/libssl/src/doc/crypto/CMS_add0_cert.pod
@@ -2,8 +2,8 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5CMS_add0_cert, CMS_add1_cert, CMS_get1_certs, CMS_add0_crl, CMS_get1_crls, - 5CMS_add0_cert, CMS_add1_cert, CMS_get1_certs, CMS_add0_crl, CMS_add1_crl,
6CMS certificate and CRL utility functions 6CMS_get1_crls - CMS certificate and CRL utility functions
7 7
8=head1 SYNOPSIS 8=head1 SYNOPSIS
9 9
diff --git a/src/lib/libssl/src/doc/crypto/CMS_decrypt.pod b/src/lib/libssl/src/doc/crypto/CMS_decrypt.pod
index 403aa98d04..3b44cec603 100644
--- a/src/lib/libssl/src/doc/crypto/CMS_decrypt.pod
+++ b/src/lib/libssl/src/doc/crypto/CMS_decrypt.pod
@@ -27,7 +27,21 @@ function or errors about unknown algorithms will occur.
27 27
28Although the recipients certificate is not needed to decrypt the data it is 28Although the recipients certificate is not needed to decrypt the data it is
29needed to locate the appropriate (of possible several) recipients in the CMS 29needed to locate the appropriate (of possible several) recipients in the CMS
30structure. If B<cert> is set to NULL all possible recipients are tried. 30structure.
31
32If B<cert> is set to NULL all possible recipients are tried. This case however
33is problematic. To thwart the MMA attack (Bleichenbacher's attack on
34PKCS #1 v1.5 RSA padding) all recipients are tried whether they succeed or
35not. If no recipient succeeds then a random symmetric key is used to decrypt
36the content: this will typically output garbage and may (but is not guaranteed
37to) ultimately return a padding error only. If CMS_decrypt() just returned an
38error when all recipient encrypted keys failed to decrypt an attacker could
39use this in a timing attack. If the special flag B<CMS_DEBUG_DECRYPT> is set
40then the above behaviour is modified and an error B<is> returned if no
41recipient encrypted key can be decrypted B<without> generating a random
42content encryption key. Applications should use this flag with
43B<extreme caution> especially in automated gateways as it can leave them
44open to attack.
31 45
32It is possible to determine the correct recipient key by other means (for 46It is possible to determine the correct recipient key by other means (for
33example looking them up in a database) and setting them in the CMS structure 47example looking them up in a database) and setting them in the CMS structure
diff --git a/src/lib/libssl/src/doc/crypto/CMS_get0_RecipientInfos.pod b/src/lib/libssl/src/doc/crypto/CMS_get0_RecipientInfos.pod
index d9c4cb774b..da3914c0c0 100644
--- a/src/lib/libssl/src/doc/crypto/CMS_get0_RecipientInfos.pod
+++ b/src/lib/libssl/src/doc/crypto/CMS_get0_RecipientInfos.pod
@@ -6,7 +6,8 @@ CMS_get0_RecipientInfos, CMS_RecipientInfo_type,
6CMS_RecipientInfo_ktri_get0_signer_id,CMS_RecipientInfo_ktri_cert_cmp, 6CMS_RecipientInfo_ktri_get0_signer_id,CMS_RecipientInfo_ktri_cert_cmp,
7CMS_RecipientInfo_set0_pkey, CMS_RecipientInfo_kekri_get0_id, 7CMS_RecipientInfo_set0_pkey, CMS_RecipientInfo_kekri_get0_id,
8CMS_RecipientInfo_kekri_id_cmp, CMS_RecipientInfo_set0_key, 8CMS_RecipientInfo_kekri_id_cmp, CMS_RecipientInfo_set0_key,
9CMS_RecipientInfo_decrypt - CMS envelopedData RecipientInfo routines 9CMS_RecipientInfo_decrypt,
10CMS_RecipientInfo_encrypt - CMS envelopedData RecipientInfo routines
10 11
11=head1 SYNOPSIS 12=head1 SYNOPSIS
12 13
diff --git a/src/lib/libssl/src/doc/crypto/CMS_verify.pod b/src/lib/libssl/src/doc/crypto/CMS_verify.pod
index 22b4c07513..69425008aa 100644
--- a/src/lib/libssl/src/doc/crypto/CMS_verify.pod
+++ b/src/lib/libssl/src/doc/crypto/CMS_verify.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5CMS_verify - verify a CMS SignedData structure 5CMS_verify, CMS_get0_signers - verify a CMS SignedData structure
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
diff --git a/src/lib/libssl/src/doc/crypto/CONF_modules_free.pod b/src/lib/libssl/src/doc/crypto/CONF_modules_free.pod
index 7c61b72c13..803b2faab1 100644
--- a/src/lib/libssl/src/doc/crypto/CONF_modules_free.pod
+++ b/src/lib/libssl/src/doc/crypto/CONF_modules_free.pod
@@ -37,7 +37,7 @@ None of the functions return a value.
37=head1 SEE ALSO 37=head1 SEE ALSO
38 38
39L<conf(5)|conf(5)>, L<OPENSSL_config(3)|OPENSSL_config(3)>, 39L<conf(5)|conf(5)>, L<OPENSSL_config(3)|OPENSSL_config(3)>,
40L<CONF_modules_load_file(3), CONF_modules_load_file(3)> 40L<CONF_modules_load_file(3)|CONF_modules_load_file(3)>
41 41
42=head1 HISTORY 42=head1 HISTORY
43 43
diff --git a/src/lib/libssl/src/doc/crypto/CONF_modules_load_file.pod b/src/lib/libssl/src/doc/crypto/CONF_modules_load_file.pod
index 8cde6edb2d..c7994560c0 100644
--- a/src/lib/libssl/src/doc/crypto/CONF_modules_load_file.pod
+++ b/src/lib/libssl/src/doc/crypto/CONF_modules_load_file.pod
@@ -51,7 +51,7 @@ return value of the failing module (this will always be zero or negative).
51=head1 SEE ALSO 51=head1 SEE ALSO
52 52
53L<conf(5)|conf(5)>, L<OPENSSL_config(3)|OPENSSL_config(3)>, 53L<conf(5)|conf(5)>, L<OPENSSL_config(3)|OPENSSL_config(3)>,
54L<CONF_free(3), CONF_free(3)>, L<err(3),err(3)> 54L<CONF_free(3)|CONF_free(3)>, L<err(3)|err(3)>
55 55
56=head1 HISTORY 56=head1 HISTORY
57 57
diff --git a/src/lib/libssl/src/doc/crypto/DH_generate_parameters.pod b/src/lib/libssl/src/doc/crypto/DH_generate_parameters.pod
index 3832c25315..bd0782cb0c 100644
--- a/src/lib/libssl/src/doc/crypto/DH_generate_parameters.pod
+++ b/src/lib/libssl/src/doc/crypto/DH_generate_parameters.pod
@@ -2,31 +2,37 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5DH_generate_parameters, DH_check - generate and check Diffie-Hellman parameters 5DH_generate_parameters_ex, DH_generate_parameters,
6DH_check - generate and check Diffie-Hellman parameters
6 7
7=head1 SYNOPSIS 8=head1 SYNOPSIS
8 9
9 #include <openssl/dh.h> 10 #include <openssl/dh.h>
10 11
11 DH *DH_generate_parameters(int prime_len, int generator, 12 int DH_generate_parameters_ex(DH *dh, int prime_len,int generator, BN_GENCB *cb);
12 void (*callback)(int, int, void *), void *cb_arg);
13 13
14 int DH_check(DH *dh, int *codes); 14 int DH_check(DH *dh, int *codes);
15 15
16Deprecated:
17
18 DH *DH_generate_parameters(int prime_len, int generator,
19 void (*callback)(int, int, void *), void *cb_arg);
20
16=head1 DESCRIPTION 21=head1 DESCRIPTION
17 22
18DH_generate_parameters() generates Diffie-Hellman parameters that can 23DH_generate_parameters_ex() generates Diffie-Hellman parameters that can
19be shared among a group of users, and returns them in a newly 24be shared among a group of users, and stores them in the provided B<DH>
20allocated B<DH> structure. 25structure.
21 26
22B<prime_len> is the length in bits of the safe prime to be generated. 27B<prime_len> is the length in bits of the safe prime to be generated.
23B<generator> is a small number E<gt> 1, typically 2 or 5. 28B<generator> is a small number E<gt> 1, typically 2 or 5.
24 29
25A callback function may be used to provide feedback about the progress of the 30A callback function may be used to provide feedback about the progress
26key generation. If B<callback> is not B<NULL>, it will be called as described 31of the key generation. If B<cb> is not B<NULL>, it will be
27in L<BN_generate_prime(3)|BN_generate_prime(3)> while a random prime number is 32called as described in L<BN_generate_prime(3)|BN_generate_prime(3)> while a random prime number is
28generated, and when a prime has been found, B<callback(3, 0, cb_arg)> is 33generated, and when a prime has been found, B<BN_GENCB_call(cb, 3, 0)> is
29called. 34called. See L<BN_generate_prime(3)|BN_generate_prime(3)> for information on
35the BN_GENCB_call() function.
30 36
31DH_check() validates Diffie-Hellman parameters. It checks that B<p> is 37DH_check() validates Diffie-Hellman parameters. It checks that B<p> is
32a safe prime, and that B<g> is a suitable generator. In the case of an 38a safe prime, and that B<g> is a suitable generator. In the case of an
@@ -37,19 +43,21 @@ checked, i.e. it does not equal 2 or 5.
37 43
38=head1 RETURN VALUES 44=head1 RETURN VALUES
39 45
40DH_generate_parameters() returns a pointer to the DH structure, or 46DH_generate_parameters_ex() and DH_check() return 1 if the check could be
41NULL if the parameter generation fails. The error codes can be 47performed, 0 otherwise.
42obtained by L<ERR_get_error(3)|ERR_get_error(3)>. 48
49DH_generate_parameters() (deprecated) returns a pointer to the DH structure, or
50NULL if the parameter generation fails.
43 51
44DH_check() returns 1 if the check could be performed, 0 otherwise. 52The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
45 53
46=head1 NOTES 54=head1 NOTES
47 55
48DH_generate_parameters() may run for several hours before finding a 56DH_generate_parameters_ex() and DH_generate_parameters() may run for several
49suitable prime. 57hours before finding a suitable prime.
50 58
51The parameters generated by DH_generate_parameters() are not to be 59The parameters generated by DH_generate_parameters_ex() and DH_generate_parameters()
52used in signature schemes. 60are not to be used in signature schemes.
53 61
54=head1 BUGS 62=head1 BUGS
55 63
diff --git a/src/lib/libssl/src/doc/crypto/DSA_generate_parameters.pod b/src/lib/libssl/src/doc/crypto/DSA_generate_parameters.pod
index b64f0ca546..698b555a0e 100644
--- a/src/lib/libssl/src/doc/crypto/DSA_generate_parameters.pod
+++ b/src/lib/libssl/src/doc/crypto/DSA_generate_parameters.pod
@@ -2,20 +2,26 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5DSA_generate_parameters - generate DSA parameters 5DSA_generate_parameters_ex, DSA_generate_parameters - generate DSA parameters
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/dsa.h> 9 #include <openssl/dsa.h>
10 10
11 int DSA_generate_parameters_ex(DSA *dsa, int bits,
12 const unsigned char *seed,int seed_len,
13 int *counter_ret, unsigned long *h_ret, BN_GENCB *cb);
14
15Deprecated:
16
11 DSA *DSA_generate_parameters(int bits, unsigned char *seed, 17 DSA *DSA_generate_parameters(int bits, unsigned char *seed,
12 int seed_len, int *counter_ret, unsigned long *h_ret, 18 int seed_len, int *counter_ret, unsigned long *h_ret,
13 void (*callback)(int, int, void *), void *cb_arg); 19 void (*callback)(int, int, void *), void *cb_arg);
14 20
15=head1 DESCRIPTION 21=head1 DESCRIPTION
16 22
17DSA_generate_parameters() generates primes p and q and a generator g 23DSA_generate_parameters_ex() generates primes p and q and a generator g
18for use in the DSA. 24for use in the DSA and stores the result in B<dsa>.
19 25
20B<bits> is the length of the prime to be generated; the DSS allows a 26B<bits> is the length of the prime to be generated; the DSS allows a
21maximum of 1024 bits. 27maximum of 1024 bits.
@@ -25,64 +31,74 @@ generated at random. Otherwise, the seed is used to generate
25them. If the given seed does not yield a prime q, a new random 31them. If the given seed does not yield a prime q, a new random
26seed is chosen and placed at B<seed>. 32seed is chosen and placed at B<seed>.
27 33
28DSA_generate_parameters() places the iteration count in 34DSA_generate_parameters_ex() places the iteration count in
29*B<counter_ret> and a counter used for finding a generator in 35*B<counter_ret> and a counter used for finding a generator in
30*B<h_ret>, unless these are B<NULL>. 36*B<h_ret>, unless these are B<NULL>.
31 37
32A callback function may be used to provide feedback about the progress 38A callback function may be used to provide feedback about the progress
33of the key generation. If B<callback> is not B<NULL>, it will be 39of the key generation. If B<cb> is not B<NULL>, it will be
34called as follows: 40called as shown below. For information on the BN_GENCB structure and the
41BN_GENCB_call function discussed below, refer to
42L<BN_generate_prime(3)|BN_generate_prime(3)>.
35 43
36=over 4 44=over 4
37 45
38=item * 46=item *
39 47
40When a candidate for q is generated, B<callback(0, m++, cb_arg)> is called 48When a candidate for q is generated, B<BN_GENCB_call(cb, 0, m++)> is called
41(m is 0 for the first candidate). 49(m is 0 for the first candidate).
42 50
43=item * 51=item *
44 52
45When a candidate for q has passed a test by trial division, 53When a candidate for q has passed a test by trial division,
46B<callback(1, -1, cb_arg)> is called. 54B<BN_GENCB_call(cb, 1, -1)> is called.
47While a candidate for q is tested by Miller-Rabin primality tests, 55While a candidate for q is tested by Miller-Rabin primality tests,
48B<callback(1, i, cb_arg)> is called in the outer loop 56B<BN_GENCB_call(cb, 1, i)> is called in the outer loop
49(once for each witness that confirms that the candidate may be prime); 57(once for each witness that confirms that the candidate may be prime);
50i is the loop counter (starting at 0). 58i is the loop counter (starting at 0).
51 59
52=item * 60=item *
53 61
54When a prime q has been found, B<callback(2, 0, cb_arg)> and 62When a prime q has been found, B<BN_GENCB_call(cb, 2, 0)> and
55B<callback(3, 0, cb_arg)> are called. 63B<BN_GENCB_call(cb, 3, 0)> are called.
56 64
57=item * 65=item *
58 66
59Before a candidate for p (other than the first) is generated and tested, 67Before a candidate for p (other than the first) is generated and tested,
60B<callback(0, counter, cb_arg)> is called. 68B<BN_GENCB_call(cb, 0, counter)> is called.
61 69
62=item * 70=item *
63 71
64When a candidate for p has passed the test by trial division, 72When a candidate for p has passed the test by trial division,
65B<callback(1, -1, cb_arg)> is called. 73B<BN_GENCB_call(cb, 1, -1)> is called.
66While it is tested by the Miller-Rabin primality test, 74While it is tested by the Miller-Rabin primality test,
67B<callback(1, i, cb_arg)> is called in the outer loop 75B<BN_GENCB_call(cb, 1, i)> is called in the outer loop
68(once for each witness that confirms that the candidate may be prime). 76(once for each witness that confirms that the candidate may be prime).
69i is the loop counter (starting at 0). 77i is the loop counter (starting at 0).
70 78
71=item * 79=item *
72 80
73When p has been found, B<callback(2, 1, cb_arg)> is called. 81When p has been found, B<BN_GENCB_call(cb, 2, 1)> is called.
74 82
75=item * 83=item *
76 84
77When the generator has been found, B<callback(3, 1, cb_arg)> is called. 85When the generator has been found, B<BN_GENCB_call(cb, 3, 1)> is called.
78 86
79=back 87=back
80 88
89DSA_generate_parameters() (deprecated) works in much the same way as for DSA_generate_parameters_ex, except that no B<dsa> parameter is passed and
90instead a newly allocated B<DSA> structure is returned. Additionally "old
91style" callbacks are used instead of the newer BN_GENCB based approach.
92Refer to L<BN_generate_prime(3)|BN_generate_prime(3)> for further information.
93
81=head1 RETURN VALUE 94=head1 RETURN VALUE
82 95
96DSA_generate_parameters_ex() returns a 1 on success, or 0 otherwise.
97
83DSA_generate_parameters() returns a pointer to the DSA structure, or 98DSA_generate_parameters() returns a pointer to the DSA structure, or
84B<NULL> if the parameter generation fails. The error codes can be 99B<NULL> if the parameter generation fails.
85obtained by L<ERR_get_error(3)|ERR_get_error(3)>. 100
101The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
86 102
87=head1 BUGS 103=head1 BUGS
88 104
@@ -91,7 +107,7 @@ Seed lengths E<gt> 20 are not supported.
91=head1 SEE ALSO 107=head1 SEE ALSO
92 108
93L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, 109L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>,
94L<DSA_free(3)|DSA_free(3)> 110L<DSA_free(3)|DSA_free(3)>, L<BN_generate_prime(3)|BN_generate_prime(3)>
95 111
96=head1 HISTORY 112=head1 HISTORY
97 113
diff --git a/src/lib/libssl/src/doc/crypto/EC_GFp_simple_method.pod b/src/lib/libssl/src/doc/crypto/EC_GFp_simple_method.pod
new file mode 100644
index 0000000000..aff20ac175
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/EC_GFp_simple_method.pod
@@ -0,0 +1,60 @@
1=pod
2
3=head1 NAME
4
5EC_GFp_simple_method, EC_GFp_mont_method, EC_GFp_nist_method, EC_GFp_nistp224_method, EC_GFp_nistp256_method, EC_GFp_nistp521_method, EC_GF2m_simple_method, EC_METHOD_get_field_type - Functions for obtaining B<EC_METHOD> objects.
6
7=head1 SYNOPSIS
8
9 #include <openssl/ec.h>
10
11 const EC_METHOD *EC_GFp_simple_method(void);
12 const EC_METHOD *EC_GFp_mont_method(void);
13 const EC_METHOD *EC_GFp_nist_method(void);
14 const EC_METHOD *EC_GFp_nistp224_method(void);
15 const EC_METHOD *EC_GFp_nistp256_method(void);
16 const EC_METHOD *EC_GFp_nistp521_method(void);
17
18 const EC_METHOD *EC_GF2m_simple_method(void);
19
20 int EC_METHOD_get_field_type(const EC_METHOD *meth);
21
22=head1 DESCRIPTION
23
24The Elliptic Curve library provides a number of different implementations through a single common interface.
25When constructing a curve using EC_GROUP_new (see L<EC_GROUP_new(3)|EC_GROUP_new(3)>) an
26implementation method must be provided. The functions described here all return a const pointer to an
27B<EC_METHOD> structure that can be passed to EC_GROUP_NEW. It is important that the correct implementation
28type for the form of curve selected is used.
29
30For F2^m curves there is only one implementation choice, i.e. EC_GF2_simple_method.
31
32For Fp curves the lowest common denominator implementation is the EC_GFp_simple_method implementation. All
33other implementations are based on this one. EC_GFp_mont_method builds on EC_GFp_simple_method but adds the
34use of montgomery multiplication (see L<BN_mod_mul_montgomery(3)|BN_mod_mul_montgomery(3)>). EC_GFp_nist_method
35offers an implementation optimised for use with NIST recommended curves (NIST curves are available through
36EC_GROUP_new_by_curve_name as described in L<EC_GROUP_new(3)|EC_GROUP_new(3)>).
37
38The functions EC_GFp_nistp224_method, EC_GFp_nistp256_method and EC_GFp_nistp521_method offer 64 bit
39optimised implementations for the NIST P224, P256 and P521 curves respectively. Note, however, that these
40implementations are not available on all platforms.
41
42EC_METHOD_get_field_type identifies what type of field the EC_METHOD structure supports, which will be either
43F2^m or Fp. If the field type is Fp then the value B<NID_X9_62_prime_field> is returned. If the field type is
44F2^m then the value B<NID_X9_62_characteristic_two_field> is returned. These values are defined in the
45obj_mac.h header file.
46
47=head1 RETURN VALUES
48
49All EC_GFp* functions and EC_GF2m_simple_method always return a const pointer to an EC_METHOD structure.
50
51EC_METHOD_get_field_type returns an integer that identifies the type of field the EC_METHOD structure supports.
52
53=head1 SEE ALSO
54
55L<crypto(3)|crypto(3)>, L<ec(3)|ec(3)>, L<EC_GROUP_new(3)|EC_GROUP_new(3)>, L<EC_GROUP_copy(3)|EC_GROUP_copy(3)>,
56L<EC_POINT_new(3)|EC_POINT_new(3)>, L<EC_POINT_add(3)|EC_POINT_add(3)>, L<EC_KEY_new(3)|EC_KEY_new(3)>,
57L<d2i_ECPKParameters(3)|d2i_ECPKParameters(3)>,
58L<BN_mod_mul_montgomery(3)|BN_mod_mul_montgomery(3)>
59
60=cut
diff --git a/src/lib/libssl/src/doc/crypto/EC_GROUP_copy.pod b/src/lib/libssl/src/doc/crypto/EC_GROUP_copy.pod
new file mode 100644
index 0000000000..954af469d5
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/EC_GROUP_copy.pod
@@ -0,0 +1,174 @@
1=pod
2
3=head1 NAME
4
5EC_GROUP_copy, EC_GROUP_dup, EC_GROUP_method_of, EC_GROUP_set_generator, EC_GROUP_get0_generator, EC_GROUP_get_order, EC_GROUP_get_cofactor, EC_GROUP_set_curve_name, EC_GROUP_get_curve_name, EC_GROUP_set_asn1_flag, EC_GROUP_get_asn1_flag, EC_GROUP_set_point_conversion_form, EC_GROUP_get_point_conversion_form, EC_GROUP_get0_seed, EC_GROUP_get_seed_len, EC_GROUP_set_seed, EC_GROUP_get_degree, EC_GROUP_check, EC_GROUP_check_discriminant, EC_GROUP_cmp, EC_GROUP_get_basis_type, EC_GROUP_get_trinomial_basis, EC_GROUP_get_pentanomial_basis - Functions for manipulating B<EC_GROUP> objects.
6
7=head1 SYNOPSIS
8
9 #include <openssl/ec.h>
10 #include <openssl/bn.h>
11
12 int EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src);
13 EC_GROUP *EC_GROUP_dup(const EC_GROUP *src);
14
15 const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group);
16
17 int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor);
18 const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group);
19
20 int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx);
21 int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx);
22
23 void EC_GROUP_set_curve_name(EC_GROUP *group, int nid);
24 int EC_GROUP_get_curve_name(const EC_GROUP *group);
25
26 void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag);
27 int EC_GROUP_get_asn1_flag(const EC_GROUP *group);
28
29 void EC_GROUP_set_point_conversion_form(EC_GROUP *group, point_conversion_form_t form);
30 point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *);
31
32 unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x);
33 size_t EC_GROUP_get_seed_len(const EC_GROUP *);
34 size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len);
35
36 int EC_GROUP_get_degree(const EC_GROUP *group);
37
38 int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx);
39
40 int EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx);
41
42 int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx);
43
44 int EC_GROUP_get_basis_type(const EC_GROUP *);
45 int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k);
46 int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
47 unsigned int *k2, unsigned int *k3);
48
49=head1 DESCRIPTION
50
51EC_GROUP_copy copies the curve B<src> into B<dst>. Both B<src> and B<dst> must use the same EC_METHOD.
52
53EC_GROUP_dup creates a new EC_GROUP object and copies the content from B<src> to the newly created
54EC_GROUP object.
55
56EC_GROUP_method_of obtains the EC_METHOD of B<group>.
57
58EC_GROUP_set_generator sets curve paramaters that must be agreed by all participants using the curve. These
59paramaters include the B<generator>, the B<order> and the B<cofactor>. The B<generator> is a well defined point on the
60curve chosen for cryptographic operations. Integers used for point multiplications will be between 0 and
61n-1 where n is the B<order>. The B<order> multipied by the B<cofactor> gives the number of points on the curve.
62
63EC_GROUP_get0_generator returns the generator for the identified B<group>.
64
65The functions EC_GROUP_get_order and EC_GROUP_get_cofactor populate the provided B<order> and B<cofactor> parameters
66with the respective order and cofactors for the B<group>.
67
68The functions EC_GROUP_set_curve_name and EC_GROUP_get_curve_name, set and get the NID for the curve respectively
69(see L<EC_GROUP_new(3)|EC_GROUP_new(3)>). If a curve does not have a NID associated with it, then EC_GROUP_get_curve_name
70will return 0.
71
72The asn1_flag value on a curve is used to determine whether there is a specific ASN1 OID to describe the curve or not.
73If the asn1_flag is 1 then this is a named curve with an associated ASN1 OID. If not then asn1_flag is 0. The functions
74EC_GROUP_get_asn1_flag and EC_GROUP_set_asn1_flag get and set the status of the asn1_flag for the curve. If set then
75the curve_name must also be set.
76
77The point_coversion_form for a curve controls how EC_POINT data is encoded as ASN1 as defined in X9.62 (ECDSA).
78point_conversion_form_t is an enum defined as follows:
79
80 typedef enum {
81 /** the point is encoded as z||x, where the octet z specifies
82 * which solution of the quadratic equation y is */
83 POINT_CONVERSION_COMPRESSED = 2,
84 /** the point is encoded as z||x||y, where z is the octet 0x02 */
85 POINT_CONVERSION_UNCOMPRESSED = 4,
86 /** the point is encoded as z||x||y, where the octet z specifies
87 * which solution of the quadratic equation y is */
88 POINT_CONVERSION_HYBRID = 6
89 } point_conversion_form_t;
90
91
92For POINT_CONVERSION_UNCOMPRESSED the point is encoded as an octet signifying the UNCOMPRESSED form has been used followed by
93the octets for x, followed by the octets for y.
94
95For any given x co-ordinate for a point on a curve it is possible to derive two possible y values. For
96POINT_CONVERSION_COMPRESSED the point is encoded as an octet signifying that the COMPRESSED form has been used AND which of
97the two possible solutions for y has been used, followed by the octets for x.
98
99For POINT_CONVERSION_HYBRID the point is encoded as an octet signifying the HYBRID form has been used AND which of the two
100possible solutions for y has been used, followed by the octets for x, followed by the octets for y.
101
102The functions EC_GROUP_set_point_conversion_form and EC_GROUP_get_point_conversion_form set and get the point_conversion_form
103for the curve respectively.
104
105ANSI X9.62 (ECDSA standard) defines a method of generating the curve parameter b from a random number. This provides advantages
106in that a parameter obtained in this way is highly unlikely to be susceptible to special purpose attacks, or have any trapdoors in it.
107If the seed is present for a curve then the b parameter was generated in a verifiable fashion using that seed. The OpenSSL EC library
108does not use this seed value but does enable you to inspect it using EC_GROUP_get0_seed. This returns a pointer to a memory block
109containing the seed that was used. The length of the memory block can be obtained using EC_GROUP_get_seed_len. A number of the
110builtin curves within the library provide seed values that can be obtained. It is also possible to set a custom seed using
111EC_GROUP_set_seed and passing a pointer to a memory block, along with the length of the seed. Again, the EC library will not use
112this seed value, although it will be preserved in any ASN1 based communications.
113
114EC_GROUP_get_degree gets the degree of the field. For Fp fields this will be the number of bits in p. For F2^m fields this will be
115the value m.
116
117The function EC_GROUP_check_discriminant calculates the discriminant for the curve and verifies that it is valid.
118For a curve defined over Fp the discriminant is given by the formula 4*a^3 + 27*b^2 whilst for F2^m curves the discriminant is
119simply b. In either case for the curve to be valid the discriminant must be non zero.
120
121The function EC_GROUP_check performs a number of checks on a curve to verify that it is valid. Checks performed include
122verifying that the discriminant is non zero; that a generator has been defined; that the generator is on the curve and has
123the correct order.
124
125EC_GROUP_cmp compares B<a> and B<b> to determine whether they represent the same curve or not.
126
127The functions EC_GROUP_get_basis_type, EC_GROUP_get_trinomial_basis and EC_GROUP_get_pentanomial_basis should only be called for curves
128defined over an F2^m field. Addition and multiplication operations within an F2^m field are performed using an irreducible polynomial
129function f(x). This function is either a trinomial of the form:
130
131f(x) = x^m + x^k + 1 with m > k >= 1
132
133or a pentanomial of the form:
134
135f(x) = x^m + x^k3 + x^k2 + x^k1 + 1 with m > k3 > k2 > k1 >= 1
136
137The function EC_GROUP_get_basis_type returns a NID identifying whether a trinomial or pentanomial is in use for the field. The
138function EC_GROUP_get_trinomial_basis must only be called where f(x) is of the trinomial form, and returns the value of B<k>. Similary
139the function EC_GROUP_get_pentanomial_basis must only be called where f(x) is of the pentanomial form, and returns the values of B<k1>,
140B<k2> and B<k3> respectively.
141
142=head1 RETURN VALUES
143
144The following functions return 1 on success or 0 on error: EC_GROUP_copy, EC_GROUP_set_generator, EC_GROUP_check,
145EC_GROUP_check_discriminant, EC_GROUP_get_trinomial_basis and EC_GROUP_get_pentanomial_basis.
146
147EC_GROUP_dup returns a pointer to the duplicated curve, or NULL on error.
148
149EC_GROUP_method_of returns the EC_METHOD implementation in use for the given curve or NULL on error.
150
151EC_GROUP_get0_generator returns the generator for the given curve or NULL on error.
152
153EC_GROUP_get_order, EC_GROUP_get_cofactor, EC_GROUP_get_curve_name, EC_GROUP_get_asn1_flag, EC_GROUP_get_point_conversion_form
154and EC_GROUP_get_degree return the order, cofactor, curve name (NID), ASN1 flag, point_conversion_form and degree for the
155specified curve respectively. If there is no curve name associated with a curve then EC_GROUP_get_curve_name will return 0.
156
157EC_GROUP_get0_seed returns a pointer to the seed that was used to generate the parameter b, or NULL if the seed is not
158specified. EC_GROUP_get_seed_len returns the length of the seed or 0 if the seed is not specified.
159
160EC_GROUP_set_seed returns the length of the seed that has been set. If the supplied seed is NULL, or the supplied seed length is
1610, the the return value will be 1. On error 0 is returned.
162
163EC_GROUP_cmp returns 0 if the curves are equal, 1 if they are not equal, or -1 on error.
164
165EC_GROUP_get_basis_type returns the values NID_X9_62_tpBasis or NID_X9_62_ppBasis (as defined in <openssl/obj_mac.h>) for a
166trinomial or pentanomial respectively. Alternatively in the event of an error a 0 is returned.
167
168=head1 SEE ALSO
169
170L<crypto(3)|crypto(3)>, L<ec(3)|ec(3)>, L<EC_GROUP_new(3)|EC_GROUP_new(3)>,
171L<EC_POINT_new(3)|EC_POINT_new(3)>, L<EC_POINT_add(3)|EC_POINT_add(3)>, L<EC_KEY_new(3)|EC_KEY_new(3)>,
172L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>, L<d2i_ECPKParameters(3)|d2i_ECPKParameters(3)>
173
174=cut
diff --git a/src/lib/libssl/src/doc/crypto/EC_GROUP_new.pod b/src/lib/libssl/src/doc/crypto/EC_GROUP_new.pod
new file mode 100644
index 0000000000..ff55bf33a3
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/EC_GROUP_new.pod
@@ -0,0 +1,95 @@
1=pod
2
3=head1 NAME
4
5EC_GROUP_new, EC_GROUP_free, EC_GROUP_clear_free, EC_GROUP_new_curve_GFp, EC_GROUP_new_curve_GF2m, EC_GROUP_new_by_curve_name, EC_GROUP_set_curve_GFp, EC_GROUP_get_curve_GFp, EC_GROUP_set_curve_GF2m, EC_GROUP_get_curve_GF2m, EC_get_builtin_curves - Functions for creating and destroying B<EC_GROUP> objects.
6
7=head1 SYNOPSIS
8
9 #include <openssl/ec.h>
10 #include <openssl/bn.h>
11
12 EC_GROUP *EC_GROUP_new(const EC_METHOD *meth);
13 void EC_GROUP_free(EC_GROUP *group);
14 void EC_GROUP_clear_free(EC_GROUP *group);
15
16 EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
17 EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
18 EC_GROUP *EC_GROUP_new_by_curve_name(int nid);
19
20 int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
21 int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
22 int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
23 int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
24
25 size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);
26
27=head1 DESCRIPTION
28
29Within the library there are two forms of elliptic curve that are of interest. The first form is those defined over the
30prime field Fp. The elements of Fp are the integers 0 to p-1, where p is a prime number. This gives us a revised
31elliptic curve equation as follows:
32
33y^2 mod p = x^3 +ax + b mod p
34
35The second form is those defined over a binary field F2^m where the elements of the field are integers of length at
36most m bits. For this form the elliptic curve equation is modified to:
37
38y^2 + xy = x^3 + ax^2 + b (where b != 0)
39
40Operations in a binary field are performed relative to an B<irreducible polynomial>. All such curves with OpenSSL
41use a trinomial or a pentanomial for this parameter.
42
43A new curve can be constructed by calling EC_GROUP_new, using the implementation provided by B<meth> (see
44L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>). It is then necessary to call either EC_GROUP_set_curve_GFp or
45EC_GROUP_set_curve_GF2m as appropriate to create a curve defined over Fp or over F2^m respectively.
46
47EC_GROUP_set_curve_GFp sets the curve parameters B<p>, B<a> and B<b> for a curve over Fp stored in B<group>.
48EC_group_get_curve_GFp obtains the previously set curve parameters.
49
50EC_GROUP_set_curve_GF2m sets the equivalent curve parameters for a curve over F2^m. In this case B<p> represents
51the irreducible polybnomial - each bit represents a term in the polynomial. Therefore there will either be three
52or five bits set dependant on whether the polynomial is a trinomial or a pentanomial.
53EC_group_get_curve_GF2m obtains the previously set curve parameters.
54
55The functions EC_GROUP_new_curve_GFp and EC_GROUP_new_curve_GF2m are shortcuts for calling EC_GROUP_new and the
56appropriate EC_group_set_curve function. An appropriate default implementation method will be used.
57
58Whilst the library can be used to create any curve using the functions described above, there are also a number of
59predefined curves that are available. In order to obtain a list of all of the predefined curves, call the function
60EC_get_builtin_curves. The parameter B<r> should be an array of EC_builtin_curve structures of size B<nitems>. The function
61will populate the B<r> array with information about the builtin curves. If B<nitems> is less than the total number of
62curves available, then the first B<nitems> curves will be returned. Otherwise the total number of curves will be
63provided. The return value is the total number of curves available (whether that number has been populated in B<r> or
64not). Passing a NULL B<r>, or setting B<nitems> to 0 will do nothing other than return the total number of curves available.
65The EC_builtin_curve structure is defined as follows:
66
67 typedef struct {
68 int nid;
69 const char *comment;
70 } EC_builtin_curve;
71
72Each EC_builtin_curve item has a unique integer id (B<nid>), and a human readable comment string describing the curve.
73
74In order to construct a builtin curve use the function EC_GROUP_new_by_curve_name and provide the B<nid> of the curve to
75be constructed.
76
77EC_GROUP_free frees the memory associated with the EC_GROUP.
78
79EC_GROUP_clear_free destroys any sensitive data held within the EC_GROUP and then frees its memory.
80
81=head1 RETURN VALUES
82
83All EC_GROUP_new* functions return a pointer to the newly constructed group, or NULL on error.
84
85EC_get_builtin_curves returns the number of builtin curves that are available.
86
87EC_GROUP_set_curve_GFp, EC_GROUP_get_curve_GFp, EC_GROUP_set_curve_GF2m, EC_GROUP_get_curve_GF2m return 1 on success or 0 on error.
88
89=head1 SEE ALSO
90
91L<crypto(3)|crypto(3)>, L<ec(3)|ec(3)>, L<EC_GROUP_copy(3)|EC_GROUP_copy(3)>,
92L<EC_POINT_new(3)|EC_POINT_new(3)>, L<EC_POINT_add(3)|EC_POINT_add(3)>, L<EC_KEY_new(3)|EC_KEY_new(3)>,
93L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>, L<d2i_ECPKParameters(3)|d2i_ECPKParameters(3)>
94
95=cut
diff --git a/src/lib/libssl/src/doc/crypto/EC_KEY_new.pod b/src/lib/libssl/src/doc/crypto/EC_KEY_new.pod
new file mode 100644
index 0000000000..b762cbcb73
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/EC_KEY_new.pod
@@ -0,0 +1,115 @@
1=pod
2
3=head1 NAME
4
5EC_KEY_new, EC_KEY_get_flags, EC_KEY_set_flags, EC_KEY_clear_flags, EC_KEY_new_by_curve_name, EC_KEY_free, EC_KEY_copy, EC_KEY_dup, EC_KEY_up_ref, EC_KEY_get0_group, EC_KEY_set_group, EC_KEY_get0_private_key, EC_KEY_set_private_key, EC_KEY_get0_public_key, EC_KEY_set_public_key, EC_KEY_get_enc_flags, EC_KEY_set_enc_flags, EC_KEY_get_conv_form, EC_KEY_set_conv_form, EC_KEY_get_key_method_data, EC_KEY_insert_key_method_data, EC_KEY_set_asn1_flag, EC_KEY_precompute_mult, EC_KEY_generate_key, EC_KEY_check_key, EC_KEY_set_public_key_affine_coordinates - Functions for creating, destroying and manipulating B<EC_KEY> objects.
6
7=head1 SYNOPSIS
8
9 #include <openssl/ec.h>
10 #include <openssl/bn.h>
11
12 EC_KEY *EC_KEY_new(void);
13 int EC_KEY_get_flags(const EC_KEY *key);
14 void EC_KEY_set_flags(EC_KEY *key, int flags);
15 void EC_KEY_clear_flags(EC_KEY *key, int flags);
16 EC_KEY *EC_KEY_new_by_curve_name(int nid);
17 void EC_KEY_free(EC_KEY *key);
18 EC_KEY *EC_KEY_copy(EC_KEY *dst, const EC_KEY *src);
19 EC_KEY *EC_KEY_dup(const EC_KEY *src);
20 int EC_KEY_up_ref(EC_KEY *key);
21 const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key);
22 int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group);
23 const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key);
24 int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv);
25 const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key);
26 int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub);
27 unsigned int EC_KEY_get_enc_flags(const EC_KEY *key);
28 void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags);
29 point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key);
30 void EC_KEY_set_conv_form(EC_KEY *eckey, point_conversion_form_t cform);
31 void *EC_KEY_get_key_method_data(EC_KEY *key,
32 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
33 void EC_KEY_insert_key_method_data(EC_KEY *key, void *data,
34 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
35 void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag);
36 int EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx);
37 int EC_KEY_generate_key(EC_KEY *key);
38 int EC_KEY_check_key(const EC_KEY *key);
39 int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, BIGNUM *y);
40
41=head1 DESCRIPTION
42
43An EC_KEY represents a public key and (optionaly) an associated private key. A new EC_KEY (with no associated curve) can be constructed by calling EC_KEY_new.
44The reference count for the newly created EC_KEY is initially set to 1. A curve can be associated with the EC_KEY by calling
45EC_KEY_set_group.
46
47Alternatively a new EC_KEY can be constructed by calling EC_KEY_new_by_curve_name and supplying the nid of the associated curve. Refer to L<EC_GROUP_new(3)|EC_GROUP_new(3)> for a description of curve names. This function simply wraps calls to EC_KEY_new and
48EC_GROUP_new_by_curve_name.
49
50Calling EC_KEY_free decrements the reference count for the EC_KEY object, and if it has dropped to zero then frees the memory associated
51with it.
52
53EC_KEY_copy copies the contents of the EC_KEY in B<src> into B<dest>.
54
55EC_KEY_dup creates a new EC_KEY object and copies B<ec_key> into it.
56
57EC_KEY_up_ref increments the reference count associated with the EC_KEY object.
58
59EC_KEY_generate_key generates a new public and private key for the supplied B<eckey> object. B<eckey> must have an EC_GROUP object
60associated with it before calling this function. The private key is a random integer (0 < priv_key < order, where order is the order
61of the EC_GROUP object). The public key is an EC_POINT on the curve calculated by multiplying the generator for the curve by the
62private key.
63
64EC_KEY_check_key performs various sanity checks on the EC_KEY object to confirm that it is valid.
65
66EC_KEY_set_public_key_affine_coordinates sets the public key for B<key> based on its affine co-ordinates, i.e. it constructs an EC_POINT
67object based on the supplied B<x> and B<y> values and sets the public key to be this EC_POINT. It will also performs certain sanity checks
68on the key to confirm that it is valid.
69
70The functions EC_KEY_get0_group, EC_KEY_set_group, EC_KEY_get0_private_key, EC_KEY_set_private_key, EC_KEY_get0_public_key, and EC_KEY_set_public_key get and set the EC_GROUP object, the private key and the EC_POINT public key for the B<key> respectively.
71
72The functions EC_KEY_get_enc_flags and EC_KEY_set_enc_flags get and set the value of the encoding flags for the B<key>. There are two encoding
73flags currently defined - EC_PKEY_NO_PARAMETERS and EC_PKEY_NO_PUBKEY. These flags define the behaviour of how the B<key> is
74converted into ASN1 in a call to i2d_ECPrivateKey. If EC_PKEY_NO_PARAMETERS is set then the public parameters for the curve are not encoded
75along with the private key. If EC_PKEY_NO_PUBKEY is set then the public key is not encoded along with the private key.
76
77The functions EC_KEY_get_conv_form and EC_KEY_set_conv_form get and set the point_conversion_form for the B<key>. For a description
78of point_conversion_forms please refer to L<EC_POINT_new(3)|EC_POINT_new(3)>.
79
80EC_KEY_insert_key_method_data and EC_KEY_get_key_method_data enable the caller to associate arbitary additional data specific to the
81elliptic curve scheme being used with the EC_KEY object. This data is treated as a "black box" by the ec library. The data to be stored by EC_KEY_insert_key_method_data is provided in the B<data> parameter, which must have have associated functions for duplicating, freeing and "clear_freeing" the data item. If a subsequent EC_KEY_get_key_method_data call is issued, the functions for duplicating, freeing and "clear_freeing" the data item must be provided again, and they must be the same as they were when the data item was inserted.
82
83EC_KEY_set_flags sets the flags in the B<flags> parameter on the EC_KEY object. Any flags that are already set are left set. The currently defined standard flags are EC_FLAG_NON_FIPS_ALLOW and EC_FLAG_FIPS_CHECKED. In addition there is the flag EC_FLAG_COFACTOR_ECDH which is specific to ECDH and is defined in ecdh.h. EC_KEY_get_flags returns the current flags that are set for this EC_KEY. EC_KEY_clear_flags clears the flags indicated by the B<flags> parameter. All other flags are left in their existing state.
84
85EC_KEY_set_asn1_flag sets the asn1_flag on the underlying EC_GROUP object (if set). Refer to L<EC_GROUP_copy(3)|EC_GROUP_copy(3)> for further information on the asn1_flag.
86
87EC_KEY_precompute_mult stores multiples of the underlying EC_GROUP generator for faster point multiplication. See also L<EC_POINT_add(3)|EC_POINT_add(3)>.
88
89
90=head1 RETURN VALUES
91
92EC_KEY_new, EC_KEY_new_by_curve_name and EC_KEY_dup return a pointer to the newly created EC_KEY object, or NULL on error.
93
94EC_KEY_get_flags returns the flags associated with the EC_KEY object as an integer.
95
96EC_KEY_copy returns a pointer to the destination key, or NULL on error.
97
98EC_KEY_up_ref, EC_KEY_set_group, EC_KEY_set_private_key, EC_KEY_set_public_key, EC_KEY_precompute_mult, EC_KEY_generate_key, EC_KEY_check_key and EC_KEY_set_public_key_affine_coordinates return 1 on success or 0 on error.
99
100EC_KEY_get0_group returns the EC_GROUP associated with the EC_KEY.
101
102EC_KEY_get0_private_key returns the private key associated with the EC_KEY.
103
104EC_KEY_get_enc_flags returns the value of the current encoding flags for the EC_KEY.
105
106EC_KEY_get_conv_form return the point_conversion_form for the EC_KEY.
107
108
109=head1 SEE ALSO
110
111L<crypto(3)|crypto(3)>, L<ec(3)|ec(3)>, L<EC_GROUP_new(3)|EC_GROUP_new(3)>, L<EC_GROUP_copy(3)|EC_GROUP_copy(3)>,
112L<EC_POINT_new(3)|EC_POINT_new(3)>, L<EC_POINT_add(3)|EC_POINT_add(3)>,
113L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>, L<d2i_ECPKParameters(3)|d2i_ECPKParameters(3)>
114
115=cut
diff --git a/src/lib/libssl/src/doc/crypto/EC_POINT_add.pod b/src/lib/libssl/src/doc/crypto/EC_POINT_add.pod
new file mode 100644
index 0000000000..ae92640843
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/EC_POINT_add.pod
@@ -0,0 +1,72 @@
1=pod
2
3=head1 NAME
4
5EC_POINT_add, EC_POINT_dbl, EC_POINT_invert, EC_POINT_is_at_infinity, EC_POINT_is_on_curve, EC_POINT_cmp, EC_POINT_make_affine, EC_POINTs_make_affine, EC_POINTs_mul, EC_POINT_mul, EC_GROUP_precompute_mult, EC_GROUP_have_precompute_mult - Functions for performing mathematical operations and tests on B<EC_POINT> objects.
6
7=head1 SYNOPSIS
8
9 #include <openssl/ec.h>
10 #include <openssl/bn.h>
11
12 int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx);
13 int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx);
14 int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx);
15 int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *p);
16 int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx);
17 int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx);
18 int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx);
19 int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], BN_CTX *ctx);
20 int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, size_t num, const EC_POINT *p[], const BIGNUM *m[], BN_CTX *ctx);
21 int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx);
22 int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx);
23 int EC_GROUP_have_precompute_mult(const EC_GROUP *group);
24
25
26=head1 DESCRIPTION
27
28EC_POINT_add adds the two points B<a> and B<b> and places the result in B<r>. Similarly EC_POINT_dbl doubles the point B<a> and places the
29result in B<r>. In both cases it is valid for B<r> to be one of B<a> or B<b>.
30
31EC_POINT_invert calculates the inverse of the supplied point B<a>. The result is placed back in B<a>.
32
33The function EC_POINT_is_at_infinity tests whether the supplied point is at infinity or not.
34
35EC_POINT_is_on_curve tests whether the supplied point is on the curve or not.
36
37EC_POINT_cmp compares the two supplied points and tests whether or not they are equal.
38
39The functions EC_POINT_make_affine and EC_POINTs_make_affine force the internal representation of the EC_POINT(s) into the affine
40co-ordinate system. In the case of EC_POINTs_make_affine the value B<num> provides the number of points in the array B<points> to be
41forced.
42
43EC_POINT_mul calculates the value generator * B<n> + B<q> * B<m> and stores the result in B<r>. The value B<n> may be NULL in which case the result is just B<q> * B<m>.
44
45EC_POINTs_mul calculates the value generator * B<n> + B<q[0]> * B<m[0]> + ... + B<q[num-1]> * B<m[num-1]>. As for EC_POINT_mul the value
46B<n> may be NULL.
47
48The function EC_GROUP_precompute_mult stores multiples of the generator for faster point multiplication, whilst
49EC_GROUP_have_precompute_mult tests whether precomputation has already been done. See L<EC_GROUP_copy(3)|EC_GROUP_copy(3)> for information
50about the generator.
51
52
53=head1 RETURN VALUES
54
55The following functions return 1 on success or 0 on error: EC_POINT_add, EC_POINT_dbl, EC_POINT_invert, EC_POINT_make_affine,
56EC_POINTs_make_affine, EC_POINTs_make_affine, EC_POINT_mul, EC_POINTs_mul and EC_GROUP_precompute_mult.
57
58EC_POINT_is_at_infinity returns 1 if the point is at infinity, or 0 otherwise.
59
60EC_POINT_is_on_curve returns 1 if the point is on the curve, 0 if not, or -1 on error.
61
62EC_POINT_cmp returns 1 if the points are not equal, 0 if they are, or -1 on error.
63
64EC_GROUP_have_precompute_mult return 1 if a precomputation has been done, or 0 if not.
65
66=head1 SEE ALSO
67
68L<crypto(3)|crypto(3)>, L<ec(3)|ec(3)>, L<EC_GROUP_new(3)|EC_GROUP_new(3)>, L<EC_GROUP_copy(3)|EC_GROUP_copy(3)>,
69L<EC_POINT_new(3)|EC_POINT_new(3)>, L<EC_KEY_new(3)|EC_KEY_new(3)>,
70L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>, L<d2i_ECPKParameters(3)|d2i_ECPKParameters(3)>
71
72=cut
diff --git a/src/lib/libssl/src/doc/crypto/EC_POINT_new.pod b/src/lib/libssl/src/doc/crypto/EC_POINT_new.pod
new file mode 100644
index 0000000000..69eb0d1a09
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/EC_POINT_new.pod
@@ -0,0 +1,123 @@
1=pod
2
3=head1 NAME
4
5EC_POINT_new, EC_POINT_free, EC_POINT_clear_free, EC_POINT_copy, EC_POINT_dup, EC_POINT_method_of, EC_POINT_set_to_infinity, EC_POINT_set_Jprojective_coordinates, EC_POINT_get_Jprojective_coordinates_GFp, EC_POINT_set_affine_coordinates_GFp, EC_POINT_get_affine_coordinates_GFp, EC_POINT_set_compressed_coordinates_GFp, EC_POINT_set_affine_coordinates_GF2m, EC_POINT_get_affine_coordinates_GF2m, EC_POINT_set_compressed_coordinates_GF2m, EC_POINT_point2oct, EC_POINT_oct2point, EC_POINT_point2bn, EC_POINT_bn2point, EC_POINT_point2hex, EC_POINT_hex2point - Functions for creating, destroying and manipulating B<EC_POINT> objects.
6
7=head1 SYNOPSIS
8
9 #include <openssl/ec.h>
10 #include <openssl/bn.h>
11
12 EC_POINT *EC_POINT_new(const EC_GROUP *group);
13 void EC_POINT_free(EC_POINT *point);
14 void EC_POINT_clear_free(EC_POINT *point);
15 int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src);
16 EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group);
17 const EC_METHOD *EC_POINT_method_of(const EC_POINT *point);
18 int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);
19 int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
20 const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx);
21 int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
22 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx);
23 int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
24 const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
25 int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
26 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
27 int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
28 const BIGNUM *x, int y_bit, BN_CTX *ctx);
29 int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
30 const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
31 int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
32 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
33 int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
34 const BIGNUM *x, int y_bit, BN_CTX *ctx);
35 size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p,
36 point_conversion_form_t form,
37 unsigned char *buf, size_t len, BN_CTX *ctx);
38 int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p,
39 const unsigned char *buf, size_t len, BN_CTX *ctx);
40 BIGNUM *EC_POINT_point2bn(const EC_GROUP *, const EC_POINT *,
41 point_conversion_form_t form, BIGNUM *, BN_CTX *);
42 EC_POINT *EC_POINT_bn2point(const EC_GROUP *, const BIGNUM *,
43 EC_POINT *, BN_CTX *);
44 char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *,
45 point_conversion_form_t form, BN_CTX *);
46 EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *,
47 EC_POINT *, BN_CTX *);
48
49
50=head1 DESCRIPTION
51
52An EC_POINT represents a point on a curve. A new point is constructed by calling the function EC_POINT_new and providing the B<group>
53object that the point relates to.
54
55EC_POINT_free frees the memory associated with the EC_POINT.
56
57EC_POINT_clear_free destroys any sensitive data held within the EC_POINT and then frees its memory.
58
59EC_POINT_copy copies the point B<src> into B<dst>. Both B<src> and B<dst> must use the same EC_METHOD.
60
61EC_POINT_dup creates a new EC_POINT object and copies the content from B<src> to the newly created
62EC_POINT object.
63
64EC_POINT_method_of obtains the EC_METHOD associated with B<point>.
65
66A valid point on a curve is the special point at infinity. A point is set to be at infinity by calling EC_POINT_set_to_infinity.
67
68The affine co-ordinates for a point describe a point in terms of its x and y position. The functions
69EC_POINT_set_affine_coordinates_GFp and EC_POINT_set_affine_coordinates_GF2m set the B<x> and B<y> co-ordinates for the point
70B<p> defined over the curve given in B<group>.
71
72As well as the affine co-ordinates, a point can alternatively be described in terms of its Jacobian
73projective co-ordinates (for Fp curves only). Jacobian projective co-ordinates are expressed as three values x, y and z. Working in
74this co-ordinate system provides more efficient point multiplication operations.
75A mapping exists between Jacobian projective co-ordinates and affine co-ordinates. A Jacobian projective co-ordinate (x, y, z) can be written as an affine co-ordinate as (x/(z^2), y/(z^3)). Conversion to Jacobian projective to affine co-ordinates is simple. The co-ordinate (x, y) is
76mapped to (x, y, 1). To set or get the projective co-ordinates use EC_POINT_set_Jprojective_coordinates_GFp and
77EC_POINT_get_Jprojective_coordinates_GFp respectively.
78
79Points can also be described in terms of their compressed co-ordinates. For a point (x, y), for any given value for x such that the point is
80on the curve there will only ever be two possible values for y. Therefore a point can be set using the EC_POINT_set_compressed_coordinates_GFp
81and EC_POINT_set_compressed_coordinates_GF2m functions where B<x> is the x co-ordinate and B<y_bit> is a value 0 or 1 to identify which of
82the two possible values for y should be used.
83
84In addition EC_POINTs can be converted to and from various external representations. Supported representations are octet strings, BIGNUMs and hexadecimal. The format of the external representation is described by the point_conversion_form. See L<EC_GROUP_copy(3)|EC_GROUP_copy(3)> for
85a description of point_conversion_form. Octet strings are stored in a buffer along with an associated buffer length. A point held in a BIGNUM is calculated by converting the point to an octet string and then converting that octet string into a BIGNUM integer. Points in hexadecimal format are stored in a NULL terminated character string where each character is one of the printable values 0-9 or A-F (or a-f).
86
87The functions EC_POINT_point2oct, EC_POINT_oct2point, EC_POINT_point2bn, EC_POINT_bn2point, EC_POINT_point2hex and EC_POINT_hex2point convert
88from and to EC_POINTs for the formats: octet string, BIGNUM and hexadecimal respectively.
89
90The function EC_POINT_point2oct must be supplied with a buffer long enough to store the octet string. The return value provides the number of
91octets stored. Calling the function with a NULL buffer will not perform the conversion but will still return the required buffer length.
92
93The function EC_POINT_point2hex will allocate sufficient memory to store the hexadecimal string. It is the caller's responsibility to free
94this memory with a subsequent call to OPENSSL_free().
95
96=head1 RETURN VALUES
97
98EC_POINT_new and EC_POINT_dup return the newly allocated EC_POINT or NULL on error.
99
100The following functions return 1 on success or 0 on error: EC_POINT_copy, EC_POINT_set_to_infinity, EC_POINT_set_Jprojective_coordinates_GFp,
101EC_POINT_get_Jprojective_coordinates_GFp, EC_POINT_set_affine_coordinates_GFp, EC_POINT_get_affine_coordinates_GFp,
102EC_POINT_set_compressed_coordinates_GFp, EC_POINT_set_affine_coordinates_GF2m, EC_POINT_get_affine_coordinates_GF2m,
103EC_POINT_set_compressed_coordinates_GF2m and EC_POINT_oct2point.
104
105EC_POINT_method_of returns the EC_METHOD associated with the supplied EC_POINT.
106
107EC_POINT_point2oct returns the length of the required buffer, or 0 on error.
108
109EC_POINT_point2bn returns the pointer to the BIGNUM supplied, or NULL on error.
110
111EC_POINT_bn2point returns the pointer to the EC_POINT supplied, or NULL on error.
112
113EC_POINT_point2hex returns a pointer to the hex string, or NULL on error.
114
115EC_POINT_hex2point returns the pointer to the EC_POINT supplied, or NULL on error.
116
117=head1 SEE ALSO
118
119L<crypto(3)|crypto(3)>, L<ec(3)|ec(3)>, L<EC_GROUP_new(3)|EC_GROUP_new(3)>, L<EC_GROUP_copy(3)|EC_GROUP_copy(3)>,
120L<EC_POINT_add(3)|EC_POINT_add(3)>, L<EC_KEY_new(3)|EC_KEY_new(3)>,
121L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>, L<d2i_ECPKParameters(3)|d2i_ECPKParameters(3)>
122
123=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 1a765f7aff..01e196c95f 100644
--- a/src/lib/libssl/src/doc/crypto/ERR_get_error.pod
+++ b/src/lib/libssl/src/doc/crypto/ERR_get_error.pod
@@ -49,7 +49,7 @@ additionally store the file name and line number where
49the error occurred in *B<file> and *B<line>, unless these are B<NULL>. 49the error occurred in *B<file> and *B<line>, unless these are B<NULL>.
50 50
51ERR_get_error_line_data(), ERR_peek_error_line_data() and 51ERR_get_error_line_data(), ERR_peek_error_line_data() and
52ERR_get_last_error_line_data() store additional data and flags 52ERR_peek_last_error_line_data() store additional data and flags
53associated with the error code in *B<data> 53associated with the error code in *B<data>
54and *B<flags>, unless these are B<NULL>. *B<data> contains a string 54and *B<flags>, unless these are B<NULL>. *B<data> contains a string
55if *B<flags>&B<ERR_TXT_STRING> is true. 55if *B<flags>&B<ERR_TXT_STRING> is true.
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 72925fb9f4..a4d38c17fd 100644
--- a/src/lib/libssl/src/doc/crypto/ERR_remove_state.pod
+++ b/src/lib/libssl/src/doc/crypto/ERR_remove_state.pod
@@ -2,26 +2,35 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5ERR_remove_state - free a thread's error queue 5ERR_remove_thread_state, ERR_remove_state - free a thread's error queue
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/err.h> 9 #include <openssl/err.h>
10 10
11 void ERR_remove_thread_state(const CRYPTO_THREADID *tid);
12
13Deprecated:
14
11 void ERR_remove_state(unsigned long pid); 15 void ERR_remove_state(unsigned long pid);
12 16
13=head1 DESCRIPTION 17=head1 DESCRIPTION
14 18
15ERR_remove_state() frees the error queue associated with thread B<pid>. 19ERR_remove_thread_state() frees the error queue associated with thread B<tid>.
16If B<pid> == 0, the current thread will have its error queue removed. 20If B<tid> == B<NULL>, the current thread will have its error queue removed.
17 21
18Since error queue data structures are allocated automatically for new 22Since error queue data structures are allocated automatically for new
19threads, they must be freed when threads are terminated in order to 23threads, they must be freed when threads are terminated in order to
20avoid memory leaks. 24avoid memory leaks.
21 25
26ERR_remove_state is deprecated and has been replaced by
27ERR_remove_thread_state. Since threads in OpenSSL are no longer identified
28by unsigned long values any argument to this function is ignored. Calling
29ERR_remove_state is equivalent to B<ERR_remove_thread_state(NULL)>.
30
22=head1 RETURN VALUE 31=head1 RETURN VALUE
23 32
24ERR_remove_state() returns no value. 33ERR_remove_thread_state and ERR_remove_state() return no value.
25 34
26=head1 SEE ALSO 35=head1 SEE ALSO
27 36
@@ -29,6 +38,8 @@ L<err(3)|err(3)>
29 38
30=head1 HISTORY 39=head1 HISTORY
31 40
32ERR_remove_state() is available in all versions of SSLeay and OpenSSL. 41ERR_remove_state() is available in all versions of SSLeay and OpenSSL. It
42was deprecated in OpenSSL 1.0.0 when ERR_remove_thread_state was introduced
43and thread IDs were introduced to identify threads instead of 'unsigned long'.
33 44
34=cut 45=cut
diff --git a/src/lib/libssl/src/doc/crypto/EVP_BytesToKey.pod b/src/lib/libssl/src/doc/crypto/EVP_BytesToKey.pod
index 0ea7d55c0f..fe4c0a9194 100644
--- a/src/lib/libssl/src/doc/crypto/EVP_BytesToKey.pod
+++ b/src/lib/libssl/src/doc/crypto/EVP_BytesToKey.pod
@@ -36,8 +36,8 @@ If the total key and IV length is less than the digest length and
36B<MD5> is used then the derivation algorithm is compatible with PKCS#5 v1.5 36B<MD5> is used then the derivation algorithm is compatible with PKCS#5 v1.5
37otherwise a non standard extension is used to derive the extra data. 37otherwise a non standard extension is used to derive the extra data.
38 38
39Newer applications should use more standard algorithms such as PKCS#5 39Newer applications should use more standard algorithms such as PBKDF2 as
40v2.0 for key derivation. 40defined in PKCS#5v2.1 for key derivation.
41 41
42=head1 KEY DERIVATION ALGORITHM 42=head1 KEY DERIVATION ALGORITHM
43 43
@@ -60,6 +60,7 @@ EVP_BytesToKey() returns the size of the derived key in bytes.
60=head1 SEE ALSO 60=head1 SEE ALSO
61 61
62L<evp(3)|evp(3)>, L<rand(3)|rand(3)>, 62L<evp(3)|evp(3)>, L<rand(3)|rand(3)>,
63L<PKCS5_PBKDF2_HMAC(3)|PKCS5_PBKDF2_HMAC(3)>,
63L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> 64L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>
64 65
65=head1 HISTORY 66=head1 HISTORY
diff --git a/src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod b/src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod
index f2c1cfdbf0..3a71efd23d 100644
--- a/src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod
+++ b/src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod
@@ -161,9 +161,8 @@ EVP_MD_CTX_copy_ex() returns 1 if successful or 0 for failure.
161EVP_MD_type(), EVP_MD_pkey_type() and EVP_MD_type() return the NID of the 161EVP_MD_type(), EVP_MD_pkey_type() and EVP_MD_type() return the NID of the
162corresponding OBJECT IDENTIFIER or NID_undef if none exists. 162corresponding OBJECT IDENTIFIER or NID_undef if none exists.
163 163
164EVP_MD_size(), EVP_MD_block_size(), EVP_MD_CTX_size(e), EVP_MD_size(), 164EVP_MD_size(), EVP_MD_block_size(), EVP_MD_CTX_size() and
165EVP_MD_CTX_block_size() and EVP_MD_block_size() return the digest or block 165EVP_MD_CTX_block_size() return the digest or block size in bytes.
166size in bytes.
167 166
168EVP_md_null(), EVP_md2(), EVP_md5(), EVP_sha(), EVP_sha1(), EVP_dss(), 167EVP_md_null(), EVP_md2(), EVP_md5(), EVP_sha(), EVP_sha1(), EVP_dss(),
169EVP_dss1(), EVP_mdc2() and EVP_ripemd160() return pointers to the 168EVP_dss1(), EVP_mdc2() and EVP_ripemd160() return pointers to the
diff --git a/src/lib/libssl/src/doc/crypto/EVP_EncryptInit.pod b/src/lib/libssl/src/doc/crypto/EVP_EncryptInit.pod
index b2211ea6d3..a0a782e772 100644
--- a/src/lib/libssl/src/doc/crypto/EVP_EncryptInit.pod
+++ b/src/lib/libssl/src/doc/crypto/EVP_EncryptInit.pod
@@ -16,7 +16,16 @@ EVP_CIPHER_CTX_nid, EVP_CIPHER_CTX_block_size, EVP_CIPHER_CTX_key_length,
16EVP_CIPHER_CTX_iv_length, EVP_CIPHER_CTX_get_app_data, 16EVP_CIPHER_CTX_iv_length, EVP_CIPHER_CTX_get_app_data,
17EVP_CIPHER_CTX_set_app_data, EVP_CIPHER_CTX_type, EVP_CIPHER_CTX_flags, 17EVP_CIPHER_CTX_set_app_data, EVP_CIPHER_CTX_type, EVP_CIPHER_CTX_flags,
18EVP_CIPHER_CTX_mode, EVP_CIPHER_param_to_asn1, EVP_CIPHER_asn1_to_param, 18EVP_CIPHER_CTX_mode, EVP_CIPHER_param_to_asn1, EVP_CIPHER_asn1_to_param,
19EVP_CIPHER_CTX_set_padding - EVP cipher routines 19EVP_CIPHER_CTX_set_padding, EVP_enc_null, EVP_des_cbc, EVP_des_ecb,
20EVP_des_cfb, EVP_des_ofb, EVP_des_ede_cbc, EVP_des_ede, EVP_des_ede_ofb,
21EVP_des_ede_cfb, EVP_des_ede3_cbc, EVP_des_ede3, EVP_des_ede3_ofb,
22EVP_des_ede3_cfb, EVP_desx_cbc, EVP_rc4, EVP_rc4_40, EVP_idea_cbc,
23EVP_idea_ecb, EVP_idea_cfb, EVP_idea_ofb, EVP_idea_cbc, EVP_rc2_cbc,
24EVP_rc2_ecb, EVP_rc2_cfb, EVP_rc2_ofb, EVP_rc2_40_cbc, EVP_rc2_64_cbc,
25EVP_bf_cbc, EVP_bf_ecb, EVP_bf_cfb, EVP_bf_ofb, EVP_cast5_cbc,
26EVP_cast5_ecb, EVP_cast5_cfb, EVP_cast5_ofb,
27EVP_aes_128_gcm, EVP_aes_192_gcm, EVP_aes_256_gcm, EVP_aes_128_ccm,
28EVP_aes_192_ccm, EVP_aes_256_ccm - EVP cipher routines
20 29
21=head1 SYNOPSIS 30=head1 SYNOPSIS
22 31
@@ -155,10 +164,11 @@ similar way to EVP_EncryptInit_ex(), EVP_DecryptInit_ex and
155EVP_CipherInit_ex() except the B<ctx> parameter does not need to be 164EVP_CipherInit_ex() except the B<ctx> parameter does not need to be
156initialized and they always use the default cipher implementation. 165initialized and they always use the default cipher implementation.
157 166
158EVP_EncryptFinal(), EVP_DecryptFinal() and EVP_CipherFinal() behave in a 167EVP_EncryptFinal(), EVP_DecryptFinal() and EVP_CipherFinal() are
159similar way to EVP_EncryptFinal_ex(), EVP_DecryptFinal_ex() and 168identical to EVP_EncryptFinal_ex(), EVP_DecryptFinal_ex() and
160EVP_CipherFinal_ex() except B<ctx> is automatically cleaned up 169EVP_CipherFinal_ex(). In previous releases they also used to clean up
161after the call. 170the B<ctx>, but this is no longer done and EVP_CIPHER_CTX_clean()
171must be called to free any context resources.
162 172
163EVP_get_cipherbyname(), EVP_get_cipherbynid() and EVP_get_cipherbyobj() 173EVP_get_cipherbyname(), EVP_get_cipherbynid() and EVP_get_cipherbyobj()
164return an EVP_CIPHER structure when passed a cipher name, a NID or an 174return an EVP_CIPHER structure when passed a cipher name, a NID or an
diff --git a/src/lib/libssl/src/doc/crypto/EVP_PKEY_CTX_ctrl.pod b/src/lib/libssl/src/doc/crypto/EVP_PKEY_CTX_ctrl.pod
index ba6e51100b..91125da62e 100644
--- a/src/lib/libssl/src/doc/crypto/EVP_PKEY_CTX_ctrl.pod
+++ b/src/lib/libssl/src/doc/crypto/EVP_PKEY_CTX_ctrl.pod
@@ -2,7 +2,13 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5EVP_PKEY_ctrl, EVP_PKEY_ctrl_str - algorithm specific control operations 5EVP_PKEY_CTX_ctrl, EVP_PKEY_CTX_ctrl_str, EVP_PKEY_get_default_digest_nid,
6EVP_PKEY_CTX_set_signature_md, EVP_PKEY_CTX_set_rsa_padding,
7EVP_PKEY_CTX_set_rsa_pss_saltlen, EVP_PKEY_CTX_set_rsa_rsa_keygen_bits,
8EVP_PKEY_CTX_set_rsa_keygen_pubexp, EVP_PKEY_CTX_set_dsa_paramgen_bits,
9EVP_PKEY_CTX_set_dh_paramgen_prime_len,
10EVP_PKEY_CTX_set_dh_paramgen_generator,
11EVP_PKEY_CTX_set_ec_paramgen_curve_nid - algorithm specific control operations
6 12
7=head1 SYNOPSIS 13=head1 SYNOPSIS
8 14
@@ -45,7 +51,7 @@ B<p1> and B<p2>.
45Applications will not normally call EVP_PKEY_CTX_ctrl() directly but will 51Applications will not normally call EVP_PKEY_CTX_ctrl() directly but will
46instead call one of the algorithm specific macros below. 52instead call one of the algorithm specific macros below.
47 53
48The function EVP_PKEY_ctrl_str() allows an application to send an algorithm 54The function EVP_PKEY_CTX_ctrl_str() allows an application to send an algorithm
49specific control operation to a context B<ctx> in string form. This is 55specific control operation to a context B<ctx> in string form. This is
50intended to be used for options specified on the command line or in text 56intended to be used for options specified on the command line or in text
51files. The commands supported are documented in the openssl utility 57files. The commands supported are documented in the openssl utility
diff --git a/src/lib/libssl/src/doc/crypto/EVP_SignInit.pod b/src/lib/libssl/src/doc/crypto/EVP_SignInit.pod
index 6ea6df655e..5a1b67e006 100644
--- a/src/lib/libssl/src/doc/crypto/EVP_SignInit.pod
+++ b/src/lib/libssl/src/doc/crypto/EVP_SignInit.pod
@@ -30,9 +30,11 @@ signature context B<ctx>. This function can be called several times on the
30same B<ctx> to include additional data. 30same B<ctx> to include additional data.
31 31
32EVP_SignFinal() signs the data in B<ctx> using the private key B<pkey> and 32EVP_SignFinal() signs the data in B<ctx> using the private key B<pkey> and
33places the signature in B<sig>. The number of bytes of data written (i.e. the 33places the signature in B<sig>. B<sig> must be at least EVP_PKEY_size(pkey)
34length of the signature) will be written to the integer at B<s>, at most 34bytes in size. B<s> is an OUT parameter, and not used as an IN parameter.
35EVP_PKEY_size(pkey) bytes will be written. 35The number of bytes of data written (i.e. the length of the signature)
36will be written to the integer at B<s>, at most EVP_PKEY_size(pkey) bytes
37will be written.
36 38
37EVP_SignInit() initializes a signing context B<ctx> to use the default 39EVP_SignInit() initializes a signing context B<ctx> to use the default
38implementation of digest B<type>. 40implementation of digest B<type>.
diff --git a/src/lib/libssl/src/doc/crypto/OPENSSL_config.pod b/src/lib/libssl/src/doc/crypto/OPENSSL_config.pod
index 552ed956ab..897d2cce59 100644
--- a/src/lib/libssl/src/doc/crypto/OPENSSL_config.pod
+++ b/src/lib/libssl/src/doc/crypto/OPENSSL_config.pod
@@ -73,7 +73,7 @@ Neither OPENSSL_config() nor OPENSSL_no_config() return a value.
73=head1 SEE ALSO 73=head1 SEE ALSO
74 74
75L<conf(5)|conf(5)>, L<CONF_load_modules_file(3)|CONF_load_modules_file(3)>, 75L<conf(5)|conf(5)>, L<CONF_load_modules_file(3)|CONF_load_modules_file(3)>,
76L<CONF_modules_free(3),CONF_modules_free(3)> 76L<CONF_modules_free(3)|CONF_modules_free(3)>
77 77
78=head1 HISTORY 78=head1 HISTORY
79 79
diff --git a/src/lib/libssl/src/doc/crypto/OPENSSL_load_builtin_modules.pod b/src/lib/libssl/src/doc/crypto/OPENSSL_load_builtin_modules.pod
index 6c99170197..828fec651d 100644
--- a/src/lib/libssl/src/doc/crypto/OPENSSL_load_builtin_modules.pod
+++ b/src/lib/libssl/src/doc/crypto/OPENSSL_load_builtin_modules.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5OPENSSL_load_builtin_modules - add standard configuration modules 5OPENSSL_load_builtin_modules, ASN1_add_oid_module, ENGINE_add_conf_module - add standard configuration modules
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
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 cc6c07fa24..1bba4d0212 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,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5OpenSSL_add_all_algorithms, OpenSSL_add_all_ciphers, OpenSSL_add_all_digests - 5OpenSSL_add_all_algorithms, OpenSSL_add_all_ciphers, OpenSSL_add_all_digests, EVP_cleanup -
6add algorithms to internal table 6add algorithms to internal table
7 7
8=head1 SYNOPSIS 8=head1 SYNOPSIS
diff --git a/src/lib/libssl/src/doc/crypto/PKCS5_PBKDF2_HMAC.pod b/src/lib/libssl/src/doc/crypto/PKCS5_PBKDF2_HMAC.pod
new file mode 100644
index 0000000000..7a2b8e6187
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/PKCS5_PBKDF2_HMAC.pod
@@ -0,0 +1,64 @@
1=pod
2
3=head1 NAME
4
5PKCS5_PBKDF2_HMAC, PKCS5_PBKDF2_HMAC_SHA1 - password based derivation routines with salt and iteration count
6
7=head1 SYNOPSIS
8
9 #include <openssl/evp.h>
10
11 int PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
12 const unsigned char *salt, int saltlen, int iter,
13 const EVP_MD *digest,
14 int keylen, unsigned char *out);
15
16int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,
17 const unsigned char *salt, int saltlen, int iter,
18 int keylen, unsigned char *out);
19
20=head1 DESCRIPTION
21
22PKCS5_PBKDF2_HMAC() derives a key from a password using a salt and iteration count
23as specified in RFC 2898.
24
25B<pass> is the password used in the derivation of length B<passlen>. B<pass>
26is an optional parameter and can be NULL. If B<passlen> is -1, then the
27function will calculate the length of B<pass> using strlen().
28
29B<salt> is the salt used in the derivation of length B<saltlen>. If the
30B<salt> is NULL, then B<saltlen> must be 0. The function will not
31attempt to calculate the length of the B<salt> because it is not assumed to
32be NULL terminated.
33
34B<iter> is the iteration count and its value should be greater than or
35equal to 1. RFC 2898 suggests an iteration count of at least 1000. Any
36B<iter> less than 1 is treated as a single iteration.
37
38B<digest> is the message digest function used in the derivation. Values include
39any of the EVP_* message digests. PKCS5_PBKDF2_HMAC_SHA1() calls
40PKCS5_PBKDF2_HMAC() with EVP_sha1().
41
42The derived key will be written to B<out>. The size of the B<out> buffer
43is specified via B<keylen>.
44
45=head1 NOTES
46
47A typical application of this function is to derive keying material for an
48encryption algorithm from a password in the B<pass>, a salt in B<salt>,
49and an iteration count.
50
51Increasing the B<iter> parameter slows down the algorithm which makes it
52harder for an attacker to peform a brute force attack using a large number
53of candidate passwords.
54
55=head1 RETURN VALUES
56
57PKCS5_PBKDF2_HMAC() and PBKCS5_PBKDF2_HMAC_SHA1() return 1 on success or 0 on error.
58
59=head1 SEE ALSO
60
61L<evp(3)|evp(3)>, L<rand(3)|rand(3)>,
62L<EVP_BytesToKey(3)|EVP_BytesToKey(3)>
63
64=cut
diff --git a/src/lib/libssl/src/doc/crypto/PKCS7_verify.pod b/src/lib/libssl/src/doc/crypto/PKCS7_verify.pod
index f88e66632b..781c6108a9 100644
--- a/src/lib/libssl/src/doc/crypto/PKCS7_verify.pod
+++ b/src/lib/libssl/src/doc/crypto/PKCS7_verify.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5PKCS7_verify - verify a PKCS#7 signedData structure 5PKCS7_verify, PKCS7_get0_signers - verify a PKCS#7 signedData structure
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
diff --git a/src/lib/libssl/src/doc/crypto/RSA_generate_key.pod b/src/lib/libssl/src/doc/crypto/RSA_generate_key.pod
index 867390884b..00026f04df 100644
--- a/src/lib/libssl/src/doc/crypto/RSA_generate_key.pod
+++ b/src/lib/libssl/src/doc/crypto/RSA_generate_key.pod
@@ -2,27 +2,32 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5RSA_generate_key - generate RSA key pair 5RSA_generate_key_ex, RSA_generate_key - generate RSA key pair
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/rsa.h> 9 #include <openssl/rsa.h>
10 10
11 int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
12
13Deprecated:
14
11 RSA *RSA_generate_key(int num, unsigned long e, 15 RSA *RSA_generate_key(int num, unsigned long e,
12 void (*callback)(int,int,void *), void *cb_arg); 16 void (*callback)(int,int,void *), void *cb_arg);
13 17
14=head1 DESCRIPTION 18=head1 DESCRIPTION
15 19
16RSA_generate_key() generates a key pair and returns it in a newly 20RSA_generate_key_ex() generates a key pair and stores it in the B<RSA>
17allocated B<RSA> structure. 21structure provided in B<rsa>.
18 22
19The modulus size will be B<num> bits, and the public exponent will be 23The modulus size will be of length B<bits>, and the public exponent will be
20B<e>. Key sizes with B<num> E<lt> 1024 should be considered insecure. 24B<e>. Key sizes with B<num> E<lt> 1024 should be considered insecure.
21The exponent is an odd number, typically 3, 17 or 65537. 25The exponent is an odd number, typically 3, 17 or 65537.
22 26
23A callback function may be used to provide feedback about the 27A callback function may be used to provide feedback about the
24progress of the key generation. If B<callback> is not B<NULL>, it 28progress of the key generation. If B<cb> is not B<NULL>, it
25will be called as follows: 29will be called as follows using the BN_GENCB_call() function
30described on the L<BN_generate_prime(3)|BN_generate_prime(3)> page:
26 31
27=over 4 32=over 4
28 33
@@ -34,32 +39,38 @@ described in L<BN_generate_prime(3)|BN_generate_prime(3)>.
34=item * 39=item *
35 40
36When the n-th randomly generated prime is rejected as not 41When the n-th randomly generated prime is rejected as not
37suitable for the key, B<callback(2, n, cb_arg)> is called. 42suitable for the key, B<BN_GENCB_call(cb, 2, n)> is called.
38 43
39=item * 44=item *
40 45
41When a random p has been found with p-1 relatively prime to B<e>, 46When a random p has been found with p-1 relatively prime to B<e>,
42it is called as B<callback(3, 0, cb_arg)>. 47it is called as B<BN_GENCB_call(cb, 3, 0)>.
43 48
44=back 49=back
45 50
46The process is then repeated for prime q with B<callback(3, 1, cb_arg)>. 51The process is then repeated for prime q with B<BN_GENCB_call(cb, 3, 1)>.
52
53RSA_generate_key is deprecated (new applications should use
54RSA_generate_key_ex instead). RSA_generate_key works in the same was as
55RSA_generate_key_ex except it uses "old style" call backs. See
56L<BN_generate_prime(3)|BN_generate_prime(3)> for further details.
47 57
48=head1 RETURN VALUE 58=head1 RETURN VALUE
49 59
50If key generation fails, RSA_generate_key() returns B<NULL>; the 60If key generation fails, RSA_generate_key() returns B<NULL>.
51error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. 61
62The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
52 63
53=head1 BUGS 64=head1 BUGS
54 65
55B<callback(2, x, cb_arg)> is used with two different meanings. 66B<BN_GENCB_call(cb, 2, x)> is used with two different meanings.
56 67
57RSA_generate_key() goes into an infinite loop for illegal input values. 68RSA_generate_key() goes into an infinite loop for illegal input values.
58 69
59=head1 SEE ALSO 70=head1 SEE ALSO
60 71
61L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, 72L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>,
62L<RSA_free(3)|RSA_free(3)> 73L<RSA_free(3)|RSA_free(3)>, L<BN_generate_prime(3)|BN_generate_prime(3)>
63 74
64=head1 HISTORY 75=head1 HISTORY
65 76
diff --git a/src/lib/libssl/src/doc/crypto/RSA_sign.pod b/src/lib/libssl/src/doc/crypto/RSA_sign.pod
index a82f221909..51587bdc41 100644
--- a/src/lib/libssl/src/doc/crypto/RSA_sign.pod
+++ b/src/lib/libssl/src/doc/crypto/RSA_sign.pod
@@ -20,6 +20,10 @@ RSA_sign() signs the message digest B<m> of size B<m_len> using the
20private key B<rsa> as specified in PKCS #1 v2.0. It stores the 20private key B<rsa> as specified in PKCS #1 v2.0. It stores the
21signature in B<sigret> and the signature size in B<siglen>. B<sigret> 21signature in B<sigret> and the signature size in B<siglen>. B<sigret>
22must point to RSA_size(B<rsa>) bytes of memory. 22must point to RSA_size(B<rsa>) bytes of memory.
23Note that PKCS #1 adds meta-data, placing limits on the size of the
24key that can be used.
25See L<RSA_private_encrypt(3)|RSA_private_encrypt(3)> for lower-level
26operations.
23 27
24B<type> denotes the message digest algorithm that was used to generate 28B<type> denotes the message digest algorithm that was used to generate
25B<m>. It usually is one of B<NID_sha1>, B<NID_ripemd160> and B<NID_md5>; 29B<m>. It usually is one of B<NID_sha1>, B<NID_ripemd160> and B<NID_md5>;
diff --git a/src/lib/libssl/src/doc/crypto/X509_NAME_ENTRY_get_object.pod b/src/lib/libssl/src/doc/crypto/X509_NAME_ENTRY_get_object.pod
index 86242f8242..4603202db8 100644
--- a/src/lib/libssl/src/doc/crypto/X509_NAME_ENTRY_get_object.pod
+++ b/src/lib/libssl/src/doc/crypto/X509_NAME_ENTRY_get_object.pod
@@ -65,6 +65,6 @@ set first so the relevant field information can be looked up internally.
65=head1 SEE ALSO 65=head1 SEE ALSO
66 66
67L<ERR_get_error(3)|ERR_get_error(3)>, L<d2i_X509_NAME(3)|d2i_X509_NAME(3)>, 67L<ERR_get_error(3)|ERR_get_error(3)>, L<d2i_X509_NAME(3)|d2i_X509_NAME(3)>,
68L<OBJ_nid2obj(3),OBJ_nid2obj(3)> 68L<OBJ_nid2obj(3)|OBJ_nid2obj(3)>
69 69
70=cut 70=cut
diff --git a/src/lib/libssl/src/doc/crypto/X509_STORE_CTX_get_ex_new_index.pod b/src/lib/libssl/src/doc/crypto/X509_STORE_CTX_get_ex_new_index.pod
index 392b36c3ae..25224cef1b 100644
--- a/src/lib/libssl/src/doc/crypto/X509_STORE_CTX_get_ex_new_index.pod
+++ b/src/lib/libssl/src/doc/crypto/X509_STORE_CTX_get_ex_new_index.pod
@@ -17,7 +17,7 @@ structures
17 17
18 int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *d, int idx, void *arg); 18 int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *d, int idx, void *arg);
19 19
20 char *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *d, int idx); 20 void *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *d, int idx);
21 21
22=head1 DESCRIPTION 22=head1 DESCRIPTION
23 23
diff --git a/src/lib/libssl/src/doc/crypto/crypto.pod b/src/lib/libssl/src/doc/crypto/crypto.pod
index 3c4a07d906..2349014fce 100644
--- a/src/lib/libssl/src/doc/crypto/crypto.pod
+++ b/src/lib/libssl/src/doc/crypto/crypto.pod
@@ -56,7 +56,7 @@ L<pkcs7(3)|pkcs7(3)>, L<pkcs12(3)|pkcs12(3)>
56 56
57=item INTERNAL FUNCTIONS 57=item INTERNAL FUNCTIONS
58 58
59L<bn(3)|bn(3)>, L<buffer(3)|buffer(3)>, L<lhash(3)|lhash(3)>, 59L<bn(3)|bn(3)>, L<buffer(3)|buffer(3)>, L<ec(3)|ec(3)>, L<lhash(3)|lhash(3)>,
60L<objects(3)|objects(3)>, L<stack(3)|stack(3)>, 60L<objects(3)|objects(3)>, L<stack(3)|stack(3)>,
61L<txt_db(3)|txt_db(3)> 61L<txt_db(3)|txt_db(3)>
62 62
diff --git a/src/lib/libssl/src/doc/crypto/d2i_DSAPublicKey.pod b/src/lib/libssl/src/doc/crypto/d2i_DSAPublicKey.pod
index e890841311..eeb96c485f 100644
--- a/src/lib/libssl/src/doc/crypto/d2i_DSAPublicKey.pod
+++ b/src/lib/libssl/src/doc/crypto/d2i_DSAPublicKey.pod
@@ -3,7 +3,7 @@
3=head1 NAME 3=head1 NAME
4 4
5d2i_DSAPublicKey, i2d_DSAPublicKey, d2i_DSAPrivateKey, i2d_DSAPrivateKey, 5d2i_DSAPublicKey, i2d_DSAPublicKey, d2i_DSAPrivateKey, i2d_DSAPrivateKey,
6d2i_DSA_PUBKEY, i2d_DSA_PUBKEY, d2i_DSA_SIG, i2d_DSA_SIG - DSA key encoding 6d2i_DSA_PUBKEY, i2d_DSA_PUBKEY, d2i_DSAparams, i2d_DSAparams, d2i_DSA_SIG, i2d_DSA_SIG - DSA key encoding
7and parsing functions. 7and parsing functions.
8 8
9=head1 SYNOPSIS 9=head1 SYNOPSIS
diff --git a/src/lib/libssl/src/doc/crypto/d2i_ECPKParameters.pod b/src/lib/libssl/src/doc/crypto/d2i_ECPKParameters.pod
new file mode 100644
index 0000000000..704b4ab352
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/d2i_ECPKParameters.pod
@@ -0,0 +1,84 @@
1=pod
2
3=head1 NAME
4
5d2i_ECPKParameters, i2d_ECPKParameters, d2i_ECPKParameters_bio, i2d_ECPKParameters_bio, d2i_ECPKParameters_fp, i2d_ECPKParameters_fp, ECPKParameters_print, ECPKParameters_print_fp - Functions for decoding and encoding ASN1 representations of elliptic curve entities
6
7=head1 SYNOPSIS
8
9 #include <openssl/ec.h>
10
11 EC_GROUP *d2i_ECPKParameters(EC_GROUP **px, const unsigned char **in, long len);
12 int i2d_ECPKParameters(const EC_GROUP *x, unsigned char **out);
13 #define d2i_ECPKParameters_bio(bp,x) ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x)
14 #define i2d_ECPKParameters_bio(bp,x) ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x)
15 #define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL, \
16 (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x))
17 #define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), \
18 (unsigned char *)(x))
19 int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off);
20 int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off);
21
22
23=head1 DESCRIPTION
24
25The ECPKParameters encode and decode routines encode and parse the public parameters for an
26B<EC_GROUP> structure, which represents a curve.
27
28d2i_ECPKParameters() attempts to decode B<len> bytes at B<*in>. If
29successful a pointer to the B<EC_GROUP> structure is returned. If an error
30occurred then B<NULL> is returned. If B<px> is not B<NULL> then the
31returned structure is written to B<*px>. If B<*px> is not B<NULL>
32then it is assumed that B<*px> contains a valid B<EC_GROUP>
33structure and an attempt is made to reuse it. If the call is
34successful B<*in> is incremented to the byte following the
35parsed data.
36
37i2d_ECPKParameters() encodes the structure pointed to by B<x> into DER format.
38If B<out> is not B<NULL> is writes the DER encoded data to the buffer
39at B<*out>, and increments it to point after the data just written.
40If the return value is negative an error occurred, otherwise it
41returns the length of the encoded data.
42
43If B<*out> is B<NULL> memory will be allocated for a buffer and the encoded
44data written to it. In this case B<*out> is not incremented and it points to
45the start of the data just written.
46
47d2i_ECPKParameters_bio() is similar to d2i_ECPKParameters() except it attempts
48to parse data from BIO B<bp>.
49
50d2i_ECPKParameters_fp() is similar to d2i_ECPKParameters() except it attempts
51to parse data from FILE pointer B<fp>.
52
53i2d_ECPKParameters_bio() is similar to i2d_ECPKParameters() except it writes
54the encoding of the structure B<x> to BIO B<bp> and it
55returns 1 for success and 0 for failure.
56
57i2d_ECPKParameters_fp() is similar to i2d_ECPKParameters() except it writes
58the encoding of the structure B<x> to BIO B<bp> and it
59returns 1 for success and 0 for failure.
60
61These functions are very similar to the X509 functions described in L<d2i_X509(3)|d2i_X509(3)>,
62where further notes and examples are available.
63
64The ECPKParameters_print and ECPKParameters_print_fp functions print a human-readable output
65of the public parameters of the EC_GROUP to B<bp> or B<fp>. The output lines are indented by B<off> spaces.
66
67=head1 RETURN VALUES
68
69d2i_ECPKParameters(), d2i_ECPKParameters_bio() and d2i_ECPKParameters_fp() return a valid B<EC_GROUP> structure
70or B<NULL> if an error occurs.
71
72i2d_ECPKParameters() returns the number of bytes successfully encoded or a negative
73value if an error occurs.
74
75i2d_ECPKParameters_bio(), i2d_ECPKParameters_fp(), ECPKParameters_print and ECPKParameters_print_fp
76return 1 for success and 0 if an error occurs.
77
78=head1 SEE ALSO
79
80L<crypto(3)|crypto(3)>, L<ec(3)|ec(3)>, L<EC_GROUP_new(3)|EC_GROUP_new(3)>, L<EC_GROUP_copy(3)|EC_GROUP_copy(3)>,
81L<EC_POINT_new(3)|EC_POINT_new(3)>, L<EC_POINT_add(3)|EC_POINT_add(3)>, L<EC_KEY_new(3)|EC_KEY_new(3)>,
82L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>, L<d2i_X509(3)|d2i_X509(3)>
83
84=cut
diff --git a/src/lib/libssl/src/doc/crypto/d2i_X509_CRL.pod b/src/lib/libssl/src/doc/crypto/d2i_X509_CRL.pod
index dcdc86994d..563e4de8e0 100644
--- a/src/lib/libssl/src/doc/crypto/d2i_X509_CRL.pod
+++ b/src/lib/libssl/src/doc/crypto/d2i_X509_CRL.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5d2i_X509_CRL, i2d_X509_CRL, d2i_X509_CRL_bio, d2i_509_CRL_fp, 5d2i_X509_CRL, i2d_X509_CRL, d2i_X509_CRL_bio, d2i_X509_CRL_fp,
6i2d_X509_CRL_bio, i2d_X509_CRL_fp - PKCS#10 certificate request functions. 6i2d_X509_CRL_bio, i2d_X509_CRL_fp - PKCS#10 certificate request functions.
7 7
8=head1 SYNOPSIS 8=head1 SYNOPSIS
diff --git a/src/lib/libssl/src/doc/crypto/ec.pod b/src/lib/libssl/src/doc/crypto/ec.pod
new file mode 100644
index 0000000000..7d57ba8ea0
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/ec.pod
@@ -0,0 +1,201 @@
1=pod
2
3=head1 NAME
4
5ec - Elliptic Curve functions
6
7=head1 SYNOPSIS
8
9 #include <openssl/ec.h>
10 #include <openssl/bn.h>
11
12 const EC_METHOD *EC_GFp_simple_method(void);
13 const EC_METHOD *EC_GFp_mont_method(void);
14 const EC_METHOD *EC_GFp_nist_method(void);
15 const EC_METHOD *EC_GFp_nistp224_method(void);
16 const EC_METHOD *EC_GFp_nistp256_method(void);
17 const EC_METHOD *EC_GFp_nistp521_method(void);
18
19 const EC_METHOD *EC_GF2m_simple_method(void);
20
21 EC_GROUP *EC_GROUP_new(const EC_METHOD *meth);
22 void EC_GROUP_free(EC_GROUP *group);
23 void EC_GROUP_clear_free(EC_GROUP *group);
24 int EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src);
25 EC_GROUP *EC_GROUP_dup(const EC_GROUP *src);
26 const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group);
27 int EC_METHOD_get_field_type(const EC_METHOD *meth);
28 int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor);
29 const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group);
30 int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx);
31 int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx);
32 void EC_GROUP_set_curve_name(EC_GROUP *group, int nid);
33 int EC_GROUP_get_curve_name(const EC_GROUP *group);
34 void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag);
35 int EC_GROUP_get_asn1_flag(const EC_GROUP *group);
36 void EC_GROUP_set_point_conversion_form(EC_GROUP *group, point_conversion_form_t form);
37 point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *);
38 unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x);
39 size_t EC_GROUP_get_seed_len(const EC_GROUP *);
40 size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len);
41 int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
42 int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
43 int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
44 int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
45 int EC_GROUP_get_degree(const EC_GROUP *group);
46 int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx);
47 int EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx);
48 int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx);
49 EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
50 EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
51 EC_GROUP *EC_GROUP_new_by_curve_name(int nid);
52
53 size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);
54
55 EC_POINT *EC_POINT_new(const EC_GROUP *group);
56 void EC_POINT_free(EC_POINT *point);
57 void EC_POINT_clear_free(EC_POINT *point);
58 int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src);
59 EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group);
60 const EC_METHOD *EC_POINT_method_of(const EC_POINT *point);
61 int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);
62 int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
63 const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx);
64 int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
65 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx);
66 int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
67 const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
68 int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
69 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
70 int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
71 const BIGNUM *x, int y_bit, BN_CTX *ctx);
72 int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
73 const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
74 int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
75 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
76 int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
77 const BIGNUM *x, int y_bit, BN_CTX *ctx);
78 size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p,
79 point_conversion_form_t form,
80 unsigned char *buf, size_t len, BN_CTX *ctx);
81 int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p,
82 const unsigned char *buf, size_t len, BN_CTX *ctx);
83 BIGNUM *EC_POINT_point2bn(const EC_GROUP *, const EC_POINT *,
84 point_conversion_form_t form, BIGNUM *, BN_CTX *);
85 EC_POINT *EC_POINT_bn2point(const EC_GROUP *, const BIGNUM *,
86 EC_POINT *, BN_CTX *);
87 char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *,
88 point_conversion_form_t form, BN_CTX *);
89 EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *,
90 EC_POINT *, BN_CTX *);
91
92 int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx);
93 int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx);
94 int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx);
95 int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *p);
96 int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx);
97 int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx);
98 int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx);
99 int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], BN_CTX *ctx);
100 int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, size_t num, const EC_POINT *p[], const BIGNUM *m[], BN_CTX *ctx);
101 int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx);
102 int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx);
103 int EC_GROUP_have_precompute_mult(const EC_GROUP *group);
104
105 int EC_GROUP_get_basis_type(const EC_GROUP *);
106 int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k);
107 int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
108 unsigned int *k2, unsigned int *k3);
109 EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len);
110 int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out);
111 #define d2i_ECPKParameters_bio(bp,x) ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x)
112 #define i2d_ECPKParameters_bio(bp,x) ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x)
113 #define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL, \
114 (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x))
115 #define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), \
116 (unsigned char *)(x))
117 int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off);
118 int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off);
119
120 EC_KEY *EC_KEY_new(void);
121 int EC_KEY_get_flags(const EC_KEY *key);
122 void EC_KEY_set_flags(EC_KEY *key, int flags);
123 void EC_KEY_clear_flags(EC_KEY *key, int flags);
124 EC_KEY *EC_KEY_new_by_curve_name(int nid);
125 void EC_KEY_free(EC_KEY *key);
126 EC_KEY *EC_KEY_copy(EC_KEY *dst, const EC_KEY *src);
127 EC_KEY *EC_KEY_dup(const EC_KEY *src);
128 int EC_KEY_up_ref(EC_KEY *key);
129 const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key);
130 int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group);
131 const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key);
132 int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv);
133 const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key);
134 int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub);
135 unsigned EC_KEY_get_enc_flags(const EC_KEY *key);
136 void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags);
137 point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key);
138 void EC_KEY_set_conv_form(EC_KEY *eckey, point_conversion_form_t cform);
139 void *EC_KEY_get_key_method_data(EC_KEY *key,
140 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
141 void EC_KEY_insert_key_method_data(EC_KEY *key, void *data,
142 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
143 void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag);
144 int EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx);
145 int EC_KEY_generate_key(EC_KEY *key);
146 int EC_KEY_check_key(const EC_KEY *key);
147 int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, BIGNUM *y);
148
149 EC_KEY *d2i_ECPrivateKey(EC_KEY **key, const unsigned char **in, long len);
150 int i2d_ECPrivateKey(EC_KEY *key, unsigned char **out);
151
152 EC_KEY *d2i_ECParameters(EC_KEY **key, const unsigned char **in, long len);
153 int i2d_ECParameters(EC_KEY *key, unsigned char **out);
154
155 EC_KEY *o2i_ECPublicKey(EC_KEY **key, const unsigned char **in, long len);
156 int i2o_ECPublicKey(EC_KEY *key, unsigned char **out);
157 int ECParameters_print(BIO *bp, const EC_KEY *key);
158 int EC_KEY_print(BIO *bp, const EC_KEY *key, int off);
159 int ECParameters_print_fp(FILE *fp, const EC_KEY *key);
160 int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off);
161 #define ECParameters_dup(x) ASN1_dup_of(EC_KEY,i2d_ECParameters,d2i_ECParameters,x)
162 #define EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, nid) \
163 EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_PARAMGEN, \
164 EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID, nid, NULL)
165
166
167=head1 DESCRIPTION
168
169This library provides an extensive set of functions for performing operations on elliptic curves over finite fields.
170In general an elliptic curve is one with an equation of the form:
171
172y^2 = x^3 + ax + b
173
174An B<EC_GROUP> structure is used to represent the definition of an elliptic curve. Points on a curve are stored using an
175B<EC_POINT> structure. An B<EC_KEY> is used to hold a private/public key pair, where a private key is simply a BIGNUM and a
176public key is a point on a curve (represented by an B<EC_POINT>).
177
178The library contains a number of alternative implementations of the different functions. Each implementation is optimised
179for different scenarios. No matter which implementation is being used, the interface remains the same. The library
180handles calling the correct implementation when an interface function is invoked. An implementation is represented by
181an B<EC_METHOD> structure.
182
183The creation and destruction of B<EC_GROUP> objects is described in L<EC_GROUP_new(3)|EC_GROUP_new(3)>. Functions for
184manipulating B<EC_GROUP> objects are described in L<EC_GROUP_copy(3)|EC_GROUP_copy(3)>.
185
186Functions for creating, destroying and manipulating B<EC_POINT> objects are explained in L<EC_POINT_new(3)|EC_POINT_new(3)>,
187whilst functions for performing mathematical operations and tests on B<EC_POINTs> are coverd in L<EC_POINT_add(3)|EC_POINT_add(3)>.
188
189For working with private and public keys refer to L<EC_KEY_new(3)|EC_KEY_new(3)>. Implementations are covered in
190L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>.
191
192For information on encoding and decoding curve parameters to and from ASN1 see L<d2i_ECPKParameters(3)|d2i_ECPKParameters(3)>.
193
194=head1 SEE ALSO
195
196L<crypto(3)|crypto(3)>, L<EC_GROUP_new(3)|EC_GROUP_new(3)>, L<EC_GROUP_copy(3)|EC_GROUP_copy(3)>,
197L<EC_POINT_new(3)|EC_POINT_new(3)>, L<EC_POINT_add(3)|EC_POINT_add(3)>, L<EC_KEY_new(3)|EC_KEY_new(3)>,
198L<EC_GFp_simple_method(3)|EC_GFp_simple_method(3)>, L<d2i_ECPKParameters(3)|d2i_ECPKParameters(3)>
199
200
201=cut
diff --git a/src/lib/libssl/src/doc/crypto/ecdsa.pod b/src/lib/libssl/src/doc/crypto/ecdsa.pod
index f54966df33..b981d865e4 100644
--- a/src/lib/libssl/src/doc/crypto/ecdsa.pod
+++ b/src/lib/libssl/src/doc/crypto/ecdsa.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5ecdsa - Elliptic Curve Digital Signature Algorithm 5ECDSA_SIG_new, ECDSA_SIG_free, i2d_ECDSA_SIG, d2i_ECDSA_SIG, ECDSA_size, ECDSA_sign_setup, ECDSA_sign, ECDSA_sign_ex, ECDSA_verify, ECDSA_do_sign, ECDSA_do_sign_ex, ECDSA_do_verify - Elliptic Curve Digital Signature Algorithm
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
diff --git a/src/lib/libssl/src/doc/crypto/evp.pod b/src/lib/libssl/src/doc/crypto/evp.pod
index 33ce7cb6d6..57c761d01f 100644
--- a/src/lib/libssl/src/doc/crypto/evp.pod
+++ b/src/lib/libssl/src/doc/crypto/evp.pod
@@ -13,22 +13,58 @@ evp - high-level cryptographic functions
13The EVP library provides a high-level interface to cryptographic 13The EVP library provides a high-level interface to cryptographic
14functions. 14functions.
15 15
16B<EVP_Seal>I<...> and B<EVP_Open>I<...> provide public key encryption 16L<B<EVP_Seal>I<...>|EVP_SealInit(3)> and L<B<EVP_Open>I<...>|EVP_OpenInit(3)>
17and decryption to implement digital "envelopes". 17provide public key encryption and decryption to implement digital "envelopes".
18 18
19The B<EVP_Sign>I<...> and B<EVP_Verify>I<...> functions implement 19The L<B<EVP_DigestSign>I<...>|EVP_DigestSignInit(3)> and
20digital signatures. 20L<B<EVP_DigestVerify>I<...>|EVP_DigestVerifyInit(3)> functions implement
21digital signatures and Message Authentication Codes (MACs). Also see the older
22L<B<EVP_Sign>I<...>|EVP_SignInit(3)> and L<B<EVP_Verify>I<...>|EVP_VerifyInit(3)>
23functions.
21 24
22Symmetric encryption is available with the B<EVP_Encrypt>I<...> 25Symmetric encryption is available with the L<B<EVP_Encrypt>I<...>|EVP_EncryptInit(3)>
23functions. The B<EVP_Digest>I<...> functions provide message digests. 26functions. The L<B<EVP_Digest>I<...>|EVP_DigestInit(3)> functions provide message digests.
24 27
25The B<EVP_PKEY>I<...> functions provide a high level interface to 28The B<EVP_PKEY>I<...> functions provide a high level interface to
26asymmetric algorithms. 29asymmetric algorithms. To create a new EVP_PKEY see
30L<EVP_PKEY_new(3)|EVP_PKEY_new(3)>. EVP_PKEYs can be associated
31with a private key of a particular algorithm by using the functions
32described on the L<EVP_PKEY_set1_RSA(3)|EVP_PKEY_set1_RSA(3)> page, or
33new keys can be generated using L<EVP_PKEY_keygen(3)|EVP_PKEY_keygen(3)>.
34EVP_PKEYs can be compared using L<EVP_PKEY_cmp(3)|EVP_PKEY_cmp(3)>, or printed using
35L<EVP_PKEY_print_private(3)|EVP_PKEY_print_private(3)>.
36
37The EVP_PKEY functions support the full range of asymmetric algorithm operations:
38
39=over
40
41=item For key agreement see L<EVP_PKEY_derive(3)|EVP_PKEY_derive(3)>
42
43=item For signing and verifying see L<EVP_PKEY_sign(3)|EVP_PKEY_sign(3)>,
44L<EVP_PKEY_verify(3)|EVP_PKEY_verify(3)> and L<EVP_PKEY_verify_recover(3)|EVP_PKEY_verify_recover(3)>.
45However, note that
46these functions do not perform a digest of the data to be signed. Therefore
47normally you would use the L<B<EVP_DigestSign>I<...>|EVP_DigestSignInit(3)>
48functions for this purpose.
49
50=item For encryption and decryption see L<EVP_PKEY_encrypt(3)|EVP_PKEY_encrypt(3)>
51and L<EVP_PKEY_decrypt(3)|EVP_PKEY_decrypt(3)> respectively. However, note that
52these functions perform encryption and decryption only. As public key
53encryption is an expensive operation, normally you would wrap
54an encrypted message in a "digital envelope" using the L<B<EVP_Seal>I<...>|EVP_SealInit(3)> and
55L<B<EVP_Open>I<...>|EVP_OpenInit(3)> functions.
56
57=back
58
59The L<EVP_BytesToKey(3)|EVP_BytesToKey(3)> function provides some limited support for password
60based encryption. Careful selection of the parameters will provide a PKCS#5 PBKDF1 compatible
61implementation. However, new applications should not typically use this (preferring, for example,
62PBKDF2 from PCKS#5).
27 63
28Algorithms are loaded with OpenSSL_add_all_algorithms(3). 64Algorithms are loaded with L<OpenSSL_add_all_algorithms(3)|OpenSSL_add_all_algorithms(3)>.
29 65
30All the symmetric algorithms (ciphers), digests and asymmetric algorithms 66All the symmetric algorithms (ciphers), digests and asymmetric algorithms
31(public key algorithms) can be replaced by ENGINE modules providing alternative 67(public key algorithms) can be replaced by L<ENGINE|engine(3)> modules providing alternative
32implementations. If ENGINE implementations of ciphers or digests are registered 68implementations. If ENGINE implementations of ciphers or digests are registered
33as defaults, then the various EVP functions will automatically use those 69as defaults, then the various EVP functions will automatically use those
34implementations automatically in preference to built in software 70implementations automatically in preference to built in software
@@ -47,8 +83,20 @@ L<EVP_DigestInit(3)|EVP_DigestInit(3)>,
47L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>, 83L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>,
48L<EVP_OpenInit(3)|EVP_OpenInit(3)>, 84L<EVP_OpenInit(3)|EVP_OpenInit(3)>,
49L<EVP_SealInit(3)|EVP_SealInit(3)>, 85L<EVP_SealInit(3)|EVP_SealInit(3)>,
86L<EVP_DigestSignInit(3)|EVP_DigestSignInit(3)>,
50L<EVP_SignInit(3)|EVP_SignInit(3)>, 87L<EVP_SignInit(3)|EVP_SignInit(3)>,
51L<EVP_VerifyInit(3)|EVP_VerifyInit(3)>, 88L<EVP_VerifyInit(3)|EVP_VerifyInit(3)>,
89L<EVP_PKEY_new(3)|EVP_PKEY_new(3)>,
90L<EVP_PKEY_set1_RSA(3)|EVP_PKEY_set1_RSA(3)>,
91L<EVP_PKEY_keygen(3)|EVP_PKEY_keygen(3)>,
92L<EVP_PKEY_print_private(3)|EVP_PKEY_print_private(3)>,
93L<EVP_PKEY_decrypt(3)|EVP_PKEY_decrypt(3)>,
94L<EVP_PKEY_encrypt(3)|EVP_PKEY_encrypt(3)>,
95L<EVP_PKEY_sign(3)|EVP_PKEY_sign(3)>,
96L<EVP_PKEY_verify(3)|EVP_PKEY_verify(3)>,
97L<EVP_PKEY_verify_recover(3)|EVP_PKEY_verify_recover(3)>,
98L<EVP_PKEY_derive(3)|EVP_PKEY_derive(3)>,
99L<EVP_BytesToKey(3)|EVP_BytesToKey(3)>,
52L<OpenSSL_add_all_algorithms(3)|OpenSSL_add_all_algorithms(3)>, 100L<OpenSSL_add_all_algorithms(3)|OpenSSL_add_all_algorithms(3)>,
53L<engine(3)|engine(3)> 101L<engine(3)|engine(3)>
54 102
diff --git a/src/lib/libssl/src/doc/crypto/i2d_PKCS7_bio_stream.pod b/src/lib/libssl/src/doc/crypto/i2d_PKCS7_bio_stream.pod
index dc4d884c59..a37231e267 100644
--- a/src/lib/libssl/src/doc/crypto/i2d_PKCS7_bio_stream.pod
+++ b/src/lib/libssl/src/doc/crypto/i2d_PKCS7_bio_stream.pod
@@ -23,7 +23,7 @@ streaming.
23 23
24=head1 BUGS 24=head1 BUGS
25 25
26The prefix "d2i" is arguably wrong because the function outputs BER format. 26The prefix "i2d" is arguably wrong because the function outputs BER format.
27 27
28=head1 RETURN VALUES 28=head1 RETURN VALUES
29 29
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CIPHER_get_name.pod b/src/lib/libssl/src/doc/ssl/SSL_CIPHER_get_name.pod
index fbade905f3..3ed016ee2c 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_CIPHER_get_name.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_CIPHER_get_name.pod
@@ -24,8 +24,12 @@ SSL_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 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. 25chosen algorithm. If B<cipher> is NULL, 0 is returned.
26 26
27SSL_CIPHER_get_version() returns the protocol version for B<cipher>, currently 27SSL_CIPHER_get_version() returns string which indicates the SSL/TLS protocol
28"SSLv2", "SSLv3", or "TLSv1". If B<cipher> is NULL, "(NONE)" is returned. 28version that first defined the cipher.
29This is currently B<SSLv2> or B<TLSv1/SSLv3>.
30In some cases it should possibly return "TLSv1.2" but the function does not;
31use SSL_CIPHER_description() instead.
32If B<cipher> is NULL, "(NONE)" is returned.
29 33
30SSL_CIPHER_description() returns a textual description of the cipher used 34SSL_CIPHER_description() returns a textual description of the cipher used
31into the buffer B<buf> of length B<len> provided. 35into the buffer B<buf> of length B<len> provided.
@@ -53,7 +57,8 @@ Textual representation of the cipher name.
53 57
54=item <protocol version> 58=item <protocol version>
55 59
56Protocol version: B<SSLv2>, B<SSLv3>. The TLSv1 ciphers are flagged with SSLv3. 60Protocol version: B<SSLv2>, B<SSLv3>, B<TLSv1.2>. The TLSv1.0 ciphers are
61flagged with SSLv3. No new ciphers were added by TLSv1.1.
57 62
58=item Kx=<key exchange> 63=item Kx=<key exchange>
59 64
@@ -92,6 +97,10 @@ Some examples for the output of SSL_CIPHER_description():
92 RC4-MD5 SSLv3 Kx=RSA Au=RSA Enc=RC4(128) Mac=MD5 97 RC4-MD5 SSLv3 Kx=RSA Au=RSA Enc=RC4(128) Mac=MD5
93 EXP-RC4-MD5 SSLv3 Kx=RSA(512) Au=RSA Enc=RC4(40) Mac=MD5 export 98 EXP-RC4-MD5 SSLv3 Kx=RSA(512) Au=RSA Enc=RC4(40) Mac=MD5 export
94 99
100A complete list can be retrieved by invoking the following command:
101
102 openssl ciphers -v ALL
103
95=head1 BUGS 104=head1 BUGS
96 105
97If SSL_CIPHER_description() is called with B<cipher> being NULL, the 106If SSL_CIPHER_description() is called with B<cipher> being NULL, the
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_add_extra_chain_cert.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_add_extra_chain_cert.pod
index ee28f5ccc3..df5441caec 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_CTX_add_extra_chain_cert.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_add_extra_chain_cert.pod
@@ -24,6 +24,10 @@ the library will try to complete the chain from the available CA
24certificates in the trusted CA storage, see 24certificates in the trusted CA storage, see
25L<SSL_CTX_load_verify_locations(3)|SSL_CTX_load_verify_locations(3)>. 25L<SSL_CTX_load_verify_locations(3)|SSL_CTX_load_verify_locations(3)>.
26 26
27The B<x509> certificate provided to SSL_CTX_add_extra_chain_cert() will be
28freed by the library when the B<SSL_CTX> is destroyed. An application B<should
29not> free the B<x509> object.
30
27=head1 RETURN VALUES 31=head1 RETURN VALUES
28 32
29SSL_CTX_add_extra_chain_cert() returns 1 on success. Check out the 33SSL_CTX_add_extra_chain_cert() returns 1 on success. Check out the
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_add_session.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_add_session.pod
index c9e0fabb98..7f1a1d5ee6 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_CTX_add_session.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_add_session.pod
@@ -42,7 +42,7 @@ If a server SSL_CTX is configured with the SSL_SESS_CACHE_NO_INTERNAL_STORE
42flag then the internal cache will not be populated automatically by new 42flag then the internal cache will not be populated automatically by new
43sessions negotiated by the SSL/TLS implementation, even though the internal 43sessions negotiated by the SSL/TLS implementation, even though the internal
44cache will be searched automatically for session-resume requests (the 44cache will be searched automatically for session-resume requests (the
45latter can be surpressed by SSL_SESS_CACHE_NO_INTERNAL_LOOKUP). So the 45latter can be suppressed by SSL_SESS_CACHE_NO_INTERNAL_LOOKUP). So the
46application can use SSL_CTX_add_session() directly to have full control 46application can use SSL_CTX_add_session() directly to have full control
47over the sessions that can be resumed if desired. 47over the sessions that can be resumed if desired.
48 48
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_new.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_new.pod
index d35306812e..023be38c0a 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_CTX_new.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_new.pod
@@ -2,8 +2,10 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5SSL_CTX_new - create a new SSL_CTX object as framework for TLS/SSL enabled 5SSL_CTX_new, SSLv3_method, SSLv3_server_method, SSLv3_client_method,
6functions 6TLSv1_method, TLSv1_server_method, TLSv1_client_method,
7TLSv1_1_method, TLSv1_1_server_method, TLSv1_1_client_method, SSLv23_method,
8SSLv23_server_method, SSLv23_client_method - create a new SSL_CTX object as framework for TLS/SSL enabled functions
7 9
8=head1 SYNOPSIS 10=head1 SYNOPSIS
9 11
@@ -24,13 +26,6 @@ client only type. B<method> can be of the following types:
24 26
25=over 4 27=over 4
26 28
27=item SSLv2_method(void), SSLv2_server_method(void), SSLv2_client_method(void)
28
29A TLS/SSL connection established with these methods will only understand
30the SSLv2 protocol. A client will send out SSLv2 client hello messages
31and will also indicate that it only understand SSLv2. A server will only
32understand SSLv2 client hello messages.
33
34=item SSLv3_method(void), SSLv3_server_method(void), SSLv3_client_method(void) 29=item SSLv3_method(void), SSLv3_server_method(void), SSLv3_client_method(void)
35 30
36A TLS/SSL connection established with these methods will only understand the 31A TLS/SSL connection established with these methods will only understand the
@@ -52,22 +47,25 @@ SSLv3 client hello messages.
52 47
53=item SSLv23_method(void), SSLv23_server_method(void), SSLv23_client_method(void) 48=item SSLv23_method(void), SSLv23_server_method(void), SSLv23_client_method(void)
54 49
55A TLS/SSL connection established with these methods will understand the SSLv2, 50A TLS/SSL connection established with these methods may understand the
56SSLv3, and TLSv1 protocol. A client will send out SSLv2 client hello messages 51SSLv3, TLSv1, TLSv1.1 and TLSv1.2 protocols.
57and will indicate that it also understands SSLv3 and TLSv1. A server will 52
58understand SSLv2, SSLv3, and TLSv1 client hello messages. This is the best 53A client will send out TLSv1 client hello messages including extensions and
59choice when compatibility is a concern. 54will indicate that it also understands TLSv1.1, TLSv1.2 and permits a
55fallback to SSLv3. A server will support SSLv3, TLSv1, TLSv1.1 and TLSv1.2
56protocols. This is the best choice when compatibility is a concern.
60 57
61=back 58=back
62 59
63The list of protocols available can later be limited using the SSL_OP_NO_SSLv2, 60The list of protocols available can later be limited using the
64SSL_OP_NO_SSLv3, SSL_OP_NO_TLSv1 options of the B<SSL_CTX_set_options()> or 61SSL_OP_NO_SSLv3, SSL_OP_NO_TLSv1, SSL_OP_NO_TLSv1_1 and SSL_OP_NO_TLSv1_2
65B<SSL_set_options()> functions. Using these options it is possible to choose 62options of the SSL_CTX_set_options() or SSL_set_options() functions.
66e.g. SSLv23_server_method() and be able to negotiate with all possible 63Using these options it is possible to choose e.g. SSLv23_server_method() and
67clients, but to only allow newer protocols like SSLv3 or TLSv1. 64be able to negotiate with all possible clients, but to only allow newer
65protocols like TLSv1, TLSv1.1 or TLS v1.2.
68 66
69SSL_CTX_new() initializes the list of ciphers, the session cache setting, 67SSL_CTX_new() initializes the list of ciphers, the session cache setting,
70the callbacks, the keys and certificates, and the options to its default 68the callbacks, the keys and certificates and the options to its default
71values. 69values.
72 70
73=head1 RETURN VALUES 71=head1 RETURN VALUES
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_client_CA_list.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_client_CA_list.pod
index a68fbd09ee..d1758a7d20 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_client_CA_list.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_client_CA_list.pod
@@ -35,7 +35,7 @@ the chosen B<ssl>, overriding the setting valid for B<ssl>'s SSL_CTX object.
35=head1 NOTES 35=head1 NOTES
36 36
37When a TLS/SSL server requests a client certificate (see 37When a TLS/SSL server requests a client certificate (see
38B<SSL_CTX_set_verify_options()>), it sends a list of CAs, for which 38B<SSL_CTX_set_verify(3)>), it sends a list of CAs, for which
39it will accept certificates, to the client. 39it will accept certificates, to the client.
40 40
41This list must explicitly be set using SSL_CTX_set_client_CA_list() for 41This list must explicitly be set using SSL_CTX_set_client_CA_list() for
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_client_cert_cb.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_client_cert_cb.pod
index da2bf7bbcc..0462bbebac 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_client_cert_cb.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_client_cert_cb.pod
@@ -1,4 +1,4 @@
1=pod 13=pod
2 2
3=head1 NAME 3=head1 NAME
4 4
@@ -30,7 +30,7 @@ using the B<x509> and B<pkey> arguments and "1" must be returned. The
30certificate will be installed into B<ssl>, see the NOTES and BUGS sections. 30certificate will be installed into B<ssl>, see the NOTES and BUGS sections.
31If no certificate should be set, "0" has to be returned and no certificate 31If no certificate should be set, "0" has to be returned and no certificate
32will be sent. A negative return value will suspend the handshake and the 32will be sent. A negative return value will suspend the handshake and the
33handshake function will return immediatly. L<SSL_get_error(3)|SSL_get_error(3)> 33handshake function will return immediately. L<SSL_get_error(3)|SSL_get_error(3)>
34will return SSL_ERROR_WANT_X509_LOOKUP to indicate, that the handshake was 34will return SSL_ERROR_WANT_X509_LOOKUP to indicate, that the handshake was
35suspended. The next call to the handshake function will again lead to the call 35suspended. The next call to the handshake function will again lead to the call
36of client_cert_cb(). It is the job of the client_cert_cb() to store information 36of client_cert_cb(). It is the job of the client_cert_cb() to store information
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_info_callback.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_info_callback.pod
index 108a1748c1..f7923dedc1 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_info_callback.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_info_callback.pod
@@ -21,7 +21,7 @@ SSL_CTX_set_info_callback() sets the B<callback> function, that can be used to
21obtain state information for SSL objects created from B<ctx> during connection 21obtain state information for SSL objects created from B<ctx> during connection
22setup and use. The setting for B<ctx> is overridden from the setting for 22setup and use. The setting for B<ctx> is overridden from the setting for
23a specific SSL object, if specified. 23a specific SSL object, if specified.
24When B<callback> is NULL, not callback function is used. 24When B<callback> is NULL, no callback function is used.
25 25
26SSL_set_info_callback() sets the B<callback> function, that can be used to 26SSL_set_info_callback() sets the B<callback> function, that can be used to
27obtain state information for B<ssl> during connection setup and use. 27obtain state information for B<ssl> during connection setup and use.
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_msg_callback.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_msg_callback.pod
index b8d72fffaf..89a33e8750 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_msg_callback.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_msg_callback.pod
@@ -12,8 +12,8 @@ SSL_get_msg_callback_arg - install callback for observing protocol messages
12 void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); 12 void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg));
13 void SSL_CTX_set_msg_callback_arg(SSL_CTX *ctx, void *arg); 13 void SSL_CTX_set_msg_callback_arg(SSL_CTX *ctx, void *arg);
14 14
15 void SSL_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); 15 void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg));
16 void SSL_set_msg_callback_arg(SSL_CTX *ctx, void *arg); 16 void SSL_set_msg_callback_arg(SSL *ssl, void *arg);
17 17
18=head1 DESCRIPTION 18=head1 DESCRIPTION
19 19
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_options.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_options.pod
index 77e0e6074c..74f8b5d932 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_options.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_options.pod
@@ -46,7 +46,7 @@ secure renegotiation.
46=head1 NOTES 46=head1 NOTES
47 47
48The behaviour of the SSL library can be changed by setting several options. 48The behaviour of the SSL library can be changed by setting several options.
49The options are coded as bitmasks and can be combined by a logical B<or> 49The options are coded as bitmasks and can be combined by a bitwise B<or>
50operation (|). 50operation (|).
51 51
52SSL_CTX_set_options() and SSL_set_options() affect the (external) 52SSL_CTX_set_options() and SSL_set_options() affect the (external)
@@ -255,7 +255,7 @@ Connections and renegotiation are always permitted by OpenSSL implementations.
255 255
256=head2 Unpatched client and patched OpenSSL server 256=head2 Unpatched client and patched OpenSSL server
257 257
258The initial connection suceeds but client renegotiation is denied by the 258The initial connection succeeds but client renegotiation is denied by the
259server with a B<no_renegotiation> warning alert if TLS v1.0 is used or a fatal 259server with a B<no_renegotiation> warning alert if TLS v1.0 is used or a fatal
260B<handshake_failure> alert in SSL v3.0. 260B<handshake_failure> alert in SSL v3.0.
261 261
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod
index e31c628fa8..0fda967814 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod
@@ -13,12 +13,10 @@ SSL_set_tmp_dh - handle DH keys for ephemeral key exchange
13 DH *(*tmp_dh_callback)(SSL *ssl, int is_export, int keylength)); 13 DH *(*tmp_dh_callback)(SSL *ssl, int is_export, int keylength));
14 long SSL_CTX_set_tmp_dh(SSL_CTX *ctx, DH *dh); 14 long SSL_CTX_set_tmp_dh(SSL_CTX *ctx, DH *dh);
15 15
16 void SSL_set_tmp_dh_callback(SSL_CTX *ctx, 16 void SSL_set_tmp_dh_callback(SSL *ssl,
17 DH *(*tmp_dh_callback)(SSL *ssl, int is_export, int keylength)); 17 DH *(*tmp_dh_callback)(SSL *ssl, int is_export, int keylength));
18 long SSL_set_tmp_dh(SSL *ssl, DH *dh) 18 long SSL_set_tmp_dh(SSL *ssl, DH *dh)
19 19
20 DH *(*tmp_dh_callback)(SSL *ssl, int is_export, int keylength));
21
22=head1 DESCRIPTION 20=head1 DESCRIPTION
23 21
24SSL_CTX_set_tmp_dh_callback() sets the callback function for B<ctx> to be 22SSL_CTX_set_tmp_dh_callback() sets the callback function for B<ctx> to be
@@ -82,7 +80,7 @@ instead (see L<dhparam(1)|dhparam(1)>), but in this case SSL_OP_SINGLE_DH_USE
82is mandatory. 80is mandatory.
83 81
84Application authors may compile in DH parameters. Files dh512.pem, 82Application authors may compile in DH parameters. Files dh512.pem,
85dh1024.pem, dh2048.pem, and dh4096 in the 'apps' directory of current 83dh1024.pem, dh2048.pem, and dh4096.pem in the 'apps' directory of current
86version of the OpenSSL distribution contain the 'SKIP' DH parameters, 84version of the OpenSSL distribution contain the 'SKIP' DH parameters,
87which use safe primes and were generated verifiably pseudo-randomly. 85which use safe primes and were generated verifiably pseudo-randomly.
88These files can be converted into C code using the B<-C> option of the 86These files can be converted into C code using the B<-C> option of the
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_verify.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_verify.pod
index 05df3d974f..0af8e69441 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_verify.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_verify.pod
@@ -110,8 +110,8 @@ certificates would not be present, most likely a
110X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY will be issued. 110X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY will be issued.
111The depth count is "level 0:peer certificate", "level 1: CA certificate", 111The depth count is "level 0:peer certificate", "level 1: CA certificate",
112"level 2: higher level CA certificate", and so on. Setting the maximum 112"level 2: higher level CA certificate", and so on. Setting the maximum
113depth to 2 allows the levels 0, 1, and 2. The default depth limit is 9, 113depth to 2 allows the levels 0, 1, and 2. The default depth limit is 100,
114allowing for the peer certificate and additional 9 CA certificates. 114allowing for the peer certificate and additional 100 CA certificates.
115 115
116The B<verify_callback> function is used to control the behaviour when the 116The B<verify_callback> function is used to control the behaviour when the
117SSL_VERIFY_PEER flag is set. It must be supplied by the application and 117SSL_VERIFY_PEER flag is set. It must be supplied by the application and
diff --git a/src/lib/libssl/src/doc/ssl/SSL_get_fd.pod b/src/lib/libssl/src/doc/ssl/SSL_get_fd.pod
index 89260b522c..19e52d68d0 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_get_fd.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_get_fd.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5SSL_get_fd - get file descriptor linked to an SSL object 5SSL_get_fd, SSL_get_rfd, SSL_get_wfd - get file descriptor linked to an SSL object
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
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
index 49fb88f86f..059376c76b 100644
--- 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
@@ -8,11 +8,11 @@ SSL_get_peer_cert_chain - get the X509 certificate chain of the peer
8 8
9 #include <openssl/ssl.h> 9 #include <openssl/ssl.h>
10 10
11 STACKOF(X509) *SSL_get_peer_cert_chain(const SSL *ssl); 11 STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *ssl);
12 12
13=head1 DESCRIPTION 13=head1 DESCRIPTION
14 14
15SSL_get_peer_cert_chain() returns a pointer to STACKOF(X509) certificates 15SSL_get_peer_cert_chain() returns a pointer to STACK_OF(X509) certificates
16forming the certificate chain of the peer. If called on the client side, 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 17the stack also contains the peer's certificate; if called on the server
18side, the peer's certificate must be obtained separately using 18side, the peer's certificate must be obtained separately using
@@ -24,7 +24,7 @@ If the peer did not present a certificate, NULL is returned.
24The peer certificate chain is not necessarily available after reusing 24The peer certificate chain is not necessarily available after reusing
25a session, in which case a NULL pointer is returned. 25a session, in which case a NULL pointer is returned.
26 26
27The reference count of the STACKOF(X509) object is not incremented. 27The reference count of the STACK_OF(X509) object is not incremented.
28If the corresponding session is freed, the pointer must not be used 28If the corresponding session is freed, the pointer must not be used
29any longer. 29any longer.
30 30
@@ -39,7 +39,7 @@ The following return values can occur:
39No certificate was presented by the peer or no connection was established 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. 40or the certificate chain is no longer available when a session is reused.
41 41
42=item Pointer to a STACKOF(X509) 42=item Pointer to a STACK_OF(X509)
43 43
44The return value points to the certificate chain presented by the peer. 44The return value points to the certificate chain presented by the peer.
45 45
diff --git a/src/lib/libssl/src/doc/ssl/SSL_get_rbio.pod b/src/lib/libssl/src/doc/ssl/SSL_get_rbio.pod
index 3d98233cac..08dea6a6cd 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_get_rbio.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_get_rbio.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5SSL_get_rbio - get BIO linked to an SSL object 5SSL_get_rbio, SSL_get_wbio - get BIO linked to an SSL object
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
diff --git a/src/lib/libssl/src/doc/ssl/SSL_get_session.pod b/src/lib/libssl/src/doc/ssl/SSL_get_session.pod
index 0c41caa922..1a30f7bb5f 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_get_session.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_get_session.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5SSL_get_session - retrieve TLS/SSL session data 5SSL_get_session, SSL_get0_session, SSL_get1_session - retrieve TLS/SSL session data
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
diff --git a/src/lib/libssl/src/doc/ssl/SSL_get_version.pod b/src/lib/libssl/src/doc/ssl/SSL_get_version.pod
index cc271db2c5..9ae6f25508 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_get_version.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_get_version.pod
@@ -12,12 +12,12 @@ SSL_get_version - get the protocol version of a connection.
12 12
13=head1 DESCRIPTION 13=head1 DESCRIPTION
14 14
15SSL_get_cipher_version() returns the name of the protocol used for the 15SSL_get_version() returns the name of the protocol used for the
16connection B<ssl>. 16connection B<ssl>.
17 17
18=head1 RETURN VALUES 18=head1 RETURN VALUES
19 19
20The following strings can occur: 20The following strings can be returned:
21 21
22=over 4 22=over 4
23 23
@@ -31,7 +31,15 @@ The connection uses the SSLv3 protocol.
31 31
32=item TLSv1 32=item TLSv1
33 33
34The connection uses the TLSv1 protocol. 34The connection uses the TLSv1.0 protocol.
35
36=item TLSv1.1
37
38The connection uses the TLSv1.1 protocol.
39
40=item TLSv1.2
41
42The connection uses the TLSv1.2 protocol.
35 43
36=item unknown 44=item unknown
37 45
diff --git a/src/lib/libssl/src/doc/ssl/SSL_set_fd.pod b/src/lib/libssl/src/doc/ssl/SSL_set_fd.pod
index 59e1b2bb20..7f270c9fbc 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_set_fd.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_set_fd.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5SSL_set_fd - connect the SSL object with a file descriptor 5SSL_set_fd, SSL_set_rfd, SSL_set_wfd - connect the SSL object with a file descriptor
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
diff --git a/src/lib/libssl/src/doc/ssl/d2i_SSL_SESSION.pod b/src/lib/libssl/src/doc/ssl/d2i_SSL_SESSION.pod
index 4a6fb12821..d817f72b54 100644
--- a/src/lib/libssl/src/doc/ssl/d2i_SSL_SESSION.pod
+++ b/src/lib/libssl/src/doc/ssl/d2i_SSL_SESSION.pod
@@ -49,6 +49,19 @@ known limit on the size of the created ASN1 representation, so the necessary
49amount of space should be obtained by first calling i2d_SSL_SESSION() with 49amount of space should be obtained by first calling i2d_SSL_SESSION() with
50B<pp=NULL>, and obtain the size needed, then allocate the memory and 50B<pp=NULL>, and obtain the size needed, then allocate the memory and
51call i2d_SSL_SESSION() again. 51call i2d_SSL_SESSION() again.
52Note that this will advance the value contained in B<*pp> so it is necessary
53to save a copy of the original allocation.
54For example:
55 int i, j;
56 char *p, *temp;
57
58 i = i2d_SSL_SESSION(sess, NULL);
59 p = temp = malloc(i);
60 if (temp != NULL) {
61 j = i2d_SSL_SESSION(sess, &temp);
62 assert(i == j);
63 assert(p + i == temp);
64 }
52 65
53=head1 RETURN VALUES 66=head1 RETURN VALUES
54 67