diff options
author | markus <> | 2002-09-14 11:18:04 +0000 |
---|---|---|
committer | markus <> | 2002-09-14 11:18:04 +0000 |
commit | 3a3a489a756f2852d798376f20cc0d4ab609c866 (patch) | |
tree | 2a4277fc9b7635e82c33faa3bae9f9380bc639e8 /src/lib/libcrypto/doc | |
parent | 82d2611e1bb67683df1bb201dcc2afbff4c76980 (diff) | |
download | openbsd-3a3a489a756f2852d798376f20cc0d4ab609c866.tar.gz openbsd-3a3a489a756f2852d798376f20cc0d4ab609c866.tar.bz2 openbsd-3a3a489a756f2852d798376f20cc0d4ab609c866.zip |
merge with openssl-0.9.7-stable-SNAP-20020911,
new minor for libcrypto (_X509_REQ_print_ex)
tested by miod@, pb@
Diffstat (limited to 'src/lib/libcrypto/doc')
-rw-r--r-- | src/lib/libcrypto/doc/DH_set_method.pod | 102 | ||||
-rw-r--r-- | src/lib/libcrypto/doc/DSA_dup_DH.pod | 2 | ||||
-rw-r--r-- | src/lib/libcrypto/doc/DSA_new.pod | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/doc/DSA_set_method.pod | 91 | ||||
-rw-r--r-- | src/lib/libcrypto/doc/DSA_size.pod | 2 | ||||
-rw-r--r-- | src/lib/libcrypto/doc/EVP_SealInit.pod | 2 | ||||
-rw-r--r-- | src/lib/libcrypto/doc/RAND_set_rand_method.pod | 44 | ||||
-rw-r--r-- | src/lib/libcrypto/doc/RSA_new.pod | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/doc/RSA_set_method.pod | 127 | ||||
-rw-r--r-- | src/lib/libcrypto/doc/RSA_size.pod | 2 | ||||
-rw-r--r-- | src/lib/libcrypto/doc/dh.pod | 31 | ||||
-rw-r--r-- | src/lib/libcrypto/doc/dsa.pod | 38 | ||||
-rw-r--r-- | src/lib/libcrypto/doc/evp.pod | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/doc/rsa.pod | 31 |
14 files changed, 318 insertions, 173 deletions
diff --git a/src/lib/libcrypto/doc/DH_set_method.pod b/src/lib/libcrypto/doc/DH_set_method.pod index d990bf8786..73261fc467 100644 --- a/src/lib/libcrypto/doc/DH_set_method.pod +++ b/src/lib/libcrypto/doc/DH_set_method.pod | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | =head1 NAME | 3 | =head1 NAME |
4 | 4 | ||
5 | DH_set_default_openssl_method, DH_get_default_openssl_method, | 5 | DH_set_default_method, DH_get_default_method, |
6 | DH_set_method, DH_new_method, DH_OpenSSL - select DH method | 6 | DH_set_method, DH_new_method, DH_OpenSSL - select DH method |
7 | 7 | ||
8 | =head1 SYNOPSIS | 8 | =head1 SYNOPSIS |
@@ -10,45 +10,47 @@ DH_set_method, DH_new_method, DH_OpenSSL - select DH method | |||
10 | #include <openssl/dh.h> | 10 | #include <openssl/dh.h> |
11 | #include <openssl/engine.h> | 11 | #include <openssl/engine.h> |
12 | 12 | ||
13 | void DH_set_default_openssl_method(DH_METHOD *meth); | 13 | void DH_set_default_method(const DH_METHOD *meth); |
14 | 14 | ||
15 | DH_METHOD *DH_get_default_openssl_method(void); | 15 | const DH_METHOD *DH_get_default_method(void); |
16 | 16 | ||
17 | int DH_set_method(DH *dh, ENGINE *engine); | 17 | int DH_set_method(DH *dh, const DH_METHOD *meth); |
18 | 18 | ||
19 | DH *DH_new_method(ENGINE *engine); | 19 | DH *DH_new_method(ENGINE *engine); |
20 | 20 | ||
21 | DH_METHOD *DH_OpenSSL(void); | 21 | const DH_METHOD *DH_OpenSSL(void); |
22 | 22 | ||
23 | =head1 DESCRIPTION | 23 | =head1 DESCRIPTION |
24 | 24 | ||
25 | A B<DH_METHOD> specifies the functions that OpenSSL uses for Diffie-Hellman | 25 | A B<DH_METHOD> specifies the functions that OpenSSL uses for Diffie-Hellman |
26 | operations. By modifying the method, alternative implementations | 26 | operations. By modifying the method, alternative implementations |
27 | such as hardware accelerators may be used. | 27 | such as hardware accelerators may be used. IMPORTANT: See the NOTES section for |
28 | 28 | important information about how these DH API functions are affected by the use | |
29 | Initially, the default is to use the OpenSSL internal implementation. | 29 | of B<ENGINE> API calls. |
30 | DH_OpenSSL() returns a pointer to that method. | 30 | |
31 | 31 | Initially, the default DH_METHOD is the OpenSSL internal implementation, as | |
32 | DH_set_default_openssl_method() makes B<meth> the default method for all DH | 32 | returned by DH_OpenSSL(). |
33 | structures created later. B<NB:> This is true only whilst the default engine | 33 | |
34 | for Diffie-Hellman operations remains as "openssl". ENGINEs provide an | 34 | DH_set_default_method() makes B<meth> the default method for all DH |
35 | encapsulation for implementations of one or more algorithms, and all the DH | 35 | structures created later. B<NB>: This is true only whilst no ENGINE has been set |
36 | functions mentioned here operate within the scope of the default | 36 | as a default for DH, so this function is no longer recommended. |
37 | "openssl" engine. | 37 | |
38 | 38 | DH_get_default_method() returns a pointer to the current default DH_METHOD. | |
39 | DH_get_default_openssl_method() returns a pointer to the current default | 39 | However, the meaningfulness of this result is dependant on whether the ENGINE |
40 | method for the "openssl" engine. | 40 | API is being used, so this function is no longer recommended. |
41 | 41 | ||
42 | DH_set_method() selects B<engine> as the engine that will be responsible for | 42 | DH_set_method() selects B<meth> to perform all operations using the key B<dh>. |
43 | all operations using the structure B<dh>. If this function completes successfully, | 43 | This will replace the DH_METHOD used by the DH key and if the previous method |
44 | then the B<dh> structure will have its own functional reference of B<engine>, so | 44 | was supplied by an ENGINE, the handle to that ENGINE will be released during the |
45 | the caller should remember to free their own reference to B<engine> when they are | 45 | change. It is possible to have DH keys that only work with certain DH_METHOD |
46 | finished with it. NB: An ENGINE's DH_METHOD can be retrieved (or set) by | 46 | implementations (eg. from an ENGINE module that supports embedded |
47 | ENGINE_get_DH() or ENGINE_set_DH(). | 47 | hardware-protected keys), and in such cases attempting to change the DH_METHOD |
48 | 48 | for the key can have unexpected results. | |
49 | DH_new_method() allocates and initializes a DH structure so that | 49 | |
50 | B<engine> will be used for the DH operations. If B<engine> is NULL, | 50 | DH_new_method() allocates and initializes a DH structure so that B<engine> will |
51 | the default engine for Diffie-Hellman opertaions is used. | 51 | be used for the DH operations. If B<engine> is NULL, the default ENGINE for DH |
52 | operations is used, and if no default ENGINE is set, the DH_METHOD controlled by | ||
53 | DH_set_default_method() is used. | ||
52 | 54 | ||
53 | =head1 THE DH_METHOD STRUCTURE | 55 | =head1 THE DH_METHOD STRUCTURE |
54 | 56 | ||
@@ -82,17 +84,28 @@ the default engine for Diffie-Hellman opertaions is used. | |||
82 | 84 | ||
83 | =head1 RETURN VALUES | 85 | =head1 RETURN VALUES |
84 | 86 | ||
85 | DH_OpenSSL() and DH_get_default_openssl_method() return pointers to the | 87 | DH_OpenSSL() and DH_get_default_method() return pointers to the respective |
86 | respective B<DH_METHOD>s. | 88 | B<DH_METHOD>s. |
89 | |||
90 | DH_set_default_method() returns no value. | ||
91 | |||
92 | DH_set_method() returns non-zero if the provided B<meth> was successfully set as | ||
93 | the method for B<dh> (including unloading the ENGINE handle if the previous | ||
94 | method was supplied by an ENGINE). | ||
87 | 95 | ||
88 | DH_set_default_openssl_method() returns no value. | 96 | DH_new_method() returns NULL and sets an error code that can be obtained by |
97 | L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise it | ||
98 | returns a pointer to the newly allocated structure. | ||
89 | 99 | ||
90 | DH_set_method() returns non-zero if the ENGINE associated with B<dh> | 100 | =head1 NOTES |
91 | was successfully changed to B<engine>. | ||
92 | 101 | ||
93 | DH_new_method() returns NULL and sets an error code that can be | 102 | As of version 0.9.7, DH_METHOD implementations are grouped together with other |
94 | obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. | 103 | algorithmic APIs (eg. RSA_METHOD, EVP_CIPHER, etc) in B<ENGINE> modules. If a |
95 | Otherwise it returns a pointer to the newly allocated structure. | 104 | default ENGINE is specified for DH functionality using an ENGINE API function, |
105 | that will override any DH defaults set using the DH API (ie. | ||
106 | DH_set_default_method()). For this reason, the ENGINE API is the recommended way | ||
107 | to control default implementations for use in DH and other cryptographic | ||
108 | algorithms. | ||
96 | 109 | ||
97 | =head1 SEE ALSO | 110 | =head1 SEE ALSO |
98 | 111 | ||
@@ -103,9 +116,14 @@ L<dh(3)|dh(3)>, L<DH_new(3)|DH_new(3)> | |||
103 | DH_set_default_method(), DH_get_default_method(), DH_set_method(), | 116 | DH_set_default_method(), DH_get_default_method(), DH_set_method(), |
104 | DH_new_method() and DH_OpenSSL() were added in OpenSSL 0.9.4. | 117 | DH_new_method() and DH_OpenSSL() were added in OpenSSL 0.9.4. |
105 | 118 | ||
106 | DH_set_default_openssl_method() and DH_get_default_openssl_method() | 119 | DH_set_default_openssl_method() and DH_get_default_openssl_method() replaced |
107 | replaced DH_set_default_method() and DH_get_default_method() respectively, | 120 | DH_set_default_method() and DH_get_default_method() respectively, and |
108 | and DH_set_method() and DH_new_method() were altered to use B<ENGINE>s | 121 | DH_set_method() and DH_new_method() were altered to use B<ENGINE>s rather than |
109 | rather than B<DH_METHOD>s during development of OpenSSL 0.9.6. | 122 | B<DH_METHOD>s during development of the engine version of OpenSSL 0.9.6. For |
123 | 0.9.7, the handling of defaults in the ENGINE API was restructured so that this | ||
124 | change was reversed, and behaviour of the other functions resembled more closely | ||
125 | the previous behaviour. The behaviour of defaults in the ENGINE API now | ||
126 | transparently overrides the behaviour of defaults in the DH API without | ||
127 | requiring changing these function prototypes. | ||
110 | 128 | ||
111 | =cut | 129 | =cut |
diff --git a/src/lib/libcrypto/doc/DSA_dup_DH.pod b/src/lib/libcrypto/doc/DSA_dup_DH.pod index 695f99a13b..7f6f0d1115 100644 --- a/src/lib/libcrypto/doc/DSA_dup_DH.pod +++ b/src/lib/libcrypto/doc/DSA_dup_DH.pod | |||
@@ -8,7 +8,7 @@ DSA_dup_DH - create a DH structure out of DSA structure | |||
8 | 8 | ||
9 | #include <openssl/dsa.h> | 9 | #include <openssl/dsa.h> |
10 | 10 | ||
11 | DH * DSA_dup_DH(DSA *r); | 11 | DH * DSA_dup_DH(const DSA *r); |
12 | 12 | ||
13 | =head1 DESCRIPTION | 13 | =head1 DESCRIPTION |
14 | 14 | ||
diff --git a/src/lib/libcrypto/doc/DSA_new.pod b/src/lib/libcrypto/doc/DSA_new.pod index 301af912dd..48e9b82a09 100644 --- a/src/lib/libcrypto/doc/DSA_new.pod +++ b/src/lib/libcrypto/doc/DSA_new.pod | |||
@@ -14,7 +14,8 @@ DSA_new, DSA_free - allocate and free DSA objects | |||
14 | 14 | ||
15 | =head1 DESCRIPTION | 15 | =head1 DESCRIPTION |
16 | 16 | ||
17 | DSA_new() allocates and initializes a B<DSA> structure. | 17 | DSA_new() allocates and initializes a B<DSA> structure. It is equivalent to |
18 | calling DSA_new_method(NULL). | ||
18 | 19 | ||
19 | DSA_free() frees the B<DSA> structure and its components. The values are | 20 | DSA_free() frees the B<DSA> structure and its components. The values are |
20 | erased before the memory is returned to the system. | 21 | erased before the memory is returned to the system. |
diff --git a/src/lib/libcrypto/doc/DSA_set_method.pod b/src/lib/libcrypto/doc/DSA_set_method.pod index 36a1052d27..bc3cfb1f0a 100644 --- a/src/lib/libcrypto/doc/DSA_set_method.pod +++ b/src/lib/libcrypto/doc/DSA_set_method.pod | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | =head1 NAME | 3 | =head1 NAME |
4 | 4 | ||
5 | DSA_set_default_openssl_method, DSA_get_default_openssl_method, | 5 | DSA_set_default_method, DSA_get_default_method, |
6 | DSA_set_method, DSA_new_method, DSA_OpenSSL - select DSA method | 6 | DSA_set_method, DSA_new_method, DSA_OpenSSL - select DSA method |
7 | 7 | ||
8 | =head1 SYNOPSIS | 8 | =head1 SYNOPSIS |
@@ -10,11 +10,11 @@ DSA_set_method, DSA_new_method, DSA_OpenSSL - select DSA method | |||
10 | #include <openssl/dsa.h> | 10 | #include <openssl/dsa.h> |
11 | #include <openssl/engine.h> | 11 | #include <openssl/engine.h> |
12 | 12 | ||
13 | void DSA_set_default_openssl_method(DSA_METHOD *meth); | 13 | void DSA_set_default_method(const DSA_METHOD *meth); |
14 | 14 | ||
15 | DSA_METHOD *DSA_get_default_openssl_method(void); | 15 | const DSA_METHOD *DSA_get_default_method(void); |
16 | 16 | ||
17 | int DSA_set_method(DSA *dsa, ENGINE *engine); | 17 | int DSA_set_method(DSA *dsa, const DSA_METHOD *meth); |
18 | 18 | ||
19 | DSA *DSA_new_method(ENGINE *engine); | 19 | DSA *DSA_new_method(ENGINE *engine); |
20 | 20 | ||
@@ -24,26 +24,35 @@ DSA_set_method, DSA_new_method, DSA_OpenSSL - select DSA method | |||
24 | 24 | ||
25 | A B<DSA_METHOD> specifies the functions that OpenSSL uses for DSA | 25 | A B<DSA_METHOD> specifies the functions that OpenSSL uses for DSA |
26 | operations. By modifying the method, alternative implementations | 26 | operations. By modifying the method, alternative implementations |
27 | such as hardware accelerators may be used. | 27 | such as hardware accelerators may be used. IMPORTANT: See the NOTES section for |
28 | 28 | important information about how these DSA API functions are affected by the use | |
29 | Initially, the default is to use the OpenSSL internal implementation. | 29 | of B<ENGINE> API calls. |
30 | DSA_OpenSSL() returns a pointer to that method. | 30 | |
31 | 31 | Initially, the default DSA_METHOD is the OpenSSL internal implementation, | |
32 | DSA_set_default_openssl_method() makes B<meth> the default method for | 32 | as returned by DSA_OpenSSL(). |
33 | all DSA structures created later. B<NB:> This is true only whilst the | 33 | |
34 | default engine for DSA operations remains as "openssl". ENGINEs | 34 | DSA_set_default_method() makes B<meth> the default method for all DSA |
35 | provide an encapsulation for implementations of one or more algorithms at a | 35 | structures created later. B<NB>: This is true only whilst no ENGINE has |
36 | time, and all the DSA functions mentioned here operate within the scope | 36 | been set as a default for DSA, so this function is no longer recommended. |
37 | of the default "openssl" engine. | 37 | |
38 | 38 | DSA_get_default_method() returns a pointer to the current default | |
39 | DSA_get_default_openssl_method() returns a pointer to the current default | 39 | DSA_METHOD. However, the meaningfulness of this result is dependant on |
40 | method for the "openssl" engine. | 40 | whether the ENGINE API is being used, so this function is no longer |
41 | 41 | recommended. | |
42 | DSA_set_method() selects B<engine> for all operations using the structure B<dsa>. | 42 | |
43 | 43 | DSA_set_method() selects B<meth> to perform all operations using the key | |
44 | DSA_new_method() allocates and initializes a DSA structure so that | 44 | B<rsa>. This will replace the DSA_METHOD used by the DSA key and if the |
45 | B<engine> will be used for the DSA operations. If B<engine> is NULL, | 45 | previous method was supplied by an ENGINE, the handle to that ENGINE will |
46 | the default engine for DSA operations is used. | 46 | be released during the change. It is possible to have DSA keys that only |
47 | work with certain DSA_METHOD implementations (eg. from an ENGINE module | ||
48 | that supports embedded hardware-protected keys), and in such cases | ||
49 | attempting to change the DSA_METHOD for the key can have unexpected | ||
50 | results. | ||
51 | |||
52 | DSA_new_method() allocates and initializes a DSA structure so that B<engine> | ||
53 | will be used for the DSA operations. If B<engine> is NULL, the default engine | ||
54 | for DSA operations is used, and if no default ENGINE is set, the DSA_METHOD | ||
55 | controlled by DSA_set_default_method() is used. | ||
47 | 56 | ||
48 | =head1 THE DSA_METHOD STRUCTURE | 57 | =head1 THE DSA_METHOD STRUCTURE |
49 | 58 | ||
@@ -89,18 +98,29 @@ struct | |||
89 | 98 | ||
90 | =head1 RETURN VALUES | 99 | =head1 RETURN VALUES |
91 | 100 | ||
92 | DSA_OpenSSL() and DSA_get_default_openssl_method() return pointers to the | 101 | DSA_OpenSSL() and DSA_get_default_method() return pointers to the respective |
93 | respective B<DSA_METHOD>s. | 102 | B<DSA_METHOD>s. |
94 | 103 | ||
95 | DSA_set_default_openssl_method() returns no value. | 104 | DSA_set_default_method() returns no value. |
96 | 105 | ||
97 | DSA_set_method() returns non-zero if the ENGINE associated with B<dsa> | 106 | DSA_set_method() returns non-zero if the provided B<meth> was successfully set as |
98 | was successfully changed to B<engine>. | 107 | the method for B<dsa> (including unloading the ENGINE handle if the previous |
108 | method was supplied by an ENGINE). | ||
99 | 109 | ||
100 | DSA_new_method() returns NULL and sets an error code that can be | 110 | DSA_new_method() returns NULL and sets an error code that can be |
101 | obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation | 111 | obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation |
102 | fails. Otherwise it returns a pointer to the newly allocated structure. | 112 | fails. Otherwise it returns a pointer to the newly allocated structure. |
103 | 113 | ||
114 | =head1 NOTES | ||
115 | |||
116 | As of version 0.9.7, DSA_METHOD implementations are grouped together with other | ||
117 | algorithmic APIs (eg. RSA_METHOD, EVP_CIPHER, etc) in B<ENGINE> modules. If a | ||
118 | default ENGINE is specified for DSA functionality using an ENGINE API function, | ||
119 | that will override any DSA defaults set using the DSA API (ie. | ||
120 | DSA_set_default_method()). For this reason, the ENGINE API is the recommended way | ||
121 | to control default implementations for use in DSA and other cryptographic | ||
122 | algorithms. | ||
123 | |||
104 | =head1 SEE ALSO | 124 | =head1 SEE ALSO |
105 | 125 | ||
106 | L<dsa(3)|dsa(3)>, L<DSA_new(3)|DSA_new(3)> | 126 | L<dsa(3)|dsa(3)>, L<DSA_new(3)|DSA_new(3)> |
@@ -110,9 +130,14 @@ L<dsa(3)|dsa(3)>, L<DSA_new(3)|DSA_new(3)> | |||
110 | DSA_set_default_method(), DSA_get_default_method(), DSA_set_method(), | 130 | DSA_set_default_method(), DSA_get_default_method(), DSA_set_method(), |
111 | DSA_new_method() and DSA_OpenSSL() were added in OpenSSL 0.9.4. | 131 | DSA_new_method() and DSA_OpenSSL() were added in OpenSSL 0.9.4. |
112 | 132 | ||
113 | DSA_set_default_openssl_method() and DSA_get_default_openssl_method() | 133 | DSA_set_default_openssl_method() and DSA_get_default_openssl_method() replaced |
114 | replaced DSA_set_default_method() and DSA_get_default_method() respectively, | 134 | DSA_set_default_method() and DSA_get_default_method() respectively, and |
115 | and DSA_set_method() and DSA_new_method() were altered to use B<ENGINE>s | 135 | DSA_set_method() and DSA_new_method() were altered to use B<ENGINE>s rather than |
116 | rather than B<DSA_METHOD>s during development of OpenSSL 0.9.6. | 136 | B<DSA_METHOD>s during development of the engine version of OpenSSL 0.9.6. For |
137 | 0.9.7, the handling of defaults in the ENGINE API was restructured so that this | ||
138 | change was reversed, and behaviour of the other functions resembled more closely | ||
139 | the previous behaviour. The behaviour of defaults in the ENGINE API now | ||
140 | transparently overrides the behaviour of defaults in the DSA API without | ||
141 | requiring changing these function prototypes. | ||
117 | 142 | ||
118 | =cut | 143 | =cut |
diff --git a/src/lib/libcrypto/doc/DSA_size.pod b/src/lib/libcrypto/doc/DSA_size.pod index 23b6320a4d..ba4f650361 100644 --- a/src/lib/libcrypto/doc/DSA_size.pod +++ b/src/lib/libcrypto/doc/DSA_size.pod | |||
@@ -8,7 +8,7 @@ DSA_size - get DSA signature size | |||
8 | 8 | ||
9 | #include <openssl/dsa.h> | 9 | #include <openssl/dsa.h> |
10 | 10 | ||
11 | int DSA_size(DSA *dsa); | 11 | int DSA_size(const DSA *dsa); |
12 | 12 | ||
13 | =head1 DESCRIPTION | 13 | =head1 DESCRIPTION |
14 | 14 | ||
diff --git a/src/lib/libcrypto/doc/EVP_SealInit.pod b/src/lib/libcrypto/doc/EVP_SealInit.pod index 0451eb648a..25ef07f7c7 100644 --- a/src/lib/libcrypto/doc/EVP_SealInit.pod +++ b/src/lib/libcrypto/doc/EVP_SealInit.pod | |||
@@ -73,4 +73,6 @@ L<EVP_OpenInit(3)|EVP_OpenInit(3)> | |||
73 | 73 | ||
74 | =head1 HISTORY | 74 | =head1 HISTORY |
75 | 75 | ||
76 | EVP_SealFinal() did not return a value before OpenSSL 0.9.7. | ||
77 | |||
76 | =cut | 78 | =cut |
diff --git a/src/lib/libcrypto/doc/RAND_set_rand_method.pod b/src/lib/libcrypto/doc/RAND_set_rand_method.pod index 464eba416d..c9bb6d9f27 100644 --- a/src/lib/libcrypto/doc/RAND_set_rand_method.pod +++ b/src/lib/libcrypto/doc/RAND_set_rand_method.pod | |||
@@ -8,22 +8,30 @@ RAND_set_rand_method, RAND_get_rand_method, RAND_SSLeay - select RAND method | |||
8 | 8 | ||
9 | #include <openssl/rand.h> | 9 | #include <openssl/rand.h> |
10 | 10 | ||
11 | void RAND_set_rand_method(RAND_METHOD *meth); | 11 | void RAND_set_rand_method(const RAND_METHOD *meth); |
12 | 12 | ||
13 | RAND_METHOD *RAND_get_rand_method(void); | 13 | const RAND_METHOD *RAND_get_rand_method(void); |
14 | 14 | ||
15 | RAND_METHOD *RAND_SSLeay(void); | 15 | RAND_METHOD *RAND_SSLeay(void); |
16 | 16 | ||
17 | =head1 DESCRIPTION | 17 | =head1 DESCRIPTION |
18 | 18 | ||
19 | A B<RAND_METHOD> specifies the functions that OpenSSL uses for random | 19 | A B<RAND_METHOD> specifies the functions that OpenSSL uses for random number |
20 | number generation. By modifying the method, alternative | 20 | generation. By modifying the method, alternative implementations such as |
21 | implementations such as hardware RNGs may be used. Initially, the | 21 | hardware RNGs may be used. IMPORTANT: See the NOTES section for important |
22 | default is to use the OpenSSL internal implementation. RAND_SSLeay() | 22 | information about how these RAND API functions are affected by the use of |
23 | returns a pointer to that method. | 23 | B<ENGINE> API calls. |
24 | 24 | ||
25 | RAND_set_rand_method() sets the RAND method to B<meth>. | 25 | Initially, the default RAND_METHOD is the OpenSSL internal implementation, as |
26 | RAND_get_rand_method() returns a pointer to the current method. | 26 | returned by RAND_SSLeay(). |
27 | |||
28 | RAND_set_default_method() makes B<meth> the method for PRNG use. B<NB>: This is | ||
29 | true only whilst no ENGINE has been set as a default for RAND, so this function | ||
30 | is no longer recommended. | ||
31 | |||
32 | RAND_get_default_method() returns a pointer to the current RAND_METHOD. | ||
33 | However, the meaningfulness of this result is dependant on whether the ENGINE | ||
34 | API is being used, so this function is no longer recommended. | ||
27 | 35 | ||
28 | =head1 THE RAND_METHOD STRUCTURE | 36 | =head1 THE RAND_METHOD STRUCTURE |
29 | 37 | ||
@@ -47,13 +55,29 @@ Each component may be NULL if the function is not implemented. | |||
47 | RAND_set_rand_method() returns no value. RAND_get_rand_method() and | 55 | RAND_set_rand_method() returns no value. RAND_get_rand_method() and |
48 | RAND_SSLeay() return pointers to the respective methods. | 56 | RAND_SSLeay() return pointers to the respective methods. |
49 | 57 | ||
58 | =head1 NOTES | ||
59 | |||
60 | As of version 0.9.7, RAND_METHOD implementations are grouped together with other | ||
61 | algorithmic APIs (eg. RSA_METHOD, EVP_CIPHER, etc) in B<ENGINE> modules. If a | ||
62 | default ENGINE is specified for RAND functionality using an ENGINE API function, | ||
63 | that will override any RAND defaults set using the RAND API (ie. | ||
64 | RAND_set_rand_method()). For this reason, the ENGINE API is the recommended way | ||
65 | to control default implementations for use in RAND and other cryptographic | ||
66 | algorithms. | ||
67 | |||
50 | =head1 SEE ALSO | 68 | =head1 SEE ALSO |
51 | 69 | ||
52 | L<rand(3)|rand(3)> | 70 | L<rand(3)|rand(3)>, L<engine(3)|engine(3)> |
53 | 71 | ||
54 | =head1 HISTORY | 72 | =head1 HISTORY |
55 | 73 | ||
56 | RAND_set_rand_method(), RAND_get_rand_method() and RAND_SSLeay() are | 74 | RAND_set_rand_method(), RAND_get_rand_method() and RAND_SSLeay() are |
57 | available in all versions of OpenSSL. | 75 | available in all versions of OpenSSL. |
58 | 76 | ||
77 | In the engine version of version 0.9.6, RAND_set_rand_method() was altered to | ||
78 | take an ENGINE pointer as its argument. As of version 0.9.7, that has been | ||
79 | reverted as the ENGINE API transparently overrides RAND defaults if used, | ||
80 | otherwise RAND API functions work as before. RAND_set_rand_engine() was also | ||
81 | introduced in version 0.9.7. | ||
82 | |||
59 | =cut | 83 | =cut |
diff --git a/src/lib/libcrypto/doc/RSA_new.pod b/src/lib/libcrypto/doc/RSA_new.pod index 299047f31f..3d15b92824 100644 --- a/src/lib/libcrypto/doc/RSA_new.pod +++ b/src/lib/libcrypto/doc/RSA_new.pod | |||
@@ -14,7 +14,8 @@ RSA_new, RSA_free - allocate and free RSA objects | |||
14 | 14 | ||
15 | =head1 DESCRIPTION | 15 | =head1 DESCRIPTION |
16 | 16 | ||
17 | RSA_new() allocates and initializes an B<RSA> structure. | 17 | RSA_new() allocates and initializes an B<RSA> structure. It is equivalent to |
18 | calling RSA_new_method(NULL). | ||
18 | 19 | ||
19 | RSA_free() frees the B<RSA> structure and its components. The key is | 20 | RSA_free() frees the B<RSA> structure and its components. The key is |
20 | erased before the memory is returned to the system. | 21 | erased before the memory is returned to the system. |
@@ -30,7 +31,8 @@ RSA_free() returns no value. | |||
30 | =head1 SEE ALSO | 31 | =head1 SEE ALSO |
31 | 32 | ||
32 | L<ERR_get_error(3)|ERR_get_error(3)>, L<rsa(3)|rsa(3)>, | 33 | L<ERR_get_error(3)|ERR_get_error(3)>, L<rsa(3)|rsa(3)>, |
33 | L<RSA_generate_key(3)|RSA_generate_key(3)> | 34 | L<RSA_generate_key(3)|RSA_generate_key(3)>, |
35 | L<RSA_new_method(3)|RSA_new_method(3)> | ||
34 | 36 | ||
35 | =head1 HISTORY | 37 | =head1 HISTORY |
36 | 38 | ||
diff --git a/src/lib/libcrypto/doc/RSA_set_method.pod b/src/lib/libcrypto/doc/RSA_set_method.pod index 14917dd35f..0687c2242a 100644 --- a/src/lib/libcrypto/doc/RSA_set_method.pod +++ b/src/lib/libcrypto/doc/RSA_set_method.pod | |||
@@ -11,52 +11,64 @@ RSA_null_method, RSA_flags, RSA_new_method - select RSA method | |||
11 | #include <openssl/rsa.h> | 11 | #include <openssl/rsa.h> |
12 | #include <openssl/engine.h> | 12 | #include <openssl/engine.h> |
13 | 13 | ||
14 | void RSA_set_default_openssl_method(RSA_METHOD *meth); | 14 | void RSA_set_default_method(const RSA_METHOD *meth); |
15 | 15 | ||
16 | RSA_METHOD *RSA_get_default_openssl_method(void); | 16 | RSA_METHOD *RSA_get_default_method(void); |
17 | 17 | ||
18 | int RSA_set_method(RSA *rsa, ENGINE *engine); | 18 | int RSA_set_method(RSA *rsa, const RSA_METHOD *meth); |
19 | 19 | ||
20 | RSA_METHOD *RSA_get_method(RSA *rsa); | 20 | RSA_METHOD *RSA_get_method(const RSA *rsa); |
21 | 21 | ||
22 | RSA_METHOD *RSA_PKCS1_SSLeay(void); | 22 | RSA_METHOD *RSA_PKCS1_SSLeay(void); |
23 | 23 | ||
24 | RSA_METHOD *RSA_null_method(void); | 24 | RSA_METHOD *RSA_null_method(void); |
25 | 25 | ||
26 | int RSA_flags(RSA *rsa); | 26 | int RSA_flags(const RSA *rsa); |
27 | 27 | ||
28 | RSA *RSA_new_method(ENGINE *engine); | 28 | RSA *RSA_new_method(ENGINE *engine); |
29 | 29 | ||
30 | =head1 DESCRIPTION | 30 | =head1 DESCRIPTION |
31 | 31 | ||
32 | An B<RSA_METHOD> specifies the functions that OpenSSL uses for RSA | 32 | An B<RSA_METHOD> specifies the functions that OpenSSL uses for RSA |
33 | operations. By modifying the method, alternative implementations | 33 | operations. By modifying the method, alternative implementations such as |
34 | such as hardware accelerators may be used. | 34 | hardware accelerators may be used. IMPORTANT: See the NOTES section for |
35 | 35 | important information about how these RSA API functions are affected by the | |
36 | Initially, the default is to use the OpenSSL internal implementation. | 36 | use of B<ENGINE> API calls. |
37 | RSA_PKCS1_SSLeay() returns a pointer to that method. | 37 | |
38 | 38 | Initially, the default RSA_METHOD is the OpenSSL internal implementation, | |
39 | RSA_set_default_openssl_method() makes B<meth> the default method for all B<RSA> | 39 | as returned by RSA_PKCS1_SSLeay(). |
40 | structures created later. B<NB:> This is true only whilst the default engine | 40 | |
41 | for RSA operations remains as "openssl". ENGINEs provide an | 41 | RSA_set_default_method() makes B<meth> the default method for all RSA |
42 | encapsulation for implementations of one or more algorithms at a time, and all | 42 | structures created later. B<NB>: This is true only whilst no ENGINE has |
43 | the RSA functions mentioned here operate within the scope of the default | 43 | been set as a default for RSA, so this function is no longer recommended. |
44 | "openssl" engine. | 44 | |
45 | 45 | RSA_get_default_method() returns a pointer to the current default | |
46 | RSA_get_default_openssl_method() returns a pointer to the current default | 46 | RSA_METHOD. However, the meaningfulness of this result is dependant on |
47 | method for the "openssl" engine. | 47 | whether the ENGINE API is being used, so this function is no longer |
48 | 48 | recommended. | |
49 | RSA_set_method() selects B<engine> for all operations using the key | 49 | |
50 | B<rsa>. | 50 | RSA_set_method() selects B<meth> to perform all operations using the key |
51 | 51 | B<rsa>. This will replace the RSA_METHOD used by the RSA key and if the | |
52 | RSA_get_method() returns a pointer to the RSA_METHOD from the currently | 52 | previous method was supplied by an ENGINE, the handle to that ENGINE will |
53 | selected ENGINE for B<rsa>. | 53 | be released during the change. It is possible to have RSA keys that only |
54 | 54 | work with certain RSA_METHOD implementations (eg. from an ENGINE module | |
55 | RSA_flags() returns the B<flags> that are set for B<rsa>'s current method. | 55 | that supports embedded hardware-protected keys), and in such cases |
56 | attempting to change the RSA_METHOD for the key can have unexpected | ||
57 | results. | ||
58 | |||
59 | RSA_get_method() returns a pointer to the RSA_METHOD being used by B<rsa>. | ||
60 | This method may or may not be supplied by an ENGINE implementation, but if | ||
61 | it is, the return value can only be guaranteed to be valid as long as the | ||
62 | RSA key itself is valid and does not have its implementation changed by | ||
63 | RSA_set_method(). | ||
64 | |||
65 | RSA_flags() returns the B<flags> that are set for B<rsa>'s current | ||
66 | RSA_METHOD. See the BUGS section. | ||
56 | 67 | ||
57 | RSA_new_method() allocates and initializes an RSA structure so that | 68 | RSA_new_method() allocates and initializes an RSA structure so that |
58 | B<engine> will be used for the RSA operations. If B<engine> is NULL, | 69 | B<engine> will be used for the RSA operations. If B<engine> is NULL, the |
59 | the default engine for RSA operations is used. | 70 | default ENGINE for RSA operations is used, and if no default ENGINE is set, |
71 | the RSA_METHOD controlled by RSA_set_default_method() is used. | ||
60 | 72 | ||
61 | =head1 THE RSA_METHOD STRUCTURE | 73 | =head1 THE RSA_METHOD STRUCTURE |
62 | 74 | ||
@@ -121,22 +133,45 @@ the default engine for RSA operations is used. | |||
121 | 133 | ||
122 | =head1 RETURN VALUES | 134 | =head1 RETURN VALUES |
123 | 135 | ||
124 | RSA_PKCS1_SSLeay(), RSA_PKCS1_null_method(), RSA_get_default_openssl_method() | 136 | RSA_PKCS1_SSLeay(), RSA_PKCS1_null_method(), RSA_get_default_method() |
125 | and RSA_get_method() return pointers to the respective RSA_METHODs. | 137 | and RSA_get_method() return pointers to the respective RSA_METHODs. |
126 | 138 | ||
127 | RSA_set_default_openssl_method() returns no value. | 139 | RSA_set_default_method() returns no value. |
128 | 140 | ||
129 | RSA_set_method() selects B<engine> as the engine that will be responsible for | 141 | RSA_set_method() returns a pointer to the old RSA_METHOD implementation |
130 | all operations using the structure B<rsa>. If this function completes successfully, | 142 | that was replaced. However, this return value should probably be ignored |
131 | then the B<rsa> structure will have its own functional reference of B<engine>, so | 143 | because if it was supplied by an ENGINE, the pointer could be invalidated |
132 | the caller should remember to free their own reference to B<engine> when they are | 144 | at any time if the ENGINE is unloaded (in fact it could be unloaded as a |
133 | finished with it. NB: An ENGINE's RSA_METHOD can be retrieved (or set) by | 145 | result of the RSA_set_method() function releasing its handle to the |
134 | ENGINE_get_RSA() or ENGINE_set_RSA(). | 146 | ENGINE). For this reason, the return type may be replaced with a B<void> |
147 | declaration in a future release. | ||
135 | 148 | ||
136 | RSA_new_method() returns NULL and sets an error code that can be | 149 | RSA_new_method() returns NULL and sets an error code that can be obtained |
137 | obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise | 150 | by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise |
138 | it returns a pointer to the newly allocated structure. | 151 | it returns a pointer to the newly allocated structure. |
139 | 152 | ||
153 | =head1 NOTES | ||
154 | |||
155 | As of version 0.9.7, RSA_METHOD implementations are grouped together with | ||
156 | other algorithmic APIs (eg. DSA_METHOD, EVP_CIPHER, etc) into B<ENGINE> | ||
157 | modules. If a default ENGINE is specified for RSA functionality using an | ||
158 | ENGINE API function, that will override any RSA defaults set using the RSA | ||
159 | API (ie. RSA_set_default_method()). For this reason, the ENGINE API is the | ||
160 | recommended way to control default implementations for use in RSA and other | ||
161 | cryptographic algorithms. | ||
162 | |||
163 | =head1 BUGS | ||
164 | |||
165 | The behaviour of RSA_flags() is a mis-feature that is left as-is for now | ||
166 | to avoid creating compatibility problems. RSA functionality, such as the | ||
167 | encryption functions, are controlled by the B<flags> value in the RSA key | ||
168 | itself, not by the B<flags> value in the RSA_METHOD attached to the RSA key | ||
169 | (which is what this function returns). If the flags element of an RSA key | ||
170 | is changed, the changes will be honoured by RSA functionality but will not | ||
171 | be reflected in the return value of the RSA_flags() function - in effect | ||
172 | RSA_flags() behaves more like an RSA_default_flags() function (which does | ||
173 | not currently exist). | ||
174 | |||
140 | =head1 SEE ALSO | 175 | =head1 SEE ALSO |
141 | 176 | ||
142 | L<rsa(3)|rsa(3)>, L<RSA_new(3)|RSA_new(3)> | 177 | L<rsa(3)|rsa(3)>, L<RSA_new(3)|RSA_new(3)> |
@@ -149,8 +184,14 @@ well as the rsa_sign and rsa_verify components of RSA_METHOD were | |||
149 | added in OpenSSL 0.9.4. | 184 | added in OpenSSL 0.9.4. |
150 | 185 | ||
151 | RSA_set_default_openssl_method() and RSA_get_default_openssl_method() | 186 | RSA_set_default_openssl_method() and RSA_get_default_openssl_method() |
152 | replaced RSA_set_default_method() and RSA_get_default_method() respectively, | 187 | replaced RSA_set_default_method() and RSA_get_default_method() |
153 | and RSA_set_method() and RSA_new_method() were altered to use B<ENGINE>s | 188 | respectively, and RSA_set_method() and RSA_new_method() were altered to use |
154 | rather than B<RSA_METHOD>s during development of OpenSSL 0.9.6. | 189 | B<ENGINE>s rather than B<RSA_METHOD>s during development of the engine |
190 | version of OpenSSL 0.9.6. For 0.9.7, the handling of defaults in the ENGINE | ||
191 | API was restructured so that this change was reversed, and behaviour of the | ||
192 | other functions resembled more closely the previous behaviour. The | ||
193 | behaviour of defaults in the ENGINE API now transparently overrides the | ||
194 | behaviour of defaults in the RSA API without requiring changing these | ||
195 | function prototypes. | ||
155 | 196 | ||
156 | =cut | 197 | =cut |
diff --git a/src/lib/libcrypto/doc/RSA_size.pod b/src/lib/libcrypto/doc/RSA_size.pod index b36b4d58d5..5b7f835f95 100644 --- a/src/lib/libcrypto/doc/RSA_size.pod +++ b/src/lib/libcrypto/doc/RSA_size.pod | |||
@@ -8,7 +8,7 @@ RSA_size - get RSA modulus size | |||
8 | 8 | ||
9 | #include <openssl/rsa.h> | 9 | #include <openssl/rsa.h> |
10 | 10 | ||
11 | int RSA_size(RSA *rsa); | 11 | int RSA_size(const RSA *rsa); |
12 | 12 | ||
13 | =head1 DESCRIPTION | 13 | =head1 DESCRIPTION |
14 | 14 | ||
diff --git a/src/lib/libcrypto/doc/dh.pod b/src/lib/libcrypto/doc/dh.pod index b4be4be405..c3ccd06207 100644 --- a/src/lib/libcrypto/doc/dh.pod +++ b/src/lib/libcrypto/doc/dh.pod | |||
@@ -12,20 +12,20 @@ dh - Diffie-Hellman key agreement | |||
12 | DH * DH_new(void); | 12 | DH * DH_new(void); |
13 | void DH_free(DH *dh); | 13 | void DH_free(DH *dh); |
14 | 14 | ||
15 | int DH_size(DH *dh); | 15 | int DH_size(const DH *dh); |
16 | 16 | ||
17 | DH * DH_generate_parameters(int prime_len, int generator, | 17 | DH * DH_generate_parameters(int prime_len, int generator, |
18 | void (*callback)(int, int, void *), void *cb_arg); | 18 | void (*callback)(int, int, void *), void *cb_arg); |
19 | int DH_check(DH *dh, int *codes); | 19 | int DH_check(const DH *dh, int *codes); |
20 | 20 | ||
21 | int DH_generate_key(DH *dh); | 21 | int DH_generate_key(DH *dh); |
22 | 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); |
23 | 23 | ||
24 | void DH_set_default_openssl_method(DH_METHOD *meth); | 24 | void DH_set_default_method(const DH_METHOD *meth); |
25 | DH_METHOD *DH_get_default_openssl_method(void); | 25 | const DH_METHOD *DH_get_default_method(void); |
26 | int DH_set_method(DH *dh, ENGINE *engine); | 26 | int DH_set_method(DH *dh, const DH_METHOD *meth); |
27 | DH *DH_new_method(ENGINE *engine); | 27 | DH *DH_new_method(ENGINE *engine); |
28 | DH_METHOD *DH_OpenSSL(void); | 28 | const DH_METHOD *DH_OpenSSL(void); |
29 | 29 | ||
30 | 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)(), |
31 | int (*dup_func)(), void (*free_func)()); | 31 | int (*dup_func)(), void (*free_func)()); |
@@ -33,10 +33,10 @@ dh - Diffie-Hellman key agreement | |||
33 | char *DH_get_ex_data(DH *d, int idx); | 33 | char *DH_get_ex_data(DH *d, int idx); |
34 | 34 | ||
35 | DH * d2i_DHparams(DH **a, unsigned char **pp, long length); | 35 | DH * d2i_DHparams(DH **a, unsigned char **pp, long length); |
36 | int i2d_DHparams(DH *a, unsigned char **pp); | 36 | int i2d_DHparams(const DH *a, unsigned char **pp); |
37 | 37 | ||
38 | int DHparams_print_fp(FILE *fp, DH *x); | 38 | int DHparams_print_fp(FILE *fp, const DH *x); |
39 | int DHparams_print(BIO *bp, DH *x); | 39 | int DHparams_print(BIO *bp, const DH *x); |
40 | 40 | ||
41 | =head1 DESCRIPTION | 41 | =head1 DESCRIPTION |
42 | 42 | ||
@@ -57,11 +57,20 @@ The B<DH> structure consists of several BIGNUM components. | |||
57 | }; | 57 | }; |
58 | DH | 58 | DH |
59 | 59 | ||
60 | Note that DH keys may use non-standard B<DH_METHOD> implementations, | ||
61 | either directly or by the use of B<ENGINE> modules. In some cases (eg. an | ||
62 | ENGINE providing support for hardware-embedded keys), these BIGNUM values | ||
63 | will not be used by the implementation or may be used for alternative data | ||
64 | storage. For this reason, applications should generally avoid using DH | ||
65 | structure elements directly and instead use API functions to query or | ||
66 | modify keys. | ||
67 | |||
60 | =head1 SEE ALSO | 68 | =head1 SEE ALSO |
61 | 69 | ||
62 | L<dhparam(1)|dhparam(1)>, L<bn(3)|bn(3)>, L<dsa(3)|dsa(3)>, L<err(3)|err(3)>, | 70 | L<dhparam(1)|dhparam(1)>, L<bn(3)|bn(3)>, L<dsa(3)|dsa(3)>, L<err(3)|err(3)>, |
63 | L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, L<DH_set_method(3)|DH_set_method(3)>, | 71 | L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, L<engine(3)|engine(3)>, |
64 | L<DH_new(3)|DH_new(3)>, L<DH_get_ex_new_index(3)|DH_get_ex_new_index(3)>, | 72 | L<DH_set_method(3)|DH_set_method(3)>, L<DH_new(3)|DH_new(3)>, |
73 | L<DH_get_ex_new_index(3)|DH_get_ex_new_index(3)>, | ||
65 | L<DH_generate_parameters(3)|DH_generate_parameters(3)>, | 74 | L<DH_generate_parameters(3)|DH_generate_parameters(3)>, |
66 | L<DH_compute_key(3)|DH_compute_key(3)>, L<d2i_DHparams(3)|d2i_DHparams(3)>, | 75 | L<DH_compute_key(3)|DH_compute_key(3)>, L<d2i_DHparams(3)|d2i_DHparams(3)>, |
67 | L<RSA_print(3)|RSA_print(3)> | 76 | L<RSA_print(3)|RSA_print(3)> |
diff --git a/src/lib/libcrypto/doc/dsa.pod b/src/lib/libcrypto/doc/dsa.pod index 573500204b..ae2e5d81f9 100644 --- a/src/lib/libcrypto/doc/dsa.pod +++ b/src/lib/libcrypto/doc/dsa.pod | |||
@@ -12,13 +12,13 @@ dsa - Digital Signature Algorithm | |||
12 | DSA * DSA_new(void); | 12 | DSA * DSA_new(void); |
13 | void DSA_free(DSA *dsa); | 13 | void DSA_free(DSA *dsa); |
14 | 14 | ||
15 | int DSA_size(DSA *dsa); | 15 | int DSA_size(const DSA *dsa); |
16 | 16 | ||
17 | DSA * DSA_generate_parameters(int bits, unsigned char *seed, | 17 | DSA * DSA_generate_parameters(int bits, unsigned char *seed, |
18 | int seed_len, int *counter_ret, unsigned long *h_ret, | 18 | int seed_len, int *counter_ret, unsigned long *h_ret, |
19 | void (*callback)(int, int, void *), void *cb_arg); | 19 | void (*callback)(int, int, void *), void *cb_arg); |
20 | 20 | ||
21 | DH * DSA_dup_DH(DSA *r); | 21 | DH * DSA_dup_DH(const DSA *r); |
22 | 22 | ||
23 | int DSA_generate_key(DSA *dsa); | 23 | int DSA_generate_key(DSA *dsa); |
24 | 24 | ||
@@ -27,13 +27,13 @@ dsa - Digital Signature Algorithm | |||
27 | int DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp, | 27 | int DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp, |
28 | BIGNUM **rp); | 28 | BIGNUM **rp); |
29 | int DSA_verify(int dummy, const unsigned char *dgst, int len, | 29 | int DSA_verify(int dummy, const unsigned char *dgst, int len, |
30 | unsigned char *sigbuf, int siglen, DSA *dsa); | 30 | const unsigned char *sigbuf, int siglen, DSA *dsa); |
31 | 31 | ||
32 | void DSA_set_default_openssl_method(DSA_METHOD *meth); | 32 | void DSA_set_default_method(const DSA_METHOD *meth); |
33 | DSA_METHOD *DSA_get_default_openssl_method(void); | 33 | const DSA_METHOD *DSA_get_default_method(void); |
34 | int DSA_set_method(DSA *dsa, ENGINE *engine); | 34 | int DSA_set_method(DSA *dsa, const DSA_METHOD *meth); |
35 | DSA *DSA_new_method(ENGINE *engine); | 35 | DSA *DSA_new_method(ENGINE *engine); |
36 | DSA_METHOD *DSA_OpenSSL(void); | 36 | const DSA_METHOD *DSA_OpenSSL(void); |
37 | 37 | ||
38 | 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)(), |
39 | int (*dup_func)(), void (*free_func)()); | 39 | int (*dup_func)(), void (*free_func)()); |
@@ -42,7 +42,7 @@ dsa - Digital Signature Algorithm | |||
42 | 42 | ||
43 | DSA_SIG *DSA_SIG_new(void); | 43 | DSA_SIG *DSA_SIG_new(void); |
44 | void DSA_SIG_free(DSA_SIG *a); | 44 | void DSA_SIG_free(DSA_SIG *a); |
45 | int i2d_DSA_SIG(DSA_SIG *a, unsigned char **pp); | 45 | int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp); |
46 | DSA_SIG *d2i_DSA_SIG(DSA_SIG **v, unsigned char **pp, long length); | 46 | DSA_SIG *d2i_DSA_SIG(DSA_SIG **v, unsigned char **pp, long length); |
47 | 47 | ||
48 | DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa); | 48 | DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa); |
@@ -52,14 +52,14 @@ dsa - Digital Signature Algorithm | |||
52 | DSA * d2i_DSAPublicKey(DSA **a, unsigned char **pp, long length); | 52 | DSA * d2i_DSAPublicKey(DSA **a, unsigned char **pp, long length); |
53 | DSA * d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length); | 53 | DSA * d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length); |
54 | DSA * d2i_DSAparams(DSA **a, unsigned char **pp, long length); | 54 | DSA * d2i_DSAparams(DSA **a, unsigned char **pp, long length); |
55 | int i2d_DSAPublicKey(DSA *a, unsigned char **pp); | 55 | int i2d_DSAPublicKey(const DSA *a, unsigned char **pp); |
56 | int i2d_DSAPrivateKey(DSA *a, unsigned char **pp); | 56 | int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp); |
57 | int i2d_DSAparams(DSA *a,unsigned char **pp); | 57 | int i2d_DSAparams(const DSA *a,unsigned char **pp); |
58 | 58 | ||
59 | int DSAparams_print(BIO *bp, DSA *x); | 59 | int DSAparams_print(BIO *bp, const DSA *x); |
60 | int DSAparams_print_fp(FILE *fp, DSA *x); | 60 | int DSAparams_print_fp(FILE *fp, const DSA *x); |
61 | int DSA_print(BIO *bp, DSA *x, int off); | 61 | int DSA_print(BIO *bp, const DSA *x, int off); |
62 | int DSA_print_fp(FILE *bp, DSA *x, int off); | 62 | int DSA_print_fp(FILE *bp, const DSA *x, int off); |
63 | 63 | ||
64 | =head1 DESCRIPTION | 64 | =head1 DESCRIPTION |
65 | 65 | ||
@@ -85,6 +85,14 @@ The B<DSA> structure consists of several BIGNUM components. | |||
85 | 85 | ||
86 | In public keys, B<priv_key> is NULL. | 86 | In public keys, B<priv_key> is NULL. |
87 | 87 | ||
88 | Note that DSA keys may use non-standard B<DSA_METHOD> implementations, | ||
89 | either directly or by the use of B<ENGINE> modules. In some cases (eg. an | ||
90 | ENGINE providing support for hardware-embedded keys), these BIGNUM values | ||
91 | will not be used by the implementation or may be used for alternative data | ||
92 | storage. For this reason, applications should generally avoid using DSA | ||
93 | structure elements directly and instead use API functions to query or | ||
94 | modify keys. | ||
95 | |||
88 | =head1 CONFORMING TO | 96 | =head1 CONFORMING TO |
89 | 97 | ||
90 | US Federal Information Processing Standard FIPS 186 (Digital Signature | 98 | US Federal Information Processing Standard FIPS 186 (Digital Signature |
diff --git a/src/lib/libcrypto/doc/evp.pod b/src/lib/libcrypto/doc/evp.pod index edf47dbde6..b3ca14314f 100644 --- a/src/lib/libcrypto/doc/evp.pod +++ b/src/lib/libcrypto/doc/evp.pod | |||
@@ -24,6 +24,13 @@ functions. The B<EVP_Digest>I<...> functions provide message digests. | |||
24 | 24 | ||
25 | Algorithms are loaded with OpenSSL_add_all_algorithms(3). | 25 | Algorithms are loaded with OpenSSL_add_all_algorithms(3). |
26 | 26 | ||
27 | All the symmetric algorithms (ciphers) and digests can be replaced by ENGINE | ||
28 | modules providing alternative implementations. If ENGINE implementations of | ||
29 | ciphers or digests are registered as defaults, then the various EVP functions | ||
30 | will automatically use those implementations automatically in preference to | ||
31 | built in software implementations. For more information, consult the engine(3) | ||
32 | man page. | ||
33 | |||
27 | =head1 SEE ALSO | 34 | =head1 SEE ALSO |
28 | 35 | ||
29 | L<EVP_DigestInit(3)|EVP_DigestInit(3)>, | 36 | L<EVP_DigestInit(3)|EVP_DigestInit(3)>, |
@@ -32,6 +39,7 @@ L<EVP_OpenInit(3)|EVP_OpenInit(3)>, | |||
32 | L<EVP_SealInit(3)|EVP_SealInit(3)>, | 39 | L<EVP_SealInit(3)|EVP_SealInit(3)>, |
33 | L<EVP_SignInit(3)|EVP_SignInit(3)>, | 40 | L<EVP_SignInit(3)|EVP_SignInit(3)>, |
34 | L<EVP_VerifyInit(3)|EVP_VerifyInit(3)>, | 41 | L<EVP_VerifyInit(3)|EVP_VerifyInit(3)>, |
35 | L<OpenSSL_add_all_algorithms(3)|OpenSSL_add_all_algorithms(3)> | 42 | L<OpenSSL_add_all_algorithms(3)|OpenSSL_add_all_algorithms(3)>, |
43 | L<engine(3)|engine(3)> | ||
36 | 44 | ||
37 | =cut | 45 | =cut |
diff --git a/src/lib/libcrypto/doc/rsa.pod b/src/lib/libcrypto/doc/rsa.pod index 2b93a12b65..45ac53ffc1 100644 --- a/src/lib/libcrypto/doc/rsa.pod +++ b/src/lib/libcrypto/doc/rsa.pod | |||
@@ -16,13 +16,17 @@ rsa - RSA public key cryptosystem | |||
16 | unsigned char *to, RSA *rsa, int padding); | 16 | unsigned char *to, RSA *rsa, int padding); |
17 | int RSA_private_decrypt(int flen, unsigned char *from, | 17 | int RSA_private_decrypt(int flen, unsigned char *from, |
18 | unsigned char *to, RSA *rsa, int padding); | 18 | unsigned char *to, RSA *rsa, int padding); |
19 | int RSA_private_encrypt(int flen, unsigned char *from, | ||
20 | unsigned char *to, RSA *rsa,int padding); | ||
21 | int RSA_public_decrypt(int flen, unsigned char *from, | ||
22 | unsigned char *to, RSA *rsa,int padding); | ||
19 | 23 | ||
20 | int RSA_sign(int type, unsigned char *m, unsigned int m_len, | 24 | int RSA_sign(int type, unsigned char *m, unsigned int m_len, |
21 | unsigned char *sigret, unsigned int *siglen, RSA *rsa); | 25 | unsigned char *sigret, unsigned int *siglen, RSA *rsa); |
22 | int RSA_verify(int type, unsigned char *m, unsigned int m_len, | 26 | int RSA_verify(int type, unsigned char *m, unsigned int m_len, |
23 | unsigned char *sigbuf, unsigned int siglen, RSA *rsa); | 27 | unsigned char *sigbuf, unsigned int siglen, RSA *rsa); |
24 | 28 | ||
25 | int RSA_size(RSA *rsa); | 29 | int RSA_size(const RSA *rsa); |
26 | 30 | ||
27 | RSA *RSA_generate_key(int num, unsigned long e, | 31 | RSA *RSA_generate_key(int num, unsigned long e, |
28 | void (*callback)(int,int,void *), void *cb_arg); | 32 | void (*callback)(int,int,void *), void *cb_arg); |
@@ -32,13 +36,13 @@ rsa - RSA public key cryptosystem | |||
32 | int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); | 36 | int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); |
33 | void RSA_blinding_off(RSA *rsa); | 37 | void RSA_blinding_off(RSA *rsa); |
34 | 38 | ||
35 | void RSA_set_default_openssl_method(RSA_METHOD *meth); | 39 | void RSA_set_default_method(const RSA_METHOD *meth); |
36 | RSA_METHOD *RSA_get_default_openssl_method(void); | 40 | const RSA_METHOD *RSA_get_default_method(void); |
37 | int RSA_set_method(RSA *rsa, ENGINE *engine); | 41 | int RSA_set_method(RSA *rsa, const RSA_METHOD *meth); |
38 | RSA_METHOD *RSA_get_method(RSA *rsa); | 42 | const RSA_METHOD *RSA_get_method(const RSA *rsa); |
39 | RSA_METHOD *RSA_PKCS1_SSLeay(void); | 43 | RSA_METHOD *RSA_PKCS1_SSLeay(void); |
40 | RSA_METHOD *RSA_null_method(void); | 44 | RSA_METHOD *RSA_null_method(void); |
41 | int RSA_flags(RSA *rsa); | 45 | int RSA_flags(const RSA *rsa); |
42 | RSA *RSA_new_method(ENGINE *engine); | 46 | RSA *RSA_new_method(ENGINE *engine); |
43 | 47 | ||
44 | int RSA_print(BIO *bp, RSA *x, int offset); | 48 | int RSA_print(BIO *bp, RSA *x, int offset); |
@@ -49,11 +53,6 @@ rsa - RSA public key cryptosystem | |||
49 | int RSA_set_ex_data(RSA *r,int idx,char *arg); | 53 | int RSA_set_ex_data(RSA *r,int idx,char *arg); |
50 | char *RSA_get_ex_data(RSA *r, int idx); | 54 | char *RSA_get_ex_data(RSA *r, int idx); |
51 | 55 | ||
52 | int RSA_private_encrypt(int flen, unsigned char *from, | ||
53 | unsigned char *to, RSA *rsa,int padding); | ||
54 | int RSA_public_decrypt(int flen, unsigned char *from, | ||
55 | unsigned char *to, RSA *rsa,int padding); | ||
56 | |||
57 | int RSA_sign_ASN1_OCTET_STRING(int dummy, unsigned char *m, | 56 | int RSA_sign_ASN1_OCTET_STRING(int dummy, unsigned char *m, |
58 | unsigned int m_len, unsigned char *sigret, unsigned int *siglen, | 57 | unsigned int m_len, unsigned char *sigret, unsigned int *siglen, |
59 | RSA *rsa); | 58 | RSA *rsa); |
@@ -90,6 +89,14 @@ B<p>, B<q>, B<dmp1>, B<dmq1> and B<iqmp> may be B<NULL> in private | |||
90 | keys, but the RSA operations are much faster when these values are | 89 | keys, but the RSA operations are much faster when these values are |
91 | available. | 90 | available. |
92 | 91 | ||
92 | Note that RSA keys may use non-standard B<RSA_METHOD> implementations, | ||
93 | either directly or by the use of B<ENGINE> modules. In some cases (eg. an | ||
94 | ENGINE providing support for hardware-embedded keys), these BIGNUM values | ||
95 | will not be used by the implementation or may be used for alternative data | ||
96 | storage. For this reason, applications should generally avoid using RSA | ||
97 | structure elements directly and instead use API functions to query or | ||
98 | modify keys. | ||
99 | |||
93 | =head1 CONFORMING TO | 100 | =head1 CONFORMING TO |
94 | 101 | ||
95 | SSL, PKCS #1 v2.0 | 102 | SSL, PKCS #1 v2.0 |
@@ -101,7 +108,7 @@ RSA was covered by a US patent which expired in September 2000. | |||
101 | =head1 SEE ALSO | 108 | =head1 SEE ALSO |
102 | 109 | ||
103 | L<rsa(1)|rsa(1)>, L<bn(3)|bn(3)>, L<dsa(3)|dsa(3)>, L<dh(3)|dh(3)>, | 110 | L<rsa(1)|rsa(1)>, L<bn(3)|bn(3)>, L<dsa(3)|dsa(3)>, L<dh(3)|dh(3)>, |
104 | L<rand(3)|rand(3)>, L<RSA_new(3)|RSA_new(3)>, | 111 | L<rand(3)|rand(3)>, L<engine(3)|engine(3)>, L<RSA_new(3)|RSA_new(3)>, |
105 | L<RSA_public_encrypt(3)|RSA_public_encrypt(3)>, | 112 | L<RSA_public_encrypt(3)|RSA_public_encrypt(3)>, |
106 | L<RSA_sign(3)|RSA_sign(3)>, L<RSA_size(3)|RSA_size(3)>, | 113 | L<RSA_sign(3)|RSA_sign(3)>, L<RSA_size(3)|RSA_size(3)>, |
107 | L<RSA_generate_key(3)|RSA_generate_key(3)>, | 114 | L<RSA_generate_key(3)|RSA_generate_key(3)>, |