summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/doc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/doc')
-rw-r--r--src/lib/libcrypto/doc/DH_set_method.pod62
-rw-r--r--src/lib/libcrypto/doc/DSA_set_method.pod58
-rw-r--r--src/lib/libcrypto/doc/ERR_error_string.pod16
-rw-r--r--src/lib/libcrypto/doc/ERR_get_error.pod5
-rw-r--r--src/lib/libcrypto/doc/ERR_remove_state.pod2
-rw-r--r--src/lib/libcrypto/doc/EVP_DigestInit.pod15
-rw-r--r--src/lib/libcrypto/doc/EVP_EncryptInit.pod199
-rw-r--r--src/lib/libcrypto/doc/EVP_OpenInit.pod28
-rw-r--r--src/lib/libcrypto/doc/EVP_SealInit.pod18
-rw-r--r--src/lib/libcrypto/doc/EVP_SignInit.pod6
-rw-r--r--src/lib/libcrypto/doc/EVP_VerifyInit.pod15
-rw-r--r--src/lib/libcrypto/doc/OPENSSL_VERSION_NUMBER.pod46
-rw-r--r--src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod5
-rw-r--r--src/lib/libcrypto/doc/RSA_get_ex_new_index.pod14
-rw-r--r--src/lib/libcrypto/doc/RSA_print.pod5
-rw-r--r--src/lib/libcrypto/doc/RSA_public_encrypt.pod2
-rw-r--r--src/lib/libcrypto/doc/RSA_set_method.pod60
-rw-r--r--src/lib/libcrypto/doc/dh.pod9
-rw-r--r--src/lib/libcrypto/doc/dsa.pod9
-rw-r--r--src/lib/libcrypto/doc/evp.pod37
-rw-r--r--src/lib/libcrypto/doc/rsa.pod11
21 files changed, 452 insertions, 170 deletions
diff --git a/src/lib/libcrypto/doc/DH_set_method.pod b/src/lib/libcrypto/doc/DH_set_method.pod
index a8f75bdd9d..62088eea1b 100644
--- a/src/lib/libcrypto/doc/DH_set_method.pod
+++ b/src/lib/libcrypto/doc/DH_set_method.pod
@@ -2,20 +2,21 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5DH_set_default_method, DH_get_default_method, DH_set_method, 5DH_set_default_openssl_method, DH_get_default_openssl_method,
6DH_new_method, DH_OpenSSL - select DH method 6DH_set_method, DH_new_method, DH_OpenSSL - select DH method
7 7
8=head1 SYNOPSIS 8=head1 SYNOPSIS
9 9
10 #include <openssl/dh.h> 10 #include <openssl/dh.h>
11 #include <openssl/engine.h>
11 12
12 void DH_set_default_method(DH_METHOD *meth); 13 void DH_set_default_openssl_method(DH_METHOD *meth);
13 14
14 DH_METHOD *DH_get_default_method(void); 15 DH_METHOD *DH_get_default_openssl_method(void);
15 16
16 DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth); 17 int DH_set_method(DH *dh, ENGINE *engine);
17 18
18 DH *DH_new_method(DH_METHOD *meth); 19 DH *DH_new_method(ENGINE *engine);
19 20
20 DH_METHOD *DH_OpenSSL(void); 21 DH_METHOD *DH_OpenSSL(void);
21 22
@@ -28,20 +29,26 @@ such as hardware accelerators may be used.
28Initially, the default is to use the OpenSSL internal implementation. 29Initially, the default is to use the OpenSSL internal implementation.
29DH_OpenSSL() returns a pointer to that method. 30DH_OpenSSL() returns a pointer to that method.
30 31
31DH_set_default_method() makes B<meth> the default method for all B<DH> 32DH_set_default_openssl_method() makes B<meth> the default method for all DH
32structures created later. 33structures created later. B<NB:> This is true only whilst the default engine
34for Diffie-Hellman operations remains as "openssl". ENGINEs provide an
35encapsulation for implementations of one or more algorithms, and all the DH
36functions mentioned here operate within the scope of the default
37"openssl" engine.
33 38
34DH_get_default_method() returns a pointer to the current default 39DH_get_default_openssl_method() returns a pointer to the current default
35method. 40method for the "openssl" engine.
36 41
37DH_set_method() selects B<meth> for all operations using the structure B<dh>. 42DH_set_method() selects B<engine> as the engine that will be responsible for
43all operations using the structure B<dh>. If this function completes successfully,
44then the B<dh> structure will have its own functional reference of B<engine>, so
45the caller should remember to free their own reference to B<engine> when they are
46finished with it. NB: An ENGINE's DH_METHOD can be retrieved (or set) by
47ENGINE_get_DH() or ENGINE_set_DH().
38 48
39DH_get_method() returns a pointer to the method currently selected 49DH_new_method() allocates and initializes a DH structure so that
40for B<dh>. 50B<engine> will be used for the DH operations. If B<engine> is NULL,
41 51the default engine for Diffie-Hellman opertaions is used.
42DH_new_method() allocates and initializes a B<DH> structure so that
43B<method> will be used for the DH operations. If B<method> is B<NULL>,
44the default method is used.
45 52
46=head1 THE DH_METHOD STRUCTURE 53=head1 THE DH_METHOD STRUCTURE
47 54
@@ -75,17 +82,17 @@ the default method is used.
75 82
76=head1 RETURN VALUES 83=head1 RETURN VALUES
77 84
78DH_OpenSSL(), DH_get_default_method() and DH_get_method() return 85DH_OpenSSL() and DH_get_default_method() return pointers to the respective
79pointers to the respective B<DH_METHOD>s. 86DH_METHODs.
80 87
81DH_set_default_method() returns no value. 88DH_set_default_openssl_method() returns no value.
82 89
83DH_set_method() returns a pointer to the B<DH_METHOD> previously 90DH_set_method() returns non-zero if the ENGINE associated with B<dh>
84associated with B<dh>. 91was successfully changed to B<engine>.
85 92
86DH_new_method() returns B<NULL> and sets an error code that can be 93DH_new_method() returns NULL and sets an error code that can be
87obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise it 94obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails.
88returns a pointer to the newly allocated structure. 95Otherwise it returns a pointer to the newly allocated structure.
89 96
90=head1 SEE ALSO 97=head1 SEE ALSO
91 98
@@ -96,4 +103,9 @@ L<dh(3)|dh(3)>, L<DH_new(3)|DH_new(3)>
96DH_set_default_method(), DH_get_default_method(), DH_set_method(), 103DH_set_default_method(), DH_get_default_method(), DH_set_method(),
97DH_new_method() and DH_OpenSSL() were added in OpenSSL 0.9.4. 104DH_new_method() and DH_OpenSSL() were added in OpenSSL 0.9.4.
98 105
106DH_set_default_openssl_method() and DH_get_default_openssl_method()
107replaced DH_set_default_method() and DH_get_default_method() respectively,
108and DH_set_method() and DH_new_method() were altered to use B<ENGINE>s
109rather than B<DH_METHOD>s during development of OpenSSL 0.9.6.
110
99=cut 111=cut
diff --git a/src/lib/libcrypto/doc/DSA_set_method.pod b/src/lib/libcrypto/doc/DSA_set_method.pod
index edec46413d..c56dfd0f47 100644
--- a/src/lib/libcrypto/doc/DSA_set_method.pod
+++ b/src/lib/libcrypto/doc/DSA_set_method.pod
@@ -2,20 +2,21 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5DSA_set_default_method, DSA_get_default_method, DSA_set_method, 5DSA_set_default_openssl_method, DSA_get_default_openssl_method,
6DSA_new_method, DSA_OpenSSL - select RSA method 6DSA_set_method, DSA_new_method, DSA_OpenSSL - select DSA method
7 7
8=head1 SYNOPSIS 8=head1 SYNOPSIS
9 9
10 #include <openssl/DSA.h> 10 #include <openssl/dsa.h>
11 #include <openssl/engine.h>
11 12
12 void DSA_set_default_method(DSA_METHOD *meth); 13 void DSA_set_default_openssl_method(DSA_METHOD *meth);
13 14
14 DSA_METHOD *DSA_get_default_method(void); 15 DSA_METHOD *DSA_get_default_openssl_method(void);
15 16
16 DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth); 17 int DSA_set_method(DSA *dsa, ENGINE *engine);
17 18
18 DSA *DSA_new_method(DSA_METHOD *meth); 19 DSA *DSA_new_method(ENGINE *engine);
19 20
20 DSA_METHOD *DSA_OpenSSL(void); 21 DSA_METHOD *DSA_OpenSSL(void);
21 22
@@ -28,20 +29,21 @@ such as hardware accelerators may be used.
28Initially, the default is to use the OpenSSL internal implementation. 29Initially, the default is to use the OpenSSL internal implementation.
29DSA_OpenSSL() returns a pointer to that method. 30DSA_OpenSSL() returns a pointer to that method.
30 31
31DSA_set_default_method() makes B<meth> the default method for all B<DSA> 32DSA_set_default_openssl_method() makes B<meth> the default method for
32structures created later. 33all DSA structures created later. B<NB:> This is true only whilst the
34default engine for DSA operations remains as "openssl". ENGINEs
35provide an encapsulation for implementations of one or more algorithms at a
36time, and all the DSA functions mentioned here operate within the scope
37of the default "openssl" engine.
33 38
34DSA_get_default_method() returns a pointer to the current default 39DSA_get_default_openssl_method() returns a pointer to the current default
35method. 40method for the "openssl" engine.
36 41
37DSA_set_method() selects B<meth> for all operations using the structure B<DSA>. 42DSA_set_method() selects B<engine> for all operations using the structure B<dsa>.
38 43
39DSA_get_method() returns a pointer to the method currently selected 44DSA_new_method() allocates and initializes a DSA structure so that
40for B<DSA>. 45B<engine> will be used for the DSA operations. If B<engine> is NULL,
41 46the default engine for DSA operations is used.
42DSA_new_method() allocates and initializes a B<DSA> structure so that
43B<method> will be used for the DSA operations. If B<method> is B<NULL>,
44the default method is used.
45 47
46=head1 THE DSA_METHOD STRUCTURE 48=head1 THE DSA_METHOD STRUCTURE
47 49
@@ -87,18 +89,17 @@ struct
87 89
88=head1 RETURN VALUES 90=head1 RETURN VALUES
89 91
90DSA_OpenSSL(), DSA_get_default_method() and DSA_get_method() return 92DSA_OpenSSL() and DSA_get_default_openssl_method() return pointers to the
91pointers to the respective B<DSA_METHOD>s. 93respective DSA_METHODs.
92 94
93DSA_set_default_method() returns no value. 95DSA_set_default_openssl_method() returns no value.
94 96
95DSA_set_method() returns a pointer to the B<DSA_METHOD> previously 97DSA_set_method() returns non-zero if the ENGINE associated with B<dsa>
96associated with B<dsa>. 98was successfully changed to B<engine>.
97 99
98DSA_new_method() returns B<NULL> and sets an error code that can be 100DSA_new_method() returns NULL and sets an error code that can be
99obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation 101obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation
100fails. Otherwise it returns a pointer to the newly allocated 102fails. Otherwise it returns a pointer to the newly allocated structure.
101structure.
102 103
103=head1 SEE ALSO 104=head1 SEE ALSO
104 105
@@ -109,4 +110,9 @@ L<dsa(3)|dsa(3)>, L<DSA_new(3)|DSA_new(3)>
109DSA_set_default_method(), DSA_get_default_method(), DSA_set_method(), 110DSA_set_default_method(), DSA_get_default_method(), DSA_set_method(),
110DSA_new_method() and DSA_OpenSSL() were added in OpenSSL 0.9.4. 111DSA_new_method() and DSA_OpenSSL() were added in OpenSSL 0.9.4.
111 112
113DSA_set_default_openssl_method() and DSA_get_default_openssl_method()
114replaced DSA_set_default_method() and DSA_get_default_method() respectively,
115and DSA_set_method() and DSA_new_method() were altered to use B<ENGINE>s
116rather than B<DSA_METHOD>s during development of OpenSSL 0.9.6.
117
112=cut 118=cut
diff --git a/src/lib/libcrypto/doc/ERR_error_string.pod b/src/lib/libcrypto/doc/ERR_error_string.pod
index 0d2417599c..e01beb817a 100644
--- a/src/lib/libcrypto/doc/ERR_error_string.pod
+++ b/src/lib/libcrypto/doc/ERR_error_string.pod
@@ -2,13 +2,16 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5ERR_error_string - obtain human-readable error message 5ERR_error_string, ERR_error_string_n, ERR_lib_error_string,
6ERR_func_error_string, ERR_reason_error_string - obtain human-readable
7error message
6 8
7=head1 SYNOPSIS 9=head1 SYNOPSIS
8 10
9 #include <openssl/err.h> 11 #include <openssl/err.h>
10 12
11 char *ERR_error_string(unsigned long e, char *buf); 13 char *ERR_error_string(unsigned long e, char *buf);
14 char *ERR_error_string_n(unsigned long e, char *buf, size_t len);
12 15
13 const char *ERR_lib_error_string(unsigned long e); 16 const char *ERR_lib_error_string(unsigned long e);
14 const char *ERR_func_error_string(unsigned long e); 17 const char *ERR_func_error_string(unsigned long e);
@@ -17,9 +20,13 @@ ERR_error_string - obtain human-readable error message
17=head1 DESCRIPTION 20=head1 DESCRIPTION
18 21
19ERR_error_string() generates a human-readable string representing the 22ERR_error_string() generates a human-readable string representing the
20error code B<e>, and places it at B<buf>. B<buf> must be at least 120 23error code I<e>, and places it at I<buf>. I<buf> must be at least 120
21bytes long. If B<buf> is B<NULL>, the error string is placed in a 24bytes long. If I<buf> is B<NULL>, the error string is placed in a
22static buffer. 25static buffer.
26ERR_error_string_n() is a variant of ERR_error_string() that writes
27at most I<len> characters (including the terminating 0)
28and truncates the string if necessary.
29For ERR_error_string_n(), I<buf> may not be B<NULL>.
23 30
24The string will have the following format: 31The string will have the following format:
25 32
@@ -45,7 +52,7 @@ all error codes currently in the queue.
45=head1 RETURN VALUES 52=head1 RETURN VALUES
46 53
47ERR_error_string() returns a pointer to a static buffer containing the 54ERR_error_string() returns a pointer to a static buffer containing the
48string if B<buf == NULL>, B<buf> otherwise. 55string if I<buf> B<== NULL>, I<buf> otherwise.
49 56
50ERR_lib_error_string(), ERR_func_error_string() and 57ERR_lib_error_string(), ERR_func_error_string() and
51ERR_reason_error_string() return the strings, and B<NULL> if 58ERR_reason_error_string() return the strings, and B<NULL> if
@@ -61,5 +68,6 @@ L<ERR_print_errors(3)|ERR_print_errors(3)>
61=head1 HISTORY 68=head1 HISTORY
62 69
63ERR_error_string() is available in all versions of SSLeay and OpenSSL. 70ERR_error_string() is available in all versions of SSLeay and OpenSSL.
71ERR_error_string_n() was added in OpenSSL 0.9.6.
64 72
65=cut 73=cut
diff --git a/src/lib/libcrypto/doc/ERR_get_error.pod b/src/lib/libcrypto/doc/ERR_get_error.pod
index 75ece00d97..3551bacb8d 100644
--- a/src/lib/libcrypto/doc/ERR_get_error.pod
+++ b/src/lib/libcrypto/doc/ERR_get_error.pod
@@ -2,7 +2,8 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5ERR_get_error, ERR_peek_error - obtain error code 5ERR_get_error, ERR_peek_error, ERR_get_error_line, ERR_peek_error_line,
6ERR_get_error_line_data, ERR_peek_error_line_data - obtain error code and data
6 7
7=head1 SYNOPSIS 8=head1 SYNOPSIS
8 9
@@ -40,7 +41,7 @@ the error occurred in *B<file> and *B<line>, unless these are B<NULL>.
40ERR_get_error_line_data() and ERR_peek_error_line_data() store 41ERR_get_error_line_data() and ERR_peek_error_line_data() store
41additional data and flags associated with the error code in *B<data> 42additional data and flags associated with the error code in *B<data>
42and *B<flags>, unless these are B<NULL>. *B<data> contains a string 43and *B<flags>, unless these are B<NULL>. *B<data> contains a string
43if *B<flags>&B<ERR_TXT_STRING>. If it has been allocated by Malloc(), 44if *B<flags>&B<ERR_TXT_STRING>. If it has been allocated by OPENSSL_malloc(),
44*B<flags>&B<ERR_TXT_MALLOCED> is true. 45*B<flags>&B<ERR_TXT_MALLOCED> is true.
45 46
46=head1 RETURN VALUES 47=head1 RETURN VALUES
diff --git a/src/lib/libcrypto/doc/ERR_remove_state.pod b/src/lib/libcrypto/doc/ERR_remove_state.pod
index ebcdc0f5a5..72925fb9f4 100644
--- a/src/lib/libcrypto/doc/ERR_remove_state.pod
+++ b/src/lib/libcrypto/doc/ERR_remove_state.pod
@@ -16,7 +16,7 @@ ERR_remove_state() frees the error queue associated with thread B<pid>.
16If B<pid> == 0, the current thread will have its error queue removed. 16If B<pid> == 0, the current thread will have its error queue removed.
17 17
18Since error queue data structures are allocated automatically for new 18Since error queue data structures are allocated automatically for new
19threads, they must be freed when threads are terminated in oder to 19threads, they must be freed when threads are terminated in order to
20avoid memory leaks. 20avoid memory leaks.
21 21
22=head1 RETURN VALUE 22=head1 RETURN VALUE
diff --git a/src/lib/libcrypto/doc/EVP_DigestInit.pod b/src/lib/libcrypto/doc/EVP_DigestInit.pod
index 6d4e156ae3..fefc858f7e 100644
--- a/src/lib/libcrypto/doc/EVP_DigestInit.pod
+++ b/src/lib/libcrypto/doc/EVP_DigestInit.pod
@@ -2,7 +2,12 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5EVP_DigestInit, EVP_DigestUpdate, EVP_DigestFinal - EVP digest routines 5EVP_DigestInit, EVP_DigestUpdate, EVP_DigestFinal, EVP_MAX_MD_SIZE,
6EVP_MD_CTX_copy, EVP_MD_type, EVP_MD_pkey_type, EVP_MD_size, EVP_MD_block_size,
7EVP_MD_CTX_md, EVP_MD_CTX_size, EVP_MD_CTX_block_size, EVP_MD_CTX_type,
8EVP_md_null, EVP_md2, EVP_md5, EVP_sha, EVP_sha1, EVP_dss, EVP_dss1, EVP_mdc2,
9EVP_ripemd160, EVP_get_digestbyname, EVP_get_digestbynid, EVP_get_digestbyobj -
10EVP digest routines
6 11
7=head1 SYNOPSIS 12=head1 SYNOPSIS
8 13
@@ -45,12 +50,12 @@ EVP_DigestInit, EVP_DigestUpdate, EVP_DigestFinal - EVP digest routines
45 50
46The EVP digest routines are a high level interface to message digests. 51The EVP digest routines are a high level interface to message digests.
47 52
48EVP_DigestInit() initialises a digest context B<ctx> to use a digest 53EVP_DigestInit() initializes a digest context B<ctx> to use a digest
49B<type>: this will typically be supplied by a function such as 54B<type>: this will typically be supplied by a function such as
50EVP_sha1(). 55EVP_sha1().
51 56
52EVP_DigestUpdate() hashes B<cnt> bytes of data at B<d> into the 57EVP_DigestUpdate() hashes B<cnt> bytes of data at B<d> into the
53digest context B<ctx>. This funtion can be called several times on the 58digest context B<ctx>. This function can be called several times on the
54same B<ctx> to hash additional data. 59same B<ctx> to hash additional data.
55 60
56EVP_DigestFinal() retrieves the digest value from B<ctx> and places 61EVP_DigestFinal() retrieves the digest value from B<ctx> and places
@@ -58,7 +63,7 @@ it in B<md>. If the B<s> parameter is not NULL then the number of
58bytes of data written (i.e. the length of the digest) will be written 63bytes of data written (i.e. the length of the digest) will be written
59to the integer at B<s>, at most B<EVP_MAX_MD_SIZE> bytes will be written. 64to the integer at B<s>, at most B<EVP_MAX_MD_SIZE> bytes will be written.
60After calling EVP_DigestFinal() no additional calls to EVP_DigestUpdate() 65After calling EVP_DigestFinal() no additional calls to EVP_DigestUpdate()
61can be made, but EVP_DigestInit() can be called to initialiase a new 66can be made, but EVP_DigestInit() can be called to initialize a new
62digest operation. 67digest operation.
63 68
64EVP_MD_CTX_copy() can be used to copy the message digest state from 69EVP_MD_CTX_copy() can be used to copy the message digest state from
@@ -97,7 +102,7 @@ returns is of zero length.
97 102
98EVP_get_digestbyname(), EVP_get_digestbynid() and EVP_get_digestbyobj() 103EVP_get_digestbyname(), EVP_get_digestbynid() and EVP_get_digestbyobj()
99return an B<EVP_MD> structure when passed a digest name, a digest NID or 104return an B<EVP_MD> structure when passed a digest name, a digest NID or
100an ASN1_OBJECT structure respectively. The digest table must be initialised 105an ASN1_OBJECT structure respectively. The digest table must be initialized
101using, for example, OpenSSL_add_all_digests() for these functions to work. 106using, for example, OpenSSL_add_all_digests() for these functions to work.
102 107
103=head1 RETURN VALUES 108=head1 RETURN VALUES
diff --git a/src/lib/libcrypto/doc/EVP_EncryptInit.pod b/src/lib/libcrypto/doc/EVP_EncryptInit.pod
index 77ed4ccdba..9afe2396e2 100644
--- a/src/lib/libcrypto/doc/EVP_EncryptInit.pod
+++ b/src/lib/libcrypto/doc/EVP_EncryptInit.pod
@@ -2,34 +2,46 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5EVP_EncryptInit, EVP_EncryptUpdate, EVP_EncryptFinal - EVP cipher routines 5EVP_EncryptInit, EVP_EncryptUpdate, EVP_EncryptFinal, EVP_DecryptInit,
6EVP_DecryptUpdate, EVP_DecryptFinal, EVP_CipherInit, EVP_CipherUpdate,
7EVP_CipherFinal, EVP_CIPHER_CTX_set_key_length, EVP_CIPHER_CTX_ctrl,
8EVP_CIPHER_CTX_cleanup, EVP_get_cipherbyname, EVP_get_cipherbynid,
9EVP_get_cipherbyobj, EVP_CIPHER_nid, EVP_CIPHER_block_size,
10EVP_CIPHER_key_length, EVP_CIPHER_iv_length, EVP_CIPHER_flags,
11EVP_CIPHER_mode, EVP_CIPHER_type, EVP_CIPHER_CTX_cipher, EVP_CIPHER_CTX_nid,
12EVP_CIPHER_CTX_block_size, EVP_CIPHER_CTX_key_length, EVP_CIPHER_CTX_iv_length,
13EVP_CIPHER_CTX_get_app_data, EVP_CIPHER_CTX_set_app_data, EVP_CIPHER_CTX_type,
14EVP_CIPHER_CTX_flags, EVP_CIPHER_CTX_mode, EVP_CIPHER_param_to_asn1,
15EVP_CIPHER_asn1_to_param - EVP cipher routines
6 16
7=head1 SYNOPSIS 17=head1 SYNOPSIS
8 18
9 #include <openssl/evp.h> 19 #include <openssl/evp.h>
10 20
11 void EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, 21 int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
12 unsigned char *key, unsigned char *iv); 22 unsigned char *key, unsigned char *iv);
13 void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 23 int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
14 int *outl, unsigned char *in, int inl); 24 int *outl, unsigned char *in, int inl);
15 void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, 25 int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out,
16 int *outl); 26 int *outl);
17 27
18 void EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, 28 int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
19 unsigned char *key, unsigned char *iv); 29 unsigned char *key, unsigned char *iv);
20 void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 30 int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
21 int *outl, unsigned char *in, int inl); 31 int *outl, unsigned char *in, int inl);
22 int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, 32 int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm,
23 int *outl); 33 int *outl);
24 34
25 void EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, 35 int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
26 unsigned char *key, unsigned char *iv, int enc); 36 unsigned char *key, unsigned char *iv, int enc);
27 void EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 37 int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
28 int *outl, unsigned char *in, int inl); 38 int *outl, unsigned char *in, int inl);
29 int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, 39 int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm,
30 int *outl); 40 int *outl);
31 41
32 void EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); 42 int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen);
43 int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr);
44 int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a);
33 45
34 const EVP_CIPHER *EVP_get_cipherbyname(const char *name); 46 const EVP_CIPHER *EVP_get_cipherbyname(const char *name);
35 #define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a)) 47 #define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a))
@@ -38,15 +50,21 @@ EVP_EncryptInit, EVP_EncryptUpdate, EVP_EncryptFinal - EVP cipher routines
38 #define EVP_CIPHER_nid(e) ((e)->nid) 50 #define EVP_CIPHER_nid(e) ((e)->nid)
39 #define EVP_CIPHER_block_size(e) ((e)->block_size) 51 #define EVP_CIPHER_block_size(e) ((e)->block_size)
40 #define EVP_CIPHER_key_length(e) ((e)->key_len) 52 #define EVP_CIPHER_key_length(e) ((e)->key_len)
41 #define EVP_CIPHER_iv_length(e) ((e)->iv_len) 53 #define EVP_CIPHER_iv_length(e) ((e)->iv_len)
42 54 #define EVP_CIPHER_flags(e) ((e)->flags)
55 #define EVP_CIPHER_mode(e) ((e)->flags) & EVP_CIPH_MODE)
43 int EVP_CIPHER_type(const EVP_CIPHER *ctx); 56 int EVP_CIPHER_type(const EVP_CIPHER *ctx);
57
44 #define EVP_CIPHER_CTX_cipher(e) ((e)->cipher) 58 #define EVP_CIPHER_CTX_cipher(e) ((e)->cipher)
45 #define EVP_CIPHER_CTX_nid(e) ((e)->cipher->nid) 59 #define EVP_CIPHER_CTX_nid(e) ((e)->cipher->nid)
46 #define EVP_CIPHER_CTX_block_size(e) ((e)->cipher->block_size) 60 #define EVP_CIPHER_CTX_block_size(e) ((e)->cipher->block_size)
47 #define EVP_CIPHER_CTX_key_length(e) ((e)->cipher->key_len) 61 #define EVP_CIPHER_CTX_key_length(e) ((e)->key_len)
48 #define EVP_CIPHER_CTX_iv_length(e) ((e)->cipher->iv_len) 62 #define EVP_CIPHER_CTX_iv_length(e) ((e)->cipher->iv_len)
63 #define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data)
64 #define EVP_CIPHER_CTX_set_app_data(e,d) ((e)->app_data=(char *)(d))
49 #define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) 65 #define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))
66 #define EVP_CIPHER_CTX_flags(e) ((e)->cipher->flags)
67 #define EVP_CIPHER_CTX_mode(e) ((e)->cipher->flags & EVP_CIPH_MODE)
50 68
51 int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type); 69 int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
52 int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); 70 int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
@@ -56,16 +74,14 @@ EVP_EncryptInit, EVP_EncryptUpdate, EVP_EncryptFinal - EVP cipher routines
56The EVP cipher routines are a high level interface to certain 74The EVP cipher routines are a high level interface to certain
57symmetric ciphers. 75symmetric ciphers.
58 76
59EVP_EncryptInit() initialises a cipher context B<ctx> for encryption 77EVP_EncryptInit() initializes a cipher context B<ctx> for encryption
60with cipher B<type>. B<type> is normally supplied by a function such 78with cipher B<type>. B<type> is normally supplied by a function such
61as EVP_des_cbc() . B<key> is the symmetric key to use and B<iv> is the 79as EVP_des_cbc() . B<key> is the symmetric key to use and B<iv> is the
62IV to use (if necessary), the actual number of bytes used for the 80IV to use (if necessary), the actual number of bytes used for the
63key and IV depends on the cipher. It is possible to set all parameters 81key and IV depends on the cipher. It is possible to set all parameters
64to NULL except B<type> in an initial call and supply the remaining 82to NULL except B<type> in an initial call and supply the remaining
65parameters in subsequent calls. This is normally done when the 83parameters in subsequent calls, all of which have B<type> set to NULL.
66EVP_CIPHER_asn1_to_param() function is called to set the cipher 84This is done when the default cipher parameters are not appropriate.
67parameters from an ASN1 AlgorithmIdentifier and the key from a
68different source.
69 85
70EVP_EncryptUpdate() encrypts B<inl> bytes from the buffer B<in> and 86EVP_EncryptUpdate() encrypts B<inl> bytes from the buffer B<in> and
71writes the encrypted version to B<out>. This function can be called 87writes the encrypted version to B<out>. This function can be called
@@ -93,7 +109,8 @@ cipher block size is 1 in which case B<inl> bytes is sufficient.
93EVP_CipherInit(), EVP_CipherUpdate() and EVP_CipherFinal() are functions 109EVP_CipherInit(), EVP_CipherUpdate() and EVP_CipherFinal() are functions
94that can be used for decryption or encryption. The operation performed 110that can be used for decryption or encryption. The operation performed
95depends on the value of the B<enc> parameter. It should be set to 1 for 111depends on the value of the B<enc> parameter. It should be set to 1 for
96encryption and 0 for decryption. 112encryption, 0 for decryption and -1 to leave the value unchanged (the
113actual value of 'enc' being supplied in a previous call).
97 114
98EVP_CIPHER_CTX_cleanup() clears all information from a cipher context. 115EVP_CIPHER_CTX_cleanup() clears all information from a cipher context.
99It should be called after all operations using a cipher are complete 116It should be called after all operations using a cipher are complete
@@ -111,7 +128,13 @@ IDENTIFIER.
111EVP_CIPHER_key_length() and EVP_CIPHER_CTX_key_length() return the key 128EVP_CIPHER_key_length() and EVP_CIPHER_CTX_key_length() return the key
112length of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX> 129length of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX>
113structure. The constant B<EVP_MAX_KEY_LENGTH> is the maximum key length 130structure. The constant B<EVP_MAX_KEY_LENGTH> is the maximum key length
114for all ciphers. 131for all ciphers. Note: although EVP_CIPHER_key_length() is fixed for a
132given cipher, the value of EVP_CIPHER_CTX_key_length() may be different
133for variable key length ciphers.
134
135EVP_CIPHER_CTX_set_key_length() sets the key length of the cipher ctx.
136If the cipher is a fixed length cipher then attempting to set the key
137length to any value other than the fixed value is an error.
115 138
116EVP_CIPHER_iv_length() and EVP_CIPHER_CTX_iv_length() return the IV 139EVP_CIPHER_iv_length() and EVP_CIPHER_CTX_iv_length() return the IV
117length of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX>. 140length of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX>.
@@ -133,6 +156,11 @@ B<NID_undef>.
133EVP_CIPHER_CTX_cipher() returns the B<EVP_CIPHER> structure when passed 156EVP_CIPHER_CTX_cipher() returns the B<EVP_CIPHER> structure when passed
134an B<EVP_CIPHER_CTX> structure. 157an B<EVP_CIPHER_CTX> structure.
135 158
159EVP_CIPHER_mode() and EVP_CIPHER_CTX_mode() return the block cipher mode:
160EVP_CIPH_ECB_MODE, EVP_CIPH_CBC_MODE, EVP_CIPH_CFB_MODE or
161EVP_CIPH_OFB_MODE. If the cipher is a stream cipher then
162EVP_CIPH_STREAM_CIPHER is returned.
163
136EVP_CIPHER_param_to_asn1() sets the AlgorithmIdentifier "parameter" based 164EVP_CIPHER_param_to_asn1() sets the AlgorithmIdentifier "parameter" based
137on the passed cipher. This will typically include any parameters and an 165on the passed cipher. This will typically include any parameters and an
138IV. The cipher IV (if any) must be set when this call is made. This call 166IV. The cipher IV (if any) must be set when this call is made. This call
@@ -149,21 +177,24 @@ key set to NULL, EVP_CIPHER_asn1_to_param() will be called and finally
149EVP_CipherInit() again with all parameters except the key set to NULL. It is 177EVP_CipherInit() again with all parameters except the key set to NULL. It is
150possible for this function to fail if the cipher does not have any ASN1 support 178possible for this function to fail if the cipher does not have any ASN1 support
151or the parameters cannot be set (for example the RC2 effective key length 179or the parameters cannot be set (for example the RC2 effective key length
152does not have an B<EVP_CIPHER> structure). 180is not supported.
181
182EVP_CIPHER_CTX_ctrl() allows various cipher specific parameters to be determined
183and set. Currently only the RC2 effective key length and the number of rounds of
184RC5 can be set.
153 185
154=head1 RETURN VALUES 186=head1 RETURN VALUES
155 187
156EVP_EncryptInit(), EVP_EncryptUpdate() and EVP_EncryptFinal() do not return 188EVP_EncryptInit(), EVP_EncryptUpdate() and EVP_EncryptFinal() return 1 for success
157values. 189and 0 for failure.
158 190
159EVP_DecryptInit() and EVP_DecryptUpdate() do not return values. 191EVP_DecryptInit() and EVP_DecryptUpdate() return 1 for success and 0 for failure.
160EVP_DecryptFinal() returns 0 if the decrypt failed or 1 for success. 192EVP_DecryptFinal() returns 0 if the decrypt failed or 1 for success.
161 193
162EVP_CipherInit() and EVP_CipherUpdate() do not return values. 194EVP_CipherInit() and EVP_CipherUpdate() return 1 for success and 0 for failure.
163EVP_CipherFinal() returns 1 for a decryption failure or 1 for success, if 195EVP_CipherFinal() returns 1 for a decryption failure or 1 for success.
164the operation is encryption then it always returns 1.
165 196
166EVP_CIPHER_CTX_cleanup() does not return a value. 197EVP_CIPHER_CTX_cleanup() returns 1 for success and 0 for failure.
167 198
168EVP_get_cipherbyname(), EVP_get_cipherbynid() and EVP_get_cipherbyobj() 199EVP_get_cipherbyname(), EVP_get_cipherbynid() and EVP_get_cipherbyobj()
169return an B<EVP_CIPHER> structure or NULL on error. 200return an B<EVP_CIPHER> structure or NULL on error.
@@ -187,6 +218,75 @@ EVP_CIPHER_CTX_cipher() returns an B<EVP_CIPHER> structure.
187EVP_CIPHER_param_to_asn1() and EVP_CIPHER_asn1_to_param() return 1 for 218EVP_CIPHER_param_to_asn1() and EVP_CIPHER_asn1_to_param() return 1 for
188success or zero for failure. 219success or zero for failure.
189 220
221=head1 CIPHER LISTING
222
223All algorithms have a fixed key length unless otherwise stated.
224
225=over 4
226
227=item EVP_enc_null()
228
229Null cipher: does nothing.
230
231=item EVP_des_cbc(void), EVP_des_ecb(void), EVP_des_cfb(void), EVP_des_ofb(void)
232
233DES in CBC, ECB, CFB and OFB modes respectively.
234
235=item EVP_des_ede_cbc(void), EVP_des_ede(), EVP_des_ede_ofb(void), EVP_des_ede_cfb(void)
236
237Two key triple DES in CBC, ECB, CFB and OFB modes respectively.
238
239=item EVP_des_ede3_cbc(void), EVP_des_ede3(), EVP_des_ede3_ofb(void), EVP_des_ede3_cfb(void)
240
241Three key triple DES in CBC, ECB, CFB and OFB modes respectively.
242
243=item EVP_desx_cbc(void)
244
245DESX algorithm in CBC mode.
246
247=item EVP_rc4(void)
248
249RC4 stream cipher. This is a variable key length cipher with default key length 128 bits.
250
251=item EVP_rc4_40(void)
252
253RC4 stream cipher with 40 bit key length. This is obsolete and new code should use EVP_rc4()
254and the EVP_CIPHER_CTX_set_key_length() function.
255
256=item EVP_idea_cbc() EVP_idea_ecb(void), EVP_idea_cfb(void), EVP_idea_ofb(void), EVP_idea_cbc(void)
257
258IDEA encryption algorithm in CBC, ECB, CFB and OFB modes respectively.
259
260=item EVP_rc2_cbc(void), EVP_rc2_ecb(void), EVP_rc2_cfb(void), EVP_rc2_ofb(void)
261
262RC2 encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key
263length cipher with an additional parameter called "effective key bits" or "effective key length".
264By default both are set to 128 bits.
265
266=item EVP_rc2_40_cbc(void), EVP_rc2_64_cbc(void)
267
268RC2 algorithm in CBC mode with a default key length and effective key length of 40 and 64 bits.
269These are obsolete and new code should use EVP_rc2_cbc(), EVP_CIPHER_CTX_set_key_length() and
270EVP_CIPHER_CTX_ctrl() to set the key length and effective key length.
271
272=item EVP_bf_cbc(void), EVP_bf_ecb(void), EVP_bf_cfb(void), EVP_bf_ofb(void);
273
274Blowfish encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key
275length cipher.
276
277=item EVP_cast5_cbc(void), EVP_cast5_ecb(void), EVP_cast5_cfb(void), EVP_cast5_ofb(void)
278
279CAST encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key
280length cipher.
281
282=item EVP_rc5_32_12_16_cbc(void), EVP_rc5_32_12_16_ecb(void), EVP_rc5_32_12_16_cfb(void), EVP_rc5_32_12_16_ofb(void)
283
284RC5 encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key length
285cipher with an additional "number of rounds" parameter. By default the key length is set to 128
286bits and 12 rounds.
287
288=back
289
190=head1 NOTES 290=head1 NOTES
191 291
192Where possible the B<EVP> interface to symmetric ciphers should be used in 292Where possible the B<EVP> interface to symmetric ciphers should be used in
@@ -206,14 +306,49 @@ test that the input data or key is correct. A random block has better than
2061 in 256 chance of being of the correct format and problems with the 3061 in 256 chance of being of the correct format and problems with the
207input data earlier on will not produce a final decrypt error. 307input data earlier on will not produce a final decrypt error.
208 308
309The functions EVP_EncryptInit(), EVP_EncryptUpdate(), EVP_EncryptFinal(),
310EVP_DecryptInit(), EVP_DecryptUpdate(), EVP_CipherInit() and EVP_CipherUpdate()
311and EVP_CIPHER_CTX_cleanup() did not return errors in OpenSSL version 0.9.5a or
312earlier. Software only versions of encryption algorithms will never return
313error codes for these functions, unless there is a programming error (for example
314and attempt to set the key before the cipher is set in EVP_EncryptInit() ).
315
209=head1 BUGS 316=head1 BUGS
210 317
211The current B<EVP> cipher interface is not as flexible as it should be. Only 318For RC5 the number of rounds can currently only be set to 8, 12 or 16. This is
212certain "spot" encryption algorithms can be used for ciphers which have various 319a limitation of the current RC5 code rather than the EVP interface.
213parameters associated with them (RC2, RC5 for example) this is inadequate. 320
321It should be possible to disable PKCS padding: currently it isn't.
322
323EVP_MAX_KEY_LENGTH and EVP_MAX_IV_LENGTH only refer to the internal ciphers with
324default key lengths. If custom ciphers exceed these values the results are
325unpredictable. This is because it has become standard practice to define a
326generic key as a fixed unsigned char array containing EVP_MAX_KEY_LENGTH bytes.
327
328The ASN1 code is incomplete (and sometimes inaccurate) it has only been tested
329for certain common S/MIME ciphers (RC2, DES, triple DES) in CBC mode.
330
331=head1 EXAMPLES
332
333Get the number of rounds used in RC5:
334
335 int nrounds;
336 EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC5_ROUNDS, 0, &i);
337
338Get the RC2 effective key length:
339
340 int key_bits;
341 EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC2_KEY_BITS, 0, &i);
342
343Set the number of rounds used in RC5:
344
345 int nrounds;
346 EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC5_ROUNDS, i, NULL);
347
348Set the number of rounds used in RC2:
214 349
215Several of the functions do not return error codes because the software versions 350 int nrounds;
216can never fail. This is not true of hardware versions. 351 EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC2_KEY_BITS, i, NULL);
217 352
218=head1 SEE ALSO 353=head1 SEE ALSO
219 354
diff --git a/src/lib/libcrypto/doc/EVP_OpenInit.pod b/src/lib/libcrypto/doc/EVP_OpenInit.pod
index 50edb124e4..2e710da945 100644
--- a/src/lib/libcrypto/doc/EVP_OpenInit.pod
+++ b/src/lib/libcrypto/doc/EVP_OpenInit.pod
@@ -10,9 +10,9 @@ EVP_OpenInit, EVP_OpenUpdate, EVP_OpenFinal - EVP envelope decryption
10 10
11 int EVP_OpenInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type,unsigned char *ek, 11 int EVP_OpenInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type,unsigned char *ek,
12 int ekl,unsigned char *iv,EVP_PKEY *priv); 12 int ekl,unsigned char *iv,EVP_PKEY *priv);
13 void EVP_OpenUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 13 int EVP_OpenUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
14 int *outl, unsigned char *in, int inl); 14 int *outl, unsigned char *in, int inl);
15 void EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, 15 int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out,
16 int *outl); 16 int *outl);
17 17
18=head1 DESCRIPTION 18=head1 DESCRIPTION
@@ -21,7 +21,7 @@ The EVP envelope routines are a high level interface to envelope
21decryption. They decrypt a public key encrypted symmetric key and 21decryption. They decrypt a public key encrypted symmetric key and
22then decrypt data using it. 22then decrypt data using it.
23 23
24EVP_OpenInit() initialises a cipher context B<ctx> for decryption 24EVP_OpenInit() initializes a cipher context B<ctx> for decryption
25with cipher B<type>. It decrypts the encrypted symmetric key of length 25with cipher B<type>. It decrypts the encrypted symmetric key of length
26B<ekl> bytes passed in the B<ek> parameter using the private key B<priv>. 26B<ekl> bytes passed in the B<ek> parameter using the private key B<priv>.
27The IV is supplied in the B<iv> parameter. 27The IV is supplied in the B<iv> parameter.
@@ -29,20 +29,32 @@ The IV is supplied in the B<iv> parameter.
29EVP_OpenUpdate() and EVP_OpenFinal() have exactly the same properties 29EVP_OpenUpdate() and EVP_OpenFinal() have exactly the same properties
30as the EVP_DecryptUpdate() and EVP_DecryptFinal() routines, as 30as the EVP_DecryptUpdate() and EVP_DecryptFinal() routines, as
31documented on the L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> manual 31documented on the L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> manual
32page. 32page.
33
34=head1 NOTES
35
36It is possible to call EVP_OpenInit() twice in the same way as
37EVP_DecryptInit(). The first call should have B<priv> set to NULL
38and (after setting any cipher parameters) it should be called again
39with B<type> set to NULL.
40
41If the cipher passed in the B<type> parameter is a variable length
42cipher then the key length will be set to the value of the recovered
43key length. If the cipher is a fixed length cipher then the recovered
44key length must match the fixed cipher length.
33 45
34=head1 RETURN VALUES 46=head1 RETURN VALUES
35 47
36EVP_OpenInit() returns -1 on error or an non zero integer (actually the 48EVP_OpenInit() returns 0 on error or a non zero integer (actually the
37recovered secret key size) if successful. 49recovered secret key size) if successful.
38 50
39EVP_SealUpdate() does not return a value. 51EVP_OpenUpdate() returns 1 for success or 0 for failure.
40 52
41EVP_SealFinal() returns 0 if the decrypt failed or 1 for success. 53EVP_OpenFinal() returns 0 if the decrypt failed or 1 for success.
42 54
43=head1 SEE ALSO 55=head1 SEE ALSO
44 56
45L<evp(3)|evp(3)>, 57L<evp(3)|evp(3)>, L<rand(3)|rand(3)>,
46L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>, 58L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>,
47L<EVP_SealInit(3)|EVP_SealInit(3)> 59L<EVP_SealInit(3)|EVP_SealInit(3)>
48 60
diff --git a/src/lib/libcrypto/doc/EVP_SealInit.pod b/src/lib/libcrypto/doc/EVP_SealInit.pod
index 42beed33bd..0451eb648a 100644
--- a/src/lib/libcrypto/doc/EVP_SealInit.pod
+++ b/src/lib/libcrypto/doc/EVP_SealInit.pod
@@ -10,9 +10,9 @@ EVP_SealInit, EVP_SealUpdate, EVP_SealFinal - EVP envelope encryption
10 10
11 int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek, 11 int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek,
12 int *ekl, unsigned char *iv,EVP_PKEY **pubk, int npubk); 12 int *ekl, unsigned char *iv,EVP_PKEY **pubk, int npubk);
13 void EVP_SealUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 13 int EVP_SealUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
14 int *outl, unsigned char *in, int inl); 14 int *outl, unsigned char *in, int inl);
15 void EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, 15 int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out,
16 int *outl); 16 int *outl);
17 17
18=head1 DESCRIPTION 18=head1 DESCRIPTION
@@ -22,7 +22,7 @@ encryption. They generate a random key and then "envelope" it by
22using public key encryption. Data can then be encrypted using this 22using public key encryption. Data can then be encrypted using this
23key. 23key.
24 24
25EVP_SealInit() initialises a cipher context B<ctx> for encryption 25EVP_SealInit() initializes a cipher context B<ctx> for encryption
26with cipher B<type> using a random secret key and IV supplied in 26with cipher B<type> using a random secret key and IV supplied in
27the B<iv> parameter. B<type> is normally supplied by a function such 27the B<iv> parameter. B<type> is normally supplied by a function such
28as EVP_des_cbc(). The secret key is encrypted using one or more public 28as EVP_des_cbc(). The secret key is encrypted using one or more public
@@ -41,9 +41,10 @@ page.
41 41
42=head1 RETURN VALUES 42=head1 RETURN VALUES
43 43
44EVP_SealInit() returns -1 on error or B<npubk> if successful. 44EVP_SealInit() returns 0 on error or B<npubk> if successful.
45 45
46EVP_SealUpdate() and EVP_SealFinal() do not return values. 46EVP_SealUpdate() and EVP_SealFinal() return 1 for success and 0 for
47failure.
47 48
48=head1 NOTES 49=head1 NOTES
49 50
@@ -59,9 +60,14 @@ but symmetric encryption is fast. So symmetric encryption is used for
59bulk encryption and the small random symmetric key used is transferred 60bulk encryption and the small random symmetric key used is transferred
60using public key encryption. 61using public key encryption.
61 62
63It is possible to call EVP_SealInit() twice in the same way as
64EVP_EncryptInit(). The first call should have B<npubk> set to 0
65and (after setting any cipher parameters) it should be called again
66with B<type> set to NULL.
67
62=head1 SEE ALSO 68=head1 SEE ALSO
63 69
64L<evp(3)|evp(3)>, 70L<evp(3)|evp(3)>, L<rand(3)|rand(3)>,
65L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>, 71L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>,
66L<EVP_OpenInit(3)|EVP_OpenInit(3)> 72L<EVP_OpenInit(3)|EVP_OpenInit(3)>
67 73
diff --git a/src/lib/libcrypto/doc/EVP_SignInit.pod b/src/lib/libcrypto/doc/EVP_SignInit.pod
index 1167cefb45..d5ce245ecd 100644
--- a/src/lib/libcrypto/doc/EVP_SignInit.pod
+++ b/src/lib/libcrypto/doc/EVP_SignInit.pod
@@ -19,12 +19,12 @@ EVP_SignInit, EVP_SignUpdate, EVP_SignFinal - EVP signing functions
19The EVP signature routines are a high level interface to digital 19The EVP signature routines are a high level interface to digital
20signatures. 20signatures.
21 21
22EVP_SignInit() initialises a signing context B<ctx> to using digest 22EVP_SignInit() initializes a signing context B<ctx> to using digest
23B<type>: this will typically be supplied by a function such as 23B<type>: this will typically be supplied by a function such as
24EVP_sha1(). 24EVP_sha1().
25 25
26EVP_SignUpdate() hashes B<cnt> bytes of data at B<d> into the 26EVP_SignUpdate() hashes B<cnt> bytes of data at B<d> into the
27signature context B<ctx>. This funtion can be called several times on the 27signature context B<ctx>. This function can be called several times on the
28same B<ctx> to include additional data. 28same B<ctx> to include additional data.
29 29
30EVP_SignFinal() signs the data in B<ctx> using the private key B<pkey> 30EVP_SignFinal() signs the data in B<ctx> using the private key B<pkey>
@@ -32,7 +32,7 @@ and places the signature in B<sig>. If the B<s> parameter is not NULL
32then the number of bytes of data written (i.e. the length of the signature) 32then the number of bytes of data written (i.e. the length of the signature)
33will be written to the integer at B<s>, at most EVP_PKEY_size(pkey) bytes 33will be written to the integer at B<s>, at most EVP_PKEY_size(pkey) bytes
34will be written. After calling EVP_SignFinal() no additional calls to 34will be written. After calling EVP_SignFinal() no additional calls to
35EVP_SignUpdate() can be made, but EVP_SignInit() can be called to initialiase 35EVP_SignUpdate() can be made, but EVP_SignInit() can be called to initialize
36a new signature operation. 36a new signature operation.
37 37
38EVP_PKEY_size() returns the maximum size of a signature in bytes. The actual 38EVP_PKEY_size() returns the maximum size of a signature in bytes. The actual
diff --git a/src/lib/libcrypto/doc/EVP_VerifyInit.pod b/src/lib/libcrypto/doc/EVP_VerifyInit.pod
index 5e74c5dcf9..736a0f4a82 100644
--- a/src/lib/libcrypto/doc/EVP_VerifyInit.pod
+++ b/src/lib/libcrypto/doc/EVP_VerifyInit.pod
@@ -17,17 +17,17 @@ EVP_VerifyInit, EVP_VerifyUpdate, EVP_VerifyFinal - EVP signature verification f
17The EVP signature verification routines are a high level interface to digital 17The EVP signature verification routines are a high level interface to digital
18signatures. 18signatures.
19 19
20EVP_VerifyInit() initialises a verification context B<ctx> to using digest 20EVP_VerifyInit() initializes a verification context B<ctx> to using digest
21B<type>: this will typically be supplied by a function such as EVP_sha1(). 21B<type>: this will typically be supplied by a function such as EVP_sha1().
22 22
23EVP_VerifyUpdate() hashes B<cnt> bytes of data at B<d> into the 23EVP_VerifyUpdate() hashes B<cnt> bytes of data at B<d> into the
24verification context B<ctx>. This funtion can be called several times on the 24verification context B<ctx>. This function can be called several times on the
25same B<ctx> to include additional data. 25same B<ctx> to include additional data.
26 26
27EVP_VerifyFinal() verifies the data in B<ctx> using the public key B<pkey> 27EVP_VerifyFinal() verifies the data in B<ctx> using the public key B<pkey>
28and against the B<siglen> bytes at B<sigbuf>. After calling EVP_VerifyFinal() 28and against the B<siglen> bytes at B<sigbuf>. After calling EVP_VerifyFinal()
29no additional calls to EVP_VerifyUpdate() can be made, but EVP_VerifyInit() 29no additional calls to EVP_VerifyUpdate() can be made, but EVP_VerifyInit()
30can be called to initialiase a new verification operation. 30can be called to initialize a new verification operation.
31 31
32=head1 RETURN VALUES 32=head1 RETURN VALUES
33 33
@@ -57,11 +57,12 @@ might.
57 57
58=head1 SEE ALSO 58=head1 SEE ALSO
59 59
60L<evp(3)|evp(3)>,
60L<EVP_SignInit(3)|EVP_SignInit(3)>, 61L<EVP_SignInit(3)|EVP_SignInit(3)>,
61L<EVP_DigestInit(3)|EVP_DigestInit(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, 62L<EVP_DigestInit(3)|EVP_DigestInit(3)>, L<err(3)|err(3)>,
62L<evp(3)|evp(3)>, L<HMAC(3)|HMAC(3)>, L<MD2(3)|MD2(3)>, 63L<evp(3)|evp(3)>, L<hmac(3)|hmac(3)>, L<md2(3)|md2(3)>,
63L<MD5(3)|MD5(3)>, L<MDC2(3)|MDC2(3)>, L<RIPEMD(3)|RIPEMD(3)>, 64L<md5(3)|md5(3)>, L<mdc2(3)|mdc2(3)>, L<ripemd(3)|ripemd(3)>,
64L<SHA1(3)|SHA1(3)>, L<digest(1)|digest(1)> 65L<sha(3)|sha(3)>, L<digest(1)|digest(1)>
65 66
66=head1 HISTORY 67=head1 HISTORY
67 68
diff --git a/src/lib/libcrypto/doc/OPENSSL_VERSION_NUMBER.pod b/src/lib/libcrypto/doc/OPENSSL_VERSION_NUMBER.pod
index b0b1058d19..68ea723259 100644
--- a/src/lib/libcrypto/doc/OPENSSL_VERSION_NUMBER.pod
+++ b/src/lib/libcrypto/doc/OPENSSL_VERSION_NUMBER.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5OPENSSL_VERSION_NUMBER, SSLeay - get OpenSSL version number 5OPENSSL_VERSION_NUMBER, SSLeay SSLeay_version - get OpenSSL version number
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
@@ -11,11 +11,27 @@ OPENSSL_VERSION_NUMBER, SSLeay - get OpenSSL version number
11 11
12 #include <openssl/crypto.h> 12 #include <openssl/crypto.h>
13 long SSLeay(void); 13 long SSLeay(void);
14 char *SSLeay_version(int t);
14 15
15=head1 DESCRIPTION 16=head1 DESCRIPTION
16 17
17OPENSSL_VERSION_NUMBER is a numeric release version identifier: 18OPENSSL_VERSION_NUMBER is a numeric release version identifier:
18 19
20 MMNNFFPPS: major minor fix patch status
21
22The status nibble has one of the values 0 for development, 1 to e for betas
231 to 14, and f for release.
24
25for example
26
27 0x000906000 == 0.9.6 dev
28 0x000906023 == 0.9.6b beta 3
29 0x00090605f == 0.9.6e release
30
31Versions prior to 0.9.3 have identifiers E<lt> 0x0930.
32Versions between 0.9.3 and 0.9.5 had a version identifier with this
33interpretation:
34
19 MMNNFFRBB major minor fix final beta/patch 35 MMNNFFRBB major minor fix final beta/patch
20 36
21for example 37for example
@@ -23,13 +39,39 @@ for example
23 0x000904100 == 0.9.4 release 39 0x000904100 == 0.9.4 release
24 0x000905000 == 0.9.5 dev 40 0x000905000 == 0.9.5 dev
25 41
26Versions prior to 0.9.3 have identifiers E<lt> 0x0930. 42Version 0.9.5a had an interim interpretation that is like the current one,
43except the patch level got the highest bit set, to keep continuity. The
44number was therefore 0x0090581f.
45
46
27For backward compatibility, SSLEAY_VERSION_NUMBER is also defined. 47For backward compatibility, SSLEAY_VERSION_NUMBER is also defined.
28 48
29SSLeay() returns this number. The return value can be compared to the 49SSLeay() returns this number. The return value can be compared to the
30macro to make sure that the correct version of the library has been 50macro to make sure that the correct version of the library has been
31loaded, especially when using DLLs on Windows systems. 51loaded, especially when using DLLs on Windows systems.
32 52
53SSLeay_version() returns different strings depending on B<t>:
54
55=over 4
56
57=item SSLEAY_VERSION
58The text variant of the version number and the release date. For example,
59"OpenSSL 0.9.5a 1 Apr 2000".
60
61=item SSLEAY_CFLAGS
62The flags given to the C compiler when compiling OpenSSL are returned in a
63string.
64
65=item SSLEAY_PLATFORM
66The platform name used when OpenSSL was configured is returned.
67
68=back
69
70If the data request isn't available, a text saying that the information is
71not available is returned.
72
73For an unknown B<t>, the text "not available" is returned.
74
33=head1 RETURN VALUE 75=head1 RETURN VALUE
34 76
35The version number. 77The version number.
diff --git a/src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod b/src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod
index 015d4eaf36..e63411b5bb 100644
--- a/src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod
+++ b/src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod
@@ -2,7 +2,8 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5OpenSSL_add_all_algorithms() - add algorithms to internal table 5OpenSSL_add_all_algorithms, OpenSSL_add_all_ciphers, OpenSSL_add_all_digests -
6add algorithms to internal table
6 7
7=head1 SYNOPSIS 8=head1 SYNOPSIS
8 9
@@ -43,7 +44,7 @@ by EVP_sha1(). It just needs to add them if it (or any of the functions it calls
43needs to lookup algorithms. 44needs to lookup algorithms.
44 45
45The cipher and digest lookup functions are used in many parts of the library. If 46The cipher and digest lookup functions are used in many parts of the library. If
46the table is not initialised several functions will misbehave and complain they 47the table is not initialized several functions will misbehave and complain they
47cannot find algorithms. This includes the PEM, PKCS#12, SSL and S/MIME libraries. 48cannot find algorithms. This includes the PEM, PKCS#12, SSL and S/MIME libraries.
48This is a common query in the OpenSSL mailing lists. 49This is a common query in the OpenSSL mailing lists.
49 50
diff --git a/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod b/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod
index 920dc76325..46cc8f5359 100644
--- a/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod
+++ b/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod
@@ -17,14 +17,12 @@ RSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data - add application specifi
17 17
18 void *RSA_get_ex_data(RSA *r, int idx); 18 void *RSA_get_ex_data(RSA *r, int idx);
19 19
20 int new_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad, 20 typedef int new_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
21 int idx, long argl, void *argp); 21 int idx, long argl, void *argp);
22 22 typedef void free_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
23 void free_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad, 23 int idx, long argl, void *argp);
24 int idx, long argl, void *argp); 24 typedef int dup_func(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
25 25 int idx, long argl, void *argp);
26 int dup_func(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
27 int idx, long argl, void *argp);
28 26
29=head1 DESCRIPTION 27=head1 DESCRIPTION
30 28
diff --git a/src/lib/libcrypto/doc/RSA_print.pod b/src/lib/libcrypto/doc/RSA_print.pod
index dd968a5274..67876facc5 100644
--- a/src/lib/libcrypto/doc/RSA_print.pod
+++ b/src/lib/libcrypto/doc/RSA_print.pod
@@ -2,8 +2,9 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5RSA_print, RSA_print_fp, DHparams_print, DHparams_print_fp - print 5RSA_print, RSA_print_fp, DHparams_print, DHparams_print_fp, DSA_print,
6cryptographic parameters 6DSA_print_fp, DHparams_print, DHparams_print_fp - print cryptographic
7parameters
7 8
8=head1 SYNOPSIS 9=head1 SYNOPSIS
9 10
diff --git a/src/lib/libcrypto/doc/RSA_public_encrypt.pod b/src/lib/libcrypto/doc/RSA_public_encrypt.pod
index 13b7df62be..23861c0004 100644
--- a/src/lib/libcrypto/doc/RSA_public_encrypt.pod
+++ b/src/lib/libcrypto/doc/RSA_public_encrypt.pod
@@ -47,7 +47,7 @@ Encrypting user data directly with RSA is insecure.
47=back 47=back
48 48
49B<flen> must be less than RSA_size(B<rsa>) - 11 for the PKCS #1 v1.5 49B<flen> must be less than RSA_size(B<rsa>) - 11 for the PKCS #1 v1.5
50based padding modes, and less than RSA_size(B<rsa>) - 21 for 50based padding modes, and less than RSA_size(B<rsa>) - 41 for
51RSA_PKCS1_OAEP_PADDING. The random number generator must be seeded 51RSA_PKCS1_OAEP_PADDING. The random number generator must be seeded
52prior to calling RSA_public_encrypt(). 52prior to calling RSA_public_encrypt().
53 53
diff --git a/src/lib/libcrypto/doc/RSA_set_method.pod b/src/lib/libcrypto/doc/RSA_set_method.pod
index 14b0b4cf35..b672712292 100644
--- a/src/lib/libcrypto/doc/RSA_set_method.pod
+++ b/src/lib/libcrypto/doc/RSA_set_method.pod
@@ -4,17 +4,18 @@
4 4
5RSA_set_default_method, RSA_get_default_method, RSA_set_method, 5RSA_set_default_method, RSA_get_default_method, RSA_set_method,
6RSA_get_method, RSA_PKCS1_SSLeay, RSA_PKCS1_RSAref, 6RSA_get_method, RSA_PKCS1_SSLeay, RSA_PKCS1_RSAref,
7RSA_PKCS1_null_method, RSA_flags, RSA_new_method - select RSA method 7RSA_null_method, RSA_flags, RSA_new_method - select RSA method
8 8
9=head1 SYNOPSIS 9=head1 SYNOPSIS
10 10
11 #include <openssl/rsa.h> 11 #include <openssl/rsa.h>
12 #include <openssl/engine.h>
12 13
13 void RSA_set_default_method(RSA_METHOD *meth); 14 void RSA_set_default_openssl_method(RSA_METHOD *meth);
14 15
15 RSA_METHOD *RSA_get_default_method(void); 16 RSA_METHOD *RSA_get_default_openssl_method(void);
16 17
17 RSA_METHOD *RSA_set_method(RSA *rsa, RSA_METHOD *meth); 18 RSA_METHOD *RSA_set_method(RSA *rsa, ENGINE *engine);
18 19
19 RSA_METHOD *RSA_get_method(RSA *rsa); 20 RSA_METHOD *RSA_get_method(RSA *rsa);
20 21
@@ -26,7 +27,7 @@ RSA_PKCS1_null_method, RSA_flags, RSA_new_method - select RSA method
26 27
27 int RSA_flags(RSA *rsa); 28 int RSA_flags(RSA *rsa);
28 29
29 RSA *RSA_new_method(RSA_METHOD *method); 30 RSA *RSA_new_method(ENGINE *engine);
30 31
31=head1 DESCRIPTION 32=head1 DESCRIPTION
32 33
@@ -46,23 +47,27 @@ the RSA transformation. It is the default if OpenSSL is compiled with
46C<-DRSA_NULL>. These methods may be useful in the USA because of a 47C<-DRSA_NULL>. These methods may be useful in the USA because of a
47patent on the RSA cryptosystem. 48patent on the RSA cryptosystem.
48 49
49RSA_set_default_method() makes B<meth> the default method for all B<RSA> 50RSA_set_default_openssl_method() makes B<meth> the default method for all B<RSA>
50structures created later. 51structures created later. B<NB:> This is true only whilst the default engine
52for RSA operations remains as "openssl". ENGINEs provide an
53encapsulation for implementations of one or more algorithms at a time, and all
54the RSA functions mentioned here operate within the scope of the default
55"openssl" engine.
51 56
52RSA_get_default_method() returns a pointer to the current default 57RSA_get_default_openssl_method() returns a pointer to the current default
53method. 58method for the "openssl" engine.
54 59
55RSA_set_method() selects B<meth> for all operations using the key 60RSA_set_method() selects B<engine> for all operations using the key
56B<rsa>. 61B<rsa>.
57 62
58RSA_get_method() returns a pointer to the method currently selected 63RSA_get_method() returns a pointer to the RSA_METHOD from the currently
59for B<rsa>. 64selected ENGINE for B<rsa>.
60 65
61RSA_flags() returns the B<flags> that are set for B<rsa>'s current method. 66RSA_flags() returns the B<flags> that are set for B<rsa>'s current method.
62 67
63RSA_new_method() allocates and initializes an B<RSA> structure so that 68RSA_new_method() allocates and initializes an RSA structure so that
64B<method> will be used for the RSA operations. If B<method> is B<NULL>, 69B<engine> will be used for the RSA operations. If B<engine> is NULL,
65the default method is used. 70the default engine for RSA operations is used.
66 71
67=head1 THE RSA_METHOD STRUCTURE 72=head1 THE RSA_METHOD STRUCTURE
68 73
@@ -128,17 +133,21 @@ the default method is used.
128=head1 RETURN VALUES 133=head1 RETURN VALUES
129 134
130RSA_PKCS1_SSLeay(), RSA_PKCS1_RSAref(), RSA_PKCS1_null_method(), 135RSA_PKCS1_SSLeay(), RSA_PKCS1_RSAref(), RSA_PKCS1_null_method(),
131RSA_get_default_method() and RSA_get_method() return pointers to the 136RSA_get_default_openssl_method() and RSA_get_method() return pointers to
132respective B<RSA_METHOD>s. 137the respective RSA_METHODs.
133 138
134RSA_set_default_method() returns no value. 139RSA_set_default_openssl_method() returns no value.
135 140
136RSA_set_method() returns a pointer to the B<RSA_METHOD> previously 141RSA_set_method() selects B<engine> as the engine that will be responsible for
137associated with B<rsa>. 142all operations using the structure B<rsa>. If this function completes successfully,
143then the B<rsa> structure will have its own functional reference of B<engine>, so
144the caller should remember to free their own reference to B<engine> when they are
145finished with it. NB: An ENGINE's RSA_METHOD can be retrieved (or set) by
146ENGINE_get_RSA() or ENGINE_set_RSA().
138 147
139RSA_new_method() returns B<NULL> and sets an error code that can be 148RSA_new_method() returns NULL and sets an error code that can be
140obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise it 149obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise
141returns a pointer to the newly allocated structure. 150it returns a pointer to the newly allocated structure.
142 151
143=head1 SEE ALSO 152=head1 SEE ALSO
144 153
@@ -151,4 +160,9 @@ RSA_get_default_method(), RSA_set_method() and RSA_get_method() as
151well as the rsa_sign and rsa_verify components of RSA_METHOD were 160well as the rsa_sign and rsa_verify components of RSA_METHOD were
152added in OpenSSL 0.9.4. 161added in OpenSSL 0.9.4.
153 162
163RSA_set_default_openssl_method() and RSA_get_default_openssl_method()
164replaced RSA_set_default_method() and RSA_get_default_method() respectively,
165and RSA_set_method() and RSA_new_method() were altered to use B<ENGINE>s
166rather than B<DH_METHOD>s during development of OpenSSL 0.9.6.
167
154=cut 168=cut
diff --git a/src/lib/libcrypto/doc/dh.pod b/src/lib/libcrypto/doc/dh.pod
index 0a9b7c03a2..b4be4be405 100644
--- a/src/lib/libcrypto/doc/dh.pod
+++ b/src/lib/libcrypto/doc/dh.pod
@@ -7,6 +7,7 @@ dh - Diffie-Hellman key agreement
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/dh.h> 9 #include <openssl/dh.h>
10 #include <openssl/engine.h>
10 11
11 DH * DH_new(void); 12 DH * DH_new(void);
12 void DH_free(DH *dh); 13 void DH_free(DH *dh);
@@ -20,10 +21,10 @@ dh - Diffie-Hellman key agreement
20 int DH_generate_key(DH *dh); 21 int DH_generate_key(DH *dh);
21 int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh); 22 int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh);
22 23
23 void DH_set_default_method(DH_METHOD *meth); 24 void DH_set_default_openssl_method(DH_METHOD *meth);
24 DH_METHOD *DH_get_default_method(void); 25 DH_METHOD *DH_get_default_openssl_method(void);
25 DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth); 26 int DH_set_method(DH *dh, ENGINE *engine);
26 DH *DH_new_method(DH_METHOD *meth); 27 DH *DH_new_method(ENGINE *engine);
27 DH_METHOD *DH_OpenSSL(void); 28 DH_METHOD *DH_OpenSSL(void);
28 29
29 int DH_get_ex_new_index(long argl, char *argp, int (*new_func)(), 30 int DH_get_ex_new_index(long argl, char *argp, int (*new_func)(),
diff --git a/src/lib/libcrypto/doc/dsa.pod b/src/lib/libcrypto/doc/dsa.pod
index 80ecf38178..573500204b 100644
--- a/src/lib/libcrypto/doc/dsa.pod
+++ b/src/lib/libcrypto/doc/dsa.pod
@@ -7,6 +7,7 @@ dsa - Digital Signature Algorithm
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/dsa.h> 9 #include <openssl/dsa.h>
10 #include <openssl/engine.h>
10 11
11 DSA * DSA_new(void); 12 DSA * DSA_new(void);
12 void DSA_free(DSA *dsa); 13 void DSA_free(DSA *dsa);
@@ -28,10 +29,10 @@ dsa - Digital Signature Algorithm
28 int DSA_verify(int dummy, const unsigned char *dgst, int len, 29 int DSA_verify(int dummy, const unsigned char *dgst, int len,
29 unsigned char *sigbuf, int siglen, DSA *dsa); 30 unsigned char *sigbuf, int siglen, DSA *dsa);
30 31
31 void DSA_set_default_method(DSA_METHOD *meth); 32 void DSA_set_default_openssl_method(DSA_METHOD *meth);
32 DSA_METHOD *DSA_get_default_method(void); 33 DSA_METHOD *DSA_get_default_openssl_method(void);
33 DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth); 34 int DSA_set_method(DSA *dsa, ENGINE *engine);
34 DSA *DSA_new_method(DSA_METHOD *meth); 35 DSA *DSA_new_method(ENGINE *engine);
35 DSA_METHOD *DSA_OpenSSL(void); 36 DSA_METHOD *DSA_OpenSSL(void);
36 37
37 int DSA_get_ex_new_index(long argl, char *argp, int (*new_func)(), 38 int DSA_get_ex_new_index(long argl, char *argp, int (*new_func)(),
diff --git a/src/lib/libcrypto/doc/evp.pod b/src/lib/libcrypto/doc/evp.pod
new file mode 100644
index 0000000000..f089dd49a2
--- /dev/null
+++ b/src/lib/libcrypto/doc/evp.pod
@@ -0,0 +1,37 @@
1=pod
2
3=head1 NAME
4
5evp - high-level cryptographic functions
6
7=head1 SYNOPSIS
8
9 #include <openssl/evp.h>
10
11=head1 DESCRIPTION
12
13The EVP library provided a high-level interface to cryptographic
14functions.
15
16B<EVP_Seal>I<...> and B<EVP_Open>I<...> provide public key encryption
17and decryption to implement digital "envelopes".
18
19The B<EVP_Sign>I<...> and B<EVP_Verify>I<...> functions implement
20digital signatures.
21
22Symmetric encryption is available with the B<EVP_Encrypt>I<...>
23functions. The B<EVP_Digest>I<...> functions provide message digests.
24
25Algorithms are loaded with OpenSSL_add_all_algorithms(3).
26
27=head1 SEE ALSO
28
29L<EVP_DigestInit(3)|EVP_DigestInit(3)>,
30L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>,
31L<EVP_OpenInit(3)|EVP_OpenInit(3)>,
32L<EVP_SealInit(3)|EVP_SealInit(3)>,
33L<EVP_SignInit(3)|EVP_SignInit(3)>,
34L<EVP_VerifyInit(3)|EVP_VerifyInit(3)>,
35L<OpenSSL_add_all_algorithms(3)|OpenSSL_add_all_algorithms(3)>
36
37=cut
diff --git a/src/lib/libcrypto/doc/rsa.pod b/src/lib/libcrypto/doc/rsa.pod
index eb8ba612c4..ef0d4df205 100644
--- a/src/lib/libcrypto/doc/rsa.pod
+++ b/src/lib/libcrypto/doc/rsa.pod
@@ -7,6 +7,7 @@ rsa - RSA public key cryptosystem
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/rsa.h> 9 #include <openssl/rsa.h>
10 #include <openssl/engine.h>
10 11
11 RSA * RSA_new(void); 12 RSA * RSA_new(void);
12 void RSA_free(RSA *rsa); 13 void RSA_free(RSA *rsa);
@@ -31,15 +32,15 @@ rsa - RSA public key cryptosystem
31 int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); 32 int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
32 void RSA_blinding_off(RSA *rsa); 33 void RSA_blinding_off(RSA *rsa);
33 34
34 void RSA_set_default_method(RSA_METHOD *meth); 35 void RSA_set_default_openssl_method(RSA_METHOD *meth);
35 RSA_METHOD *RSA_get_default_method(void); 36 RSA_METHOD *RSA_get_default_openssl_method(void);
36 RSA_METHOD *RSA_set_method(RSA *rsa, RSA_METHOD *meth); 37 int RSA_set_method(RSA *rsa, ENGINE *engine);
37 RSA_METHOD *RSA_get_method(RSA *rsa); 38 RSA_METHOD *RSA_get_method(RSA *rsa);
38 RSA_METHOD *RSA_PKCS1_SSLeay(void); 39 RSA_METHOD *RSA_PKCS1_SSLeay(void);
39 RSA_METHOD *RSA_PKCS1_RSAref(void); 40 RSA_METHOD *RSA_PKCS1_RSAref(void);
40 RSA_METHOD *RSA_null_method(void); 41 RSA_METHOD *RSA_null_method(void);
41 int RSA_flags(RSA *rsa); 42 int RSA_flags(RSA *rsa);
42 RSA *RSA_new_method(RSA_METHOD *method); 43 RSA *RSA_new_method(ENGINE *engine);
43 44
44 int RSA_print(BIO *bp, RSA *x, int offset); 45 int RSA_print(BIO *bp, RSA *x, int offset);
45 int RSA_print_fp(FILE *fp, RSA *x, int offset); 46 int RSA_print_fp(FILE *fp, RSA *x, int offset);
@@ -96,7 +97,7 @@ SSL, PKCS #1 v2.0
96 97
97=head1 PATENTS 98=head1 PATENTS
98 99
99RSA is covered by a US patent which expires in September 2000. 100RSA was covered by a US patent which expired in September 2000.
100 101
101=head1 SEE ALSO 102=head1 SEE ALSO
102 103