diff options
Diffstat (limited to 'src/lib/libcrypto/doc')
87 files changed, 0 insertions, 7244 deletions
diff --git a/src/lib/libcrypto/doc/DH_generate_key.pod b/src/lib/libcrypto/doc/DH_generate_key.pod deleted file mode 100644 index 81f09fdf45..0000000000 --- a/src/lib/libcrypto/doc/DH_generate_key.pod +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DH_generate_key, DH_compute_key - perform Diffie-Hellman key exchange | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/dh.h> | ||
10 | |||
11 | int DH_generate_key(DH *dh); | ||
12 | |||
13 | int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh); | ||
14 | |||
15 | =head1 DESCRIPTION | ||
16 | |||
17 | DH_generate_key() performs the first step of a Diffie-Hellman key | ||
18 | exchange by generating private and public DH values. By calling | ||
19 | DH_compute_key(), these are combined with the other party's public | ||
20 | value to compute the shared key. | ||
21 | |||
22 | DH_generate_key() expects B<dh> to contain the shared parameters | ||
23 | B<dh-E<gt>p> and B<dh-E<gt>g>. It generates a random private DH value | ||
24 | unless B<dh-E<gt>priv_key> is already set, and computes the | ||
25 | corresponding public value B<dh-E<gt>pub_key>, which can then be | ||
26 | published. | ||
27 | |||
28 | DH_compute_key() computes the shared secret from the private DH value | ||
29 | in B<dh> and the other party's public value in B<pub_key> and stores | ||
30 | it in B<key>. B<key> must point to B<DH_size(dh)> bytes of memory. | ||
31 | |||
32 | =head1 RETURN VALUES | ||
33 | |||
34 | DH_generate_key() returns 1 on success, 0 otherwise. | ||
35 | |||
36 | DH_compute_key() returns the size of the shared secret on success, -1 | ||
37 | on error. | ||
38 | |||
39 | The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
40 | |||
41 | =head1 SEE ALSO | ||
42 | |||
43 | L<dh(3)|dh(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<DH_size(3)|DH_size(3)> | ||
44 | |||
45 | =head1 HISTORY | ||
46 | |||
47 | DH_generate_key() and DH_compute_key() are available in all versions | ||
48 | of SSLeay and OpenSSL. | ||
49 | |||
50 | =cut | ||
diff --git a/src/lib/libcrypto/doc/DH_generate_parameters.pod b/src/lib/libcrypto/doc/DH_generate_parameters.pod deleted file mode 100644 index 9081e9ea7c..0000000000 --- a/src/lib/libcrypto/doc/DH_generate_parameters.pod +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DH_generate_parameters, DH_check - generate and check Diffie-Hellman parameters | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/dh.h> | ||
10 | |||
11 | DH *DH_generate_parameters(int prime_len, int generator, | ||
12 | void (*callback)(int, int, void *), void *cb_arg); | ||
13 | |||
14 | int DH_check(DH *dh, int *codes); | ||
15 | |||
16 | =head1 DESCRIPTION | ||
17 | |||
18 | DH_generate_parameters() generates Diffie-Hellman parameters that can | ||
19 | be shared among a group of users, and returns them in a newly | ||
20 | allocated B<DH> structure. The pseudo-random number generator must be | ||
21 | seeded prior to calling DH_generate_parameters(). | ||
22 | |||
23 | B<prime_len> is the length in bits of the safe prime to be generated. | ||
24 | B<generator> is a small number E<gt> 1, typically 2 or 5. | ||
25 | |||
26 | A callback function may be used to provide feedback about the progress | ||
27 | of the key generation. If B<callback> is not B<NULL>, it will be | ||
28 | called as described in L<BN_generate_prime(3)|BN_generate_prime(3)> while a random prime | ||
29 | number is generated, and when a prime has been found, B<callback(3, | ||
30 | 0, cb_arg)> is called. | ||
31 | |||
32 | DH_check() validates Diffie-Hellman parameters. It checks that B<p> is | ||
33 | a safe prime, and that B<g> is a suitable generator. In the case of an | ||
34 | error, the bit flags DH_CHECK_P_NOT_SAFE_PRIME or | ||
35 | DH_NOT_SUITABLE_GENERATOR are set in B<*codes>. | ||
36 | DH_UNABLE_TO_CHECK_GENERATOR is set if the generator cannot be | ||
37 | checked, i.e. it does not equal 2 or 5. | ||
38 | |||
39 | =head1 RETURN VALUES | ||
40 | |||
41 | DH_generate_parameters() returns a pointer to the DH structure, or | ||
42 | NULL if the parameter generation fails. The error codes can be | ||
43 | obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
44 | |||
45 | DH_check() returns 1 if the check could be performed, 0 otherwise. | ||
46 | |||
47 | =head1 NOTES | ||
48 | |||
49 | DH_generate_parameters() may run for several hours before finding a | ||
50 | suitable prime. | ||
51 | |||
52 | The parameters generated by DH_generate_parameters() are not to be | ||
53 | used in signature schemes. | ||
54 | |||
55 | =head1 BUGS | ||
56 | |||
57 | If B<generator> is not 2 or 5, B<dh-E<gt>g>=B<generator> is not | ||
58 | a usable generator. | ||
59 | |||
60 | =head1 SEE ALSO | ||
61 | |||
62 | L<dh(3)|dh(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, | ||
63 | L<DH_free(3)|DH_free(3)> | ||
64 | |||
65 | =head1 HISTORY | ||
66 | |||
67 | DH_check() is available in all versions of SSLeay and OpenSSL. | ||
68 | The B<cb_arg> argument to DH_generate_parameters() was added in SSLeay 0.9.0. | ||
69 | |||
70 | In versions before OpenSSL 0.9.5, DH_CHECK_P_NOT_STRONG_PRIME is used | ||
71 | instead of DH_CHECK_P_NOT_SAFE_PRIME. | ||
72 | |||
73 | =cut | ||
diff --git a/src/lib/libcrypto/doc/DH_get_ex_new_index.pod b/src/lib/libcrypto/doc/DH_get_ex_new_index.pod deleted file mode 100644 index fa5eab2650..0000000000 --- a/src/lib/libcrypto/doc/DH_get_ex_new_index.pod +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DH_get_ex_new_index, DH_set_ex_data, DH_get_ex_data - add application specific data to DH structures | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/dh.h> | ||
10 | |||
11 | int DH_get_ex_new_index(long argl, void *argp, | ||
12 | CRYPTO_EX_new *new_func, | ||
13 | CRYPTO_EX_dup *dup_func, | ||
14 | CRYPTO_EX_free *free_func); | ||
15 | |||
16 | int DH_set_ex_data(DH *d, int idx, void *arg); | ||
17 | |||
18 | char *DH_get_ex_data(DH *d, int idx); | ||
19 | |||
20 | =head1 DESCRIPTION | ||
21 | |||
22 | These functions handle application specific data in DH | ||
23 | structures. Their usage is identical to that of | ||
24 | RSA_get_ex_new_index(), RSA_set_ex_data() and RSA_get_ex_data() | ||
25 | as described in L<RSA_get_ex_new_index(3)>. | ||
26 | |||
27 | =head1 SEE ALSO | ||
28 | |||
29 | L<RSA_get_ex_new_index(3)|RSA_get_ex_new_index(3)>, L<dh(3)|dh(3)> | ||
30 | |||
31 | =head1 HISTORY | ||
32 | |||
33 | DH_get_ex_new_index(), DH_set_ex_data() and DH_get_ex_data() are | ||
34 | available since OpenSSL 0.9.5. | ||
35 | |||
36 | =cut | ||
diff --git a/src/lib/libcrypto/doc/DH_new.pod b/src/lib/libcrypto/doc/DH_new.pod deleted file mode 100644 index 60c930093e..0000000000 --- a/src/lib/libcrypto/doc/DH_new.pod +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DH_new, DH_free - allocate and free DH objects | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/dh.h> | ||
10 | |||
11 | DH* DH_new(void); | ||
12 | |||
13 | void DH_free(DH *dh); | ||
14 | |||
15 | =head1 DESCRIPTION | ||
16 | |||
17 | DH_new() allocates and initializes a B<DH> structure. | ||
18 | |||
19 | DH_free() frees the B<DH> structure and its components. The values are | ||
20 | erased before the memory is returned to the system. | ||
21 | |||
22 | =head1 RETURN VALUES | ||
23 | |||
24 | If the allocation fails, DH_new() returns B<NULL> and sets an error | ||
25 | code that can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. Otherwise it returns | ||
26 | a pointer to the newly allocated structure. | ||
27 | |||
28 | DH_free() returns no value. | ||
29 | |||
30 | =head1 SEE ALSO | ||
31 | |||
32 | L<dh(3)|dh(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, | ||
33 | L<DH_generate_parameters(3)|DH_generate_parameters(3)>, | ||
34 | L<DH_generate_key(3)|DH_generate_key(3)> | ||
35 | |||
36 | =head1 HISTORY | ||
37 | |||
38 | DH_new() and DH_free() are available in all versions of SSLeay and OpenSSL. | ||
39 | |||
40 | =cut | ||
diff --git a/src/lib/libcrypto/doc/DH_set_method.pod b/src/lib/libcrypto/doc/DH_set_method.pod deleted file mode 100644 index 73261fc467..0000000000 --- a/src/lib/libcrypto/doc/DH_set_method.pod +++ /dev/null | |||
@@ -1,129 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DH_set_default_method, DH_get_default_method, | ||
6 | DH_set_method, DH_new_method, DH_OpenSSL - select DH method | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/dh.h> | ||
11 | #include <openssl/engine.h> | ||
12 | |||
13 | void DH_set_default_method(const DH_METHOD *meth); | ||
14 | |||
15 | const DH_METHOD *DH_get_default_method(void); | ||
16 | |||
17 | int DH_set_method(DH *dh, const DH_METHOD *meth); | ||
18 | |||
19 | DH *DH_new_method(ENGINE *engine); | ||
20 | |||
21 | const DH_METHOD *DH_OpenSSL(void); | ||
22 | |||
23 | =head1 DESCRIPTION | ||
24 | |||
25 | A B<DH_METHOD> specifies the functions that OpenSSL uses for Diffie-Hellman | ||
26 | operations. By modifying the method, alternative implementations | ||
27 | such as hardware accelerators may be used. IMPORTANT: See the NOTES section for | ||
28 | important information about how these DH API functions are affected by the use | ||
29 | of B<ENGINE> API calls. | ||
30 | |||
31 | Initially, the default DH_METHOD is the OpenSSL internal implementation, as | ||
32 | returned by DH_OpenSSL(). | ||
33 | |||
34 | DH_set_default_method() makes B<meth> the default method for all DH | ||
35 | structures created later. B<NB>: This is true only whilst no ENGINE has been set | ||
36 | as a default for DH, so this function is no longer recommended. | ||
37 | |||
38 | DH_get_default_method() returns a pointer to the current default DH_METHOD. | ||
39 | However, the meaningfulness of this result is dependant on whether the ENGINE | ||
40 | API is being used, so this function is no longer recommended. | ||
41 | |||
42 | DH_set_method() selects B<meth> to perform all operations using the key B<dh>. | ||
43 | This will replace the DH_METHOD used by the DH key and if the previous method | ||
44 | was supplied by an ENGINE, the handle to that ENGINE will be released during the | ||
45 | change. It is possible to have DH keys that only work with certain DH_METHOD | ||
46 | implementations (eg. from an ENGINE module that supports embedded | ||
47 | hardware-protected keys), and in such cases attempting to change the DH_METHOD | ||
48 | for the key can have unexpected results. | ||
49 | |||
50 | DH_new_method() allocates and initializes a DH structure so that B<engine> will | ||
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. | ||
54 | |||
55 | =head1 THE DH_METHOD STRUCTURE | ||
56 | |||
57 | typedef struct dh_meth_st | ||
58 | { | ||
59 | /* name of the implementation */ | ||
60 | const char *name; | ||
61 | |||
62 | /* generate private and public DH values for key agreement */ | ||
63 | int (*generate_key)(DH *dh); | ||
64 | |||
65 | /* compute shared secret */ | ||
66 | int (*compute_key)(unsigned char *key, BIGNUM *pub_key, DH *dh); | ||
67 | |||
68 | /* compute r = a ^ p mod m (May be NULL for some implementations) */ | ||
69 | int (*bn_mod_exp)(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p, | ||
70 | const BIGNUM *m, BN_CTX *ctx, | ||
71 | BN_MONT_CTX *m_ctx); | ||
72 | |||
73 | /* called at DH_new */ | ||
74 | int (*init)(DH *dh); | ||
75 | |||
76 | /* called at DH_free */ | ||
77 | int (*finish)(DH *dh); | ||
78 | |||
79 | int flags; | ||
80 | |||
81 | char *app_data; /* ?? */ | ||
82 | |||
83 | } DH_METHOD; | ||
84 | |||
85 | =head1 RETURN VALUES | ||
86 | |||
87 | DH_OpenSSL() and DH_get_default_method() return pointers to the respective | ||
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). | ||
95 | |||
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. | ||
99 | |||
100 | =head1 NOTES | ||
101 | |||
102 | As of version 0.9.7, DH_METHOD implementations are grouped together with other | ||
103 | algorithmic APIs (eg. RSA_METHOD, EVP_CIPHER, etc) in B<ENGINE> modules. If a | ||
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. | ||
109 | |||
110 | =head1 SEE ALSO | ||
111 | |||
112 | L<dh(3)|dh(3)>, L<DH_new(3)|DH_new(3)> | ||
113 | |||
114 | =head1 HISTORY | ||
115 | |||
116 | DH_set_default_method(), DH_get_default_method(), DH_set_method(), | ||
117 | DH_new_method() and DH_OpenSSL() were added in OpenSSL 0.9.4. | ||
118 | |||
119 | DH_set_default_openssl_method() and DH_get_default_openssl_method() replaced | ||
120 | DH_set_default_method() and DH_get_default_method() respectively, and | ||
121 | DH_set_method() and DH_new_method() were altered to use B<ENGINE>s rather than | ||
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. | ||
128 | |||
129 | =cut | ||
diff --git a/src/lib/libcrypto/doc/DH_size.pod b/src/lib/libcrypto/doc/DH_size.pod deleted file mode 100644 index 97f26fda78..0000000000 --- a/src/lib/libcrypto/doc/DH_size.pod +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DH_size - get Diffie-Hellman prime size | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/dh.h> | ||
10 | |||
11 | int DH_size(DH *dh); | ||
12 | |||
13 | =head1 DESCRIPTION | ||
14 | |||
15 | This function returns the Diffie-Hellman size in bytes. It can be used | ||
16 | to determine how much memory must be allocated for the shared secret | ||
17 | computed by DH_compute_key(). | ||
18 | |||
19 | B<dh-E<gt>p> must not be B<NULL>. | ||
20 | |||
21 | =head1 RETURN VALUE | ||
22 | |||
23 | The size in bytes. | ||
24 | |||
25 | =head1 SEE ALSO | ||
26 | |||
27 | L<dh(3)|dh(3)>, L<DH_generate_key(3)|DH_generate_key(3)> | ||
28 | |||
29 | =head1 HISTORY | ||
30 | |||
31 | DH_size() is available in all versions of SSLeay and OpenSSL. | ||
32 | |||
33 | =cut | ||
diff --git a/src/lib/libcrypto/doc/DSA_SIG_new.pod b/src/lib/libcrypto/doc/DSA_SIG_new.pod deleted file mode 100644 index 3ac6140038..0000000000 --- a/src/lib/libcrypto/doc/DSA_SIG_new.pod +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DSA_SIG_new, DSA_SIG_free - allocate and free DSA signature objects | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/dsa.h> | ||
10 | |||
11 | DSA_SIG *DSA_SIG_new(void); | ||
12 | |||
13 | void DSA_SIG_free(DSA_SIG *a); | ||
14 | |||
15 | =head1 DESCRIPTION | ||
16 | |||
17 | DSA_SIG_new() allocates and initializes a B<DSA_SIG> structure. | ||
18 | |||
19 | DSA_SIG_free() frees the B<DSA_SIG> structure and its components. The | ||
20 | values are erased before the memory is returned to the system. | ||
21 | |||
22 | =head1 RETURN VALUES | ||
23 | |||
24 | If the allocation fails, DSA_SIG_new() returns B<NULL> and sets an | ||
25 | error code that can be obtained by | ||
26 | L<ERR_get_error(3)|ERR_get_error(3)>. Otherwise it returns a pointer | ||
27 | to the newly allocated structure. | ||
28 | |||
29 | DSA_SIG_free() returns no value. | ||
30 | |||
31 | =head1 SEE ALSO | ||
32 | |||
33 | L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, | ||
34 | L<DSA_do_sign(3)|DSA_do_sign(3)> | ||
35 | |||
36 | =head1 HISTORY | ||
37 | |||
38 | DSA_SIG_new() and DSA_SIG_free() were added in OpenSSL 0.9.3. | ||
39 | |||
40 | =cut | ||
diff --git a/src/lib/libcrypto/doc/DSA_do_sign.pod b/src/lib/libcrypto/doc/DSA_do_sign.pod deleted file mode 100644 index 5dfc733b20..0000000000 --- a/src/lib/libcrypto/doc/DSA_do_sign.pod +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DSA_do_sign, DSA_do_verify - raw DSA signature operations | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/dsa.h> | ||
10 | |||
11 | DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa); | ||
12 | |||
13 | int DSA_do_verify(const unsigned char *dgst, int dgst_len, | ||
14 | DSA_SIG *sig, DSA *dsa); | ||
15 | |||
16 | =head1 DESCRIPTION | ||
17 | |||
18 | DSA_do_sign() computes a digital signature on the B<len> byte message | ||
19 | digest B<dgst> using the private key B<dsa> and returns it in a | ||
20 | newly allocated B<DSA_SIG> structure. | ||
21 | |||
22 | L<DSA_sign_setup(3)|DSA_sign_setup(3)> may be used to precompute part | ||
23 | of the signing operation in case signature generation is | ||
24 | time-critical. | ||
25 | |||
26 | DSA_do_verify() verifies that the signature B<sig> matches a given | ||
27 | message digest B<dgst> of size B<len>. B<dsa> is the signer's public | ||
28 | key. | ||
29 | |||
30 | =head1 RETURN VALUES | ||
31 | |||
32 | DSA_do_sign() returns the signature, NULL on error. DSA_do_verify() | ||
33 | returns 1 for a valid signature, 0 for an incorrect signature and -1 | ||
34 | on error. The error codes can be obtained by | ||
35 | L<ERR_get_error(3)|ERR_get_error(3)>. | ||
36 | |||
37 | =head1 SEE ALSO | ||
38 | |||
39 | L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, | ||
40 | L<DSA_SIG_new(3)|DSA_SIG_new(3)>, | ||
41 | L<DSA_sign(3)|DSA_sign(3)> | ||
42 | |||
43 | =head1 HISTORY | ||
44 | |||
45 | DSA_do_sign() and DSA_do_verify() were added in OpenSSL 0.9.3. | ||
46 | |||
47 | =cut | ||
diff --git a/src/lib/libcrypto/doc/DSA_dup_DH.pod b/src/lib/libcrypto/doc/DSA_dup_DH.pod deleted file mode 100644 index 7f6f0d1115..0000000000 --- a/src/lib/libcrypto/doc/DSA_dup_DH.pod +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DSA_dup_DH - create a DH structure out of DSA structure | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/dsa.h> | ||
10 | |||
11 | DH * DSA_dup_DH(const DSA *r); | ||
12 | |||
13 | =head1 DESCRIPTION | ||
14 | |||
15 | DSA_dup_DH() duplicates DSA parameters/keys as DH parameters/keys. q | ||
16 | is lost during that conversion, but the resulting DH parameters | ||
17 | contain its length. | ||
18 | |||
19 | =head1 RETURN VALUE | ||
20 | |||
21 | DSA_dup_DH() returns the new B<DH> structure, and NULL on error. The | ||
22 | error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
23 | |||
24 | =head1 NOTE | ||
25 | |||
26 | Be careful to avoid small subgroup attacks when using this. | ||
27 | |||
28 | =head1 SEE ALSO | ||
29 | |||
30 | L<dh(3)|dh(3)>, L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)> | ||
31 | |||
32 | =head1 HISTORY | ||
33 | |||
34 | DSA_dup_DH() was added in OpenSSL 0.9.4. | ||
35 | |||
36 | =cut | ||
diff --git a/src/lib/libcrypto/doc/DSA_generate_key.pod b/src/lib/libcrypto/doc/DSA_generate_key.pod deleted file mode 100644 index af83ccfaa1..0000000000 --- a/src/lib/libcrypto/doc/DSA_generate_key.pod +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DSA_generate_key - generate DSA key pair | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/dsa.h> | ||
10 | |||
11 | int DSA_generate_key(DSA *a); | ||
12 | |||
13 | =head1 DESCRIPTION | ||
14 | |||
15 | DSA_generate_key() expects B<a> to contain DSA parameters. It generates | ||
16 | a new key pair and stores it in B<a-E<gt>pub_key> and B<a-E<gt>priv_key>. | ||
17 | |||
18 | The PRNG must be seeded prior to calling DSA_generate_key(). | ||
19 | |||
20 | =head1 RETURN VALUE | ||
21 | |||
22 | DSA_generate_key() returns 1 on success, 0 otherwise. | ||
23 | The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
24 | |||
25 | =head1 SEE ALSO | ||
26 | |||
27 | L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, | ||
28 | L<DSA_generate_parameters(3)|DSA_generate_parameters(3)> | ||
29 | |||
30 | =head1 HISTORY | ||
31 | |||
32 | DSA_generate_key() is available since SSLeay 0.8. | ||
33 | |||
34 | =cut | ||
diff --git a/src/lib/libcrypto/doc/DSA_generate_parameters.pod b/src/lib/libcrypto/doc/DSA_generate_parameters.pod deleted file mode 100644 index be7c924ff8..0000000000 --- a/src/lib/libcrypto/doc/DSA_generate_parameters.pod +++ /dev/null | |||
@@ -1,105 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DSA_generate_parameters - generate DSA parameters | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/dsa.h> | ||
10 | |||
11 | DSA *DSA_generate_parameters(int bits, unsigned char *seed, | ||
12 | int seed_len, int *counter_ret, unsigned long *h_ret, | ||
13 | void (*callback)(int, int, void *), void *cb_arg); | ||
14 | |||
15 | =head1 DESCRIPTION | ||
16 | |||
17 | DSA_generate_parameters() generates primes p and q and a generator g | ||
18 | for use in the DSA. | ||
19 | |||
20 | B<bits> is the length of the prime to be generated; the DSS allows a | ||
21 | maximum of 1024 bits. | ||
22 | |||
23 | If B<seed> is B<NULL> or B<seed_len> E<lt> 20, the primes will be | ||
24 | generated at random. Otherwise, the seed is used to generate | ||
25 | them. If the given seed does not yield a prime q, a new random | ||
26 | seed is chosen and placed at B<seed>. | ||
27 | |||
28 | DSA_generate_parameters() places the iteration count in | ||
29 | *B<counter_ret> and a counter used for finding a generator in | ||
30 | *B<h_ret>, unless these are B<NULL>. | ||
31 | |||
32 | A callback function may be used to provide feedback about the progress | ||
33 | of the key generation. If B<callback> is not B<NULL>, it will be | ||
34 | called as follows: | ||
35 | |||
36 | =over 4 | ||
37 | |||
38 | =item * | ||
39 | |||
40 | When a candidate for q is generated, B<callback(0, m++, cb_arg)> is called | ||
41 | (m is 0 for the first candidate). | ||
42 | |||
43 | =item * | ||
44 | |||
45 | When a candidate for q has passed a test by trial division, | ||
46 | B<callback(1, -1, cb_arg)> is called. | ||
47 | While a candidate for q is tested by Miller-Rabin primality tests, | ||
48 | B<callback(1, i, cb_arg)> is called in the outer loop | ||
49 | (once for each witness that confirms that the candidate may be prime); | ||
50 | i is the loop counter (starting at 0). | ||
51 | |||
52 | =item * | ||
53 | |||
54 | When a prime q has been found, B<callback(2, 0, cb_arg)> and | ||
55 | B<callback(3, 0, cb_arg)> are called. | ||
56 | |||
57 | =item * | ||
58 | |||
59 | Before a candidate for p (other than the first) is generated and tested, | ||
60 | B<callback(0, counter, cb_arg)> is called. | ||
61 | |||
62 | =item * | ||
63 | |||
64 | When a candidate for p has passed the test by trial division, | ||
65 | B<callback(1, -1, cb_arg)> is called. | ||
66 | While it is tested by the Miller-Rabin primality test, | ||
67 | B<callback(1, i, cb_arg)> is called in the outer loop | ||
68 | (once for each witness that confirms that the candidate may be prime). | ||
69 | i is the loop counter (starting at 0). | ||
70 | |||
71 | =item * | ||
72 | |||
73 | When p has been found, B<callback(2, 1, cb_arg)> is called. | ||
74 | |||
75 | =item * | ||
76 | |||
77 | When the generator has been found, B<callback(3, 1, cb_arg)> is called. | ||
78 | |||
79 | =back | ||
80 | |||
81 | =head1 RETURN VALUE | ||
82 | |||
83 | DSA_generate_parameters() returns a pointer to the DSA structure, or | ||
84 | B<NULL> if the parameter generation fails. The error codes can be | ||
85 | obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
86 | |||
87 | =head1 BUGS | ||
88 | |||
89 | Seed lengths E<gt> 20 are not supported. | ||
90 | |||
91 | =head1 SEE ALSO | ||
92 | |||
93 | L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, | ||
94 | L<DSA_free(3)|DSA_free(3)> | ||
95 | |||
96 | =head1 HISTORY | ||
97 | |||
98 | DSA_generate_parameters() appeared in SSLeay 0.8. The B<cb_arg> | ||
99 | argument was added in SSLeay 0.9.0. | ||
100 | In versions up to OpenSSL 0.9.4, B<callback(1, ...)> was called | ||
101 | in the inner loop of the Miller-Rabin test whenever it reached the | ||
102 | squaring step (the parameters to B<callback> did not reveal how many | ||
103 | witnesses had been tested); since OpenSSL 0.9.5, B<callback(1, ...)> | ||
104 | is called as in BN_is_prime(3), i.e. once for each witness. | ||
105 | =cut | ||
diff --git a/src/lib/libcrypto/doc/DSA_get_ex_new_index.pod b/src/lib/libcrypto/doc/DSA_get_ex_new_index.pod deleted file mode 100644 index 4612e708ec..0000000000 --- a/src/lib/libcrypto/doc/DSA_get_ex_new_index.pod +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DSA_get_ex_new_index, DSA_set_ex_data, DSA_get_ex_data - add application specific data to DSA structures | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/DSA.h> | ||
10 | |||
11 | int DSA_get_ex_new_index(long argl, void *argp, | ||
12 | CRYPTO_EX_new *new_func, | ||
13 | CRYPTO_EX_dup *dup_func, | ||
14 | CRYPTO_EX_free *free_func); | ||
15 | |||
16 | int DSA_set_ex_data(DSA *d, int idx, void *arg); | ||
17 | |||
18 | char *DSA_get_ex_data(DSA *d, int idx); | ||
19 | |||
20 | =head1 DESCRIPTION | ||
21 | |||
22 | These functions handle application specific data in DSA | ||
23 | structures. Their usage is identical to that of | ||
24 | RSA_get_ex_new_index(), RSA_set_ex_data() and RSA_get_ex_data() | ||
25 | as described in L<RSA_get_ex_new_index(3)>. | ||
26 | |||
27 | =head1 SEE ALSO | ||
28 | |||
29 | L<RSA_get_ex_new_index(3)|RSA_get_ex_new_index(3)>, L<dsa(3)|dsa(3)> | ||
30 | |||
31 | =head1 HISTORY | ||
32 | |||
33 | DSA_get_ex_new_index(), DSA_set_ex_data() and DSA_get_ex_data() are | ||
34 | available since OpenSSL 0.9.5. | ||
35 | |||
36 | =cut | ||
diff --git a/src/lib/libcrypto/doc/DSA_new.pod b/src/lib/libcrypto/doc/DSA_new.pod deleted file mode 100644 index 48e9b82a09..0000000000 --- a/src/lib/libcrypto/doc/DSA_new.pod +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DSA_new, DSA_free - allocate and free DSA objects | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/dsa.h> | ||
10 | |||
11 | DSA* DSA_new(void); | ||
12 | |||
13 | void DSA_free(DSA *dsa); | ||
14 | |||
15 | =head1 DESCRIPTION | ||
16 | |||
17 | DSA_new() allocates and initializes a B<DSA> structure. It is equivalent to | ||
18 | calling DSA_new_method(NULL). | ||
19 | |||
20 | DSA_free() frees the B<DSA> structure and its components. The values are | ||
21 | erased before the memory is returned to the system. | ||
22 | |||
23 | =head1 RETURN VALUES | ||
24 | |||
25 | If the allocation fails, DSA_new() returns B<NULL> and sets an error | ||
26 | code that can be obtained by | ||
27 | L<ERR_get_error(3)|ERR_get_error(3)>. Otherwise it returns a pointer | ||
28 | to the newly allocated structure. | ||
29 | |||
30 | DSA_free() returns no value. | ||
31 | |||
32 | =head1 SEE ALSO | ||
33 | |||
34 | L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, | ||
35 | L<DSA_generate_parameters(3)|DSA_generate_parameters(3)>, | ||
36 | L<DSA_generate_key(3)|DSA_generate_key(3)> | ||
37 | |||
38 | =head1 HISTORY | ||
39 | |||
40 | DSA_new() and DSA_free() are available in all versions of SSLeay and OpenSSL. | ||
41 | |||
42 | =cut | ||
diff --git a/src/lib/libcrypto/doc/DSA_set_method.pod b/src/lib/libcrypto/doc/DSA_set_method.pod deleted file mode 100644 index bc3cfb1f0a..0000000000 --- a/src/lib/libcrypto/doc/DSA_set_method.pod +++ /dev/null | |||
@@ -1,143 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DSA_set_default_method, DSA_get_default_method, | ||
6 | DSA_set_method, DSA_new_method, DSA_OpenSSL - select DSA method | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/dsa.h> | ||
11 | #include <openssl/engine.h> | ||
12 | |||
13 | void DSA_set_default_method(const DSA_METHOD *meth); | ||
14 | |||
15 | const DSA_METHOD *DSA_get_default_method(void); | ||
16 | |||
17 | int DSA_set_method(DSA *dsa, const DSA_METHOD *meth); | ||
18 | |||
19 | DSA *DSA_new_method(ENGINE *engine); | ||
20 | |||
21 | DSA_METHOD *DSA_OpenSSL(void); | ||
22 | |||
23 | =head1 DESCRIPTION | ||
24 | |||
25 | A B<DSA_METHOD> specifies the functions that OpenSSL uses for DSA | ||
26 | operations. By modifying the method, alternative implementations | ||
27 | such as hardware accelerators may be used. IMPORTANT: See the NOTES section for | ||
28 | important information about how these DSA API functions are affected by the use | ||
29 | of B<ENGINE> API calls. | ||
30 | |||
31 | Initially, the default DSA_METHOD is the OpenSSL internal implementation, | ||
32 | as returned by DSA_OpenSSL(). | ||
33 | |||
34 | DSA_set_default_method() makes B<meth> the default method for all DSA | ||
35 | structures created later. B<NB>: This is true only whilst no ENGINE has | ||
36 | been set as a default for DSA, so this function is no longer recommended. | ||
37 | |||
38 | DSA_get_default_method() returns a pointer to the current default | ||
39 | DSA_METHOD. However, the meaningfulness of this result is dependant on | ||
40 | whether the ENGINE API is being used, so this function is no longer | ||
41 | recommended. | ||
42 | |||
43 | DSA_set_method() selects B<meth> to perform all operations using the key | ||
44 | B<rsa>. This will replace the DSA_METHOD used by the DSA key and if the | ||
45 | previous method was supplied by an ENGINE, the handle to that ENGINE will | ||
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. | ||
56 | |||
57 | =head1 THE DSA_METHOD STRUCTURE | ||
58 | |||
59 | struct | ||
60 | { | ||
61 | /* name of the implementation */ | ||
62 | const char *name; | ||
63 | |||
64 | /* sign */ | ||
65 | DSA_SIG *(*dsa_do_sign)(const unsigned char *dgst, int dlen, | ||
66 | DSA *dsa); | ||
67 | |||
68 | /* pre-compute k^-1 and r */ | ||
69 | int (*dsa_sign_setup)(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, | ||
70 | BIGNUM **rp); | ||
71 | |||
72 | /* verify */ | ||
73 | int (*dsa_do_verify)(const unsigned char *dgst, int dgst_len, | ||
74 | DSA_SIG *sig, DSA *dsa); | ||
75 | |||
76 | /* compute rr = a1^p1 * a2^p2 mod m (May be NULL for some | ||
77 | implementations) */ | ||
78 | int (*dsa_mod_exp)(DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, | ||
79 | BIGNUM *a2, BIGNUM *p2, BIGNUM *m, | ||
80 | BN_CTX *ctx, BN_MONT_CTX *in_mont); | ||
81 | |||
82 | /* compute r = a ^ p mod m (May be NULL for some implementations) */ | ||
83 | int (*bn_mod_exp)(DSA *dsa, BIGNUM *r, BIGNUM *a, | ||
84 | const BIGNUM *p, const BIGNUM *m, | ||
85 | BN_CTX *ctx, BN_MONT_CTX *m_ctx); | ||
86 | |||
87 | /* called at DSA_new */ | ||
88 | int (*init)(DSA *DSA); | ||
89 | |||
90 | /* called at DSA_free */ | ||
91 | int (*finish)(DSA *DSA); | ||
92 | |||
93 | int flags; | ||
94 | |||
95 | char *app_data; /* ?? */ | ||
96 | |||
97 | } DSA_METHOD; | ||
98 | |||
99 | =head1 RETURN VALUES | ||
100 | |||
101 | DSA_OpenSSL() and DSA_get_default_method() return pointers to the respective | ||
102 | B<DSA_METHOD>s. | ||
103 | |||
104 | DSA_set_default_method() returns no value. | ||
105 | |||
106 | DSA_set_method() returns non-zero if the provided B<meth> was successfully set as | ||
107 | the method for B<dsa> (including unloading the ENGINE handle if the previous | ||
108 | method was supplied by an ENGINE). | ||
109 | |||
110 | DSA_new_method() returns NULL and sets an error code that can be | ||
111 | obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation | ||
112 | fails. Otherwise it returns a pointer to the newly allocated structure. | ||
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 | |||
124 | =head1 SEE ALSO | ||
125 | |||
126 | L<dsa(3)|dsa(3)>, L<DSA_new(3)|DSA_new(3)> | ||
127 | |||
128 | =head1 HISTORY | ||
129 | |||
130 | DSA_set_default_method(), DSA_get_default_method(), DSA_set_method(), | ||
131 | DSA_new_method() and DSA_OpenSSL() were added in OpenSSL 0.9.4. | ||
132 | |||
133 | DSA_set_default_openssl_method() and DSA_get_default_openssl_method() replaced | ||
134 | DSA_set_default_method() and DSA_get_default_method() respectively, and | ||
135 | DSA_set_method() and DSA_new_method() were altered to use B<ENGINE>s rather than | ||
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. | ||
142 | |||
143 | =cut | ||
diff --git a/src/lib/libcrypto/doc/DSA_sign.pod b/src/lib/libcrypto/doc/DSA_sign.pod deleted file mode 100644 index 97389e8ec8..0000000000 --- a/src/lib/libcrypto/doc/DSA_sign.pod +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DSA_sign, DSA_sign_setup, DSA_verify - DSA signatures | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/dsa.h> | ||
10 | |||
11 | int DSA_sign(int type, const unsigned char *dgst, int len, | ||
12 | unsigned char *sigret, unsigned int *siglen, DSA *dsa); | ||
13 | |||
14 | int DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp, | ||
15 | BIGNUM **rp); | ||
16 | |||
17 | int DSA_verify(int type, const unsigned char *dgst, int len, | ||
18 | unsigned char *sigbuf, int siglen, DSA *dsa); | ||
19 | |||
20 | =head1 DESCRIPTION | ||
21 | |||
22 | DSA_sign() computes a digital signature on the B<len> byte message | ||
23 | digest B<dgst> using the private key B<dsa> and places its ASN.1 DER | ||
24 | encoding at B<sigret>. The length of the signature is places in | ||
25 | *B<siglen>. B<sigret> must point to DSA_size(B<dsa>) bytes of memory. | ||
26 | |||
27 | DSA_sign_setup() may be used to precompute part of the signing | ||
28 | operation in case signature generation is time-critical. It expects | ||
29 | B<dsa> to contain DSA parameters. It places the precomputed values | ||
30 | in newly allocated B<BIGNUM>s at *B<kinvp> and *B<rp>, after freeing | ||
31 | the old ones unless *B<kinvp> and *B<rp> are NULL. These values may | ||
32 | be passed to DSA_sign() in B<dsa-E<gt>kinv> and B<dsa-E<gt>r>. | ||
33 | B<ctx> is a pre-allocated B<BN_CTX> or NULL. | ||
34 | |||
35 | DSA_verify() verifies that the signature B<sigbuf> of size B<siglen> | ||
36 | matches a given message digest B<dgst> of size B<len>. | ||
37 | B<dsa> is the signer's public key. | ||
38 | |||
39 | The B<type> parameter is ignored. | ||
40 | |||
41 | The PRNG must be seeded before DSA_sign() (or DSA_sign_setup()) | ||
42 | is called. | ||
43 | |||
44 | =head1 RETURN VALUES | ||
45 | |||
46 | DSA_sign() and DSA_sign_setup() return 1 on success, 0 on error. | ||
47 | DSA_verify() returns 1 for a valid signature, 0 for an incorrect | ||
48 | signature and -1 on error. The error codes can be obtained by | ||
49 | L<ERR_get_error(3)|ERR_get_error(3)>. | ||
50 | |||
51 | =head1 CONFORMING TO | ||
52 | |||
53 | US Federal Information Processing Standard FIPS 186 (Digital Signature | ||
54 | Standard, DSS), ANSI X9.30 | ||
55 | |||
56 | =head1 SEE ALSO | ||
57 | |||
58 | L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, | ||
59 | L<DSA_do_sign(3)|DSA_do_sign(3)> | ||
60 | |||
61 | =head1 HISTORY | ||
62 | |||
63 | DSA_sign() and DSA_verify() are available in all versions of SSLeay. | ||
64 | DSA_sign_setup() was added in SSLeay 0.8. | ||
65 | |||
66 | =cut | ||
diff --git a/src/lib/libcrypto/doc/DSA_size.pod b/src/lib/libcrypto/doc/DSA_size.pod deleted file mode 100644 index ba4f650361..0000000000 --- a/src/lib/libcrypto/doc/DSA_size.pod +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DSA_size - get DSA signature size | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/dsa.h> | ||
10 | |||
11 | int DSA_size(const DSA *dsa); | ||
12 | |||
13 | =head1 DESCRIPTION | ||
14 | |||
15 | This function returns the size of an ASN.1 encoded DSA signature in | ||
16 | bytes. It can be used to determine how much memory must be allocated | ||
17 | for a DSA signature. | ||
18 | |||
19 | B<dsa-E<gt>q> must not be B<NULL>. | ||
20 | |||
21 | =head1 RETURN VALUE | ||
22 | |||
23 | The size in bytes. | ||
24 | |||
25 | =head1 SEE ALSO | ||
26 | |||
27 | L<dsa(3)|dsa(3)>, L<DSA_sign(3)|DSA_sign(3)> | ||
28 | |||
29 | =head1 HISTORY | ||
30 | |||
31 | DSA_size() is available in all versions of SSLeay and OpenSSL. | ||
32 | |||
33 | =cut | ||
diff --git a/src/lib/libcrypto/doc/ERR_GET_LIB.pod b/src/lib/libcrypto/doc/ERR_GET_LIB.pod deleted file mode 100644 index 2a129da036..0000000000 --- a/src/lib/libcrypto/doc/ERR_GET_LIB.pod +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | ERR_GET_LIB, ERR_GET_FUNC, ERR_GET_REASON - get library, function and | ||
6 | reason code | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/err.h> | ||
11 | |||
12 | int ERR_GET_LIB(unsigned long e); | ||
13 | |||
14 | int ERR_GET_FUNC(unsigned long e); | ||
15 | |||
16 | int ERR_GET_REASON(unsigned long e); | ||
17 | |||
18 | =head1 DESCRIPTION | ||
19 | |||
20 | The error code returned by ERR_get_error() consists of a library | ||
21 | number, function code and reason code. ERR_GET_LIB(), ERR_GET_FUNC() | ||
22 | and ERR_GET_REASON() can be used to extract these. | ||
23 | |||
24 | The library number and function code describe where the error | ||
25 | occurred, the reason code is the information about what went wrong. | ||
26 | |||
27 | Each sub-library of OpenSSL has a unique library number; function and | ||
28 | reason codes are unique within each sub-library. Note that different | ||
29 | libraries may use the same value to signal different functions and | ||
30 | reasons. | ||
31 | |||
32 | B<ERR_R_...> reason codes such as B<ERR_R_MALLOC_FAILURE> are globally | ||
33 | unique. However, when checking for sub-library specific reason codes, | ||
34 | be sure to also compare the library number. | ||
35 | |||
36 | ERR_GET_LIB(), ERR_GET_FUNC() and ERR_GET_REASON() are macros. | ||
37 | |||
38 | =head1 RETURN VALUES | ||
39 | |||
40 | The library number, function code and reason code respectively. | ||
41 | |||
42 | =head1 SEE ALSO | ||
43 | |||
44 | L<err(3)|err(3)>, L<ERR_get_error(3)|ERR_get_error(3)> | ||
45 | |||
46 | =head1 HISTORY | ||
47 | |||
48 | ERR_GET_LIB(), ERR_GET_FUNC() and ERR_GET_REASON() are available in | ||
49 | all versions of SSLeay and OpenSSL. | ||
50 | |||
51 | =cut | ||
diff --git a/src/lib/libcrypto/doc/ERR_clear_error.pod b/src/lib/libcrypto/doc/ERR_clear_error.pod deleted file mode 100644 index 566e1f4e31..0000000000 --- a/src/lib/libcrypto/doc/ERR_clear_error.pod +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | ERR_clear_error - clear the error queue | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/err.h> | ||
10 | |||
11 | void ERR_clear_error(void); | ||
12 | |||
13 | =head1 DESCRIPTION | ||
14 | |||
15 | ERR_clear_error() empties the current thread's error queue. | ||
16 | |||
17 | =head1 RETURN VALUES | ||
18 | |||
19 | ERR_clear_error() has no return value. | ||
20 | |||
21 | =head1 SEE ALSO | ||
22 | |||
23 | L<err(3)|err(3)>, L<ERR_get_error(3)|ERR_get_error(3)> | ||
24 | |||
25 | =head1 HISTORY | ||
26 | |||
27 | ERR_clear_error() is available in all versions of SSLeay and OpenSSL. | ||
28 | |||
29 | =cut | ||
diff --git a/src/lib/libcrypto/doc/ERR_error_string.pod b/src/lib/libcrypto/doc/ERR_error_string.pod deleted file mode 100644 index cdfa7fe1fe..0000000000 --- a/src/lib/libcrypto/doc/ERR_error_string.pod +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | ERR_error_string, ERR_error_string_n, ERR_lib_error_string, | ||
6 | ERR_func_error_string, ERR_reason_error_string - obtain human-readable | ||
7 | error message | ||
8 | |||
9 | =head1 SYNOPSIS | ||
10 | |||
11 | #include <openssl/err.h> | ||
12 | |||
13 | char *ERR_error_string(unsigned long e, char *buf); | ||
14 | void ERR_error_string_n(unsigned long e, char *buf, size_t len); | ||
15 | |||
16 | const char *ERR_lib_error_string(unsigned long e); | ||
17 | const char *ERR_func_error_string(unsigned long e); | ||
18 | const char *ERR_reason_error_string(unsigned long e); | ||
19 | |||
20 | =head1 DESCRIPTION | ||
21 | |||
22 | ERR_error_string() generates a human-readable string representing the | ||
23 | error code I<e>, and places it at I<buf>. I<buf> must be at least 120 | ||
24 | bytes long. If I<buf> is B<NULL>, the error string is placed in a | ||
25 | static buffer. | ||
26 | ERR_error_string_n() is a variant of ERR_error_string() that writes | ||
27 | at most I<len> characters (including the terminating 0) | ||
28 | and truncates the string if necessary. | ||
29 | For ERR_error_string_n(), I<buf> may not be B<NULL>. | ||
30 | |||
31 | The string will have the following format: | ||
32 | |||
33 | error:[error code]:[library name]:[function name]:[reason string] | ||
34 | |||
35 | I<error code> is an 8 digit hexadecimal number, I<library name>, | ||
36 | I<function name> and I<reason string> are ASCII text. | ||
37 | |||
38 | ERR_lib_error_string(), ERR_func_error_string() and | ||
39 | ERR_reason_error_string() return the library name, function | ||
40 | name and reason string respectively. | ||
41 | |||
42 | The OpenSSL error strings should be loaded by calling | ||
43 | L<ERR_load_crypto_strings(3)|ERR_load_crypto_strings(3)> or, for SSL | ||
44 | applications, L<SSL_load_error_strings(3)|SSL_load_error_strings(3)> | ||
45 | first. | ||
46 | If there is no text string registered for the given error code, | ||
47 | the error string will contain the numeric code. | ||
48 | |||
49 | L<ERR_print_errors(3)|ERR_print_errors(3)> can be used to print | ||
50 | all error codes currently in the queue. | ||
51 | |||
52 | =head1 RETURN VALUES | ||
53 | |||
54 | ERR_error_string() returns a pointer to a static buffer containing the | ||
55 | string if I<buf> B<== NULL>, I<buf> otherwise. | ||
56 | |||
57 | ERR_lib_error_string(), ERR_func_error_string() and | ||
58 | ERR_reason_error_string() return the strings, and B<NULL> if | ||
59 | none is registered for the error code. | ||
60 | |||
61 | =head1 SEE ALSO | ||
62 | |||
63 | L<err(3)|err(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, | ||
64 | L<ERR_load_crypto_strings(3)|ERR_load_crypto_strings(3)>, | ||
65 | L<SSL_load_error_strings(3)|SSL_load_error_strings(3)> | ||
66 | L<ERR_print_errors(3)|ERR_print_errors(3)> | ||
67 | |||
68 | =head1 HISTORY | ||
69 | |||
70 | ERR_error_string() is available in all versions of SSLeay and OpenSSL. | ||
71 | ERR_error_string_n() was added in OpenSSL 0.9.6. | ||
72 | |||
73 | =cut | ||
diff --git a/src/lib/libcrypto/doc/ERR_get_error.pod b/src/lib/libcrypto/doc/ERR_get_error.pod deleted file mode 100644 index 34443045fc..0000000000 --- a/src/lib/libcrypto/doc/ERR_get_error.pod +++ /dev/null | |||
@@ -1,76 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | ERR_get_error, ERR_peek_error, ERR_peek_last_error, | ||
6 | ERR_get_error_line, ERR_peek_error_line, ERR_peek_last_error_line, | ||
7 | ERR_get_error_line_data, ERR_peek_error_line_data, | ||
8 | ERR_peek_last_error_line_data - obtain error code and data | ||
9 | |||
10 | =head1 SYNOPSIS | ||
11 | |||
12 | #include <openssl/err.h> | ||
13 | |||
14 | unsigned long ERR_get_error(void); | ||
15 | unsigned long ERR_peek_error(void); | ||
16 | unsigned long ERR_peek_last_error(void); | ||
17 | |||
18 | unsigned long ERR_get_error_line(const char **file, int *line); | ||
19 | unsigned long ERR_peek_error_line(const char **file, int *line); | ||
20 | unsigned long ERR_peek_last_error_line(const char **file, int *line); | ||
21 | |||
22 | unsigned long ERR_get_error_line_data(const char **file, int *line, | ||
23 | const char **data, int *flags); | ||
24 | unsigned long ERR_peek_error_line_data(const char **file, int *line, | ||
25 | const char **data, int *flags); | ||
26 | unsigned long ERR_peek_last_error_line_data(const char **file, int *line, | ||
27 | const char **data, int *flags); | ||
28 | |||
29 | =head1 DESCRIPTION | ||
30 | |||
31 | ERR_get_error() returns the earliest error code from the thread's error | ||
32 | queue and removes the entry. This function can be called repeatedly | ||
33 | until there are no more error codes to return. | ||
34 | |||
35 | ERR_peek_error() returns the earliest error code from the thread's | ||
36 | error queue without modifying it. | ||
37 | |||
38 | ERR_peek_last_error() returns the latest error code from the thread's | ||
39 | error queue without modifying it. | ||
40 | |||
41 | See L<ERR_GET_LIB(3)|ERR_GET_LIB(3)> for obtaining information about | ||
42 | location and reason of the error, and | ||
43 | L<ERR_error_string(3)|ERR_error_string(3)> for human-readable error | ||
44 | messages. | ||
45 | |||
46 | ERR_get_error_line(), ERR_peek_error_line() and | ||
47 | ERR_peek_last_error_line() are the same as the above, but they | ||
48 | additionally store the file name and line number where | ||
49 | the error occurred in *B<file> and *B<line>, unless these are B<NULL>. | ||
50 | |||
51 | ERR_get_error_line_data(), ERR_peek_error_line_data() and | ||
52 | ERR_get_last_error_line_data() store additional data and flags | ||
53 | associated with the error code in *B<data> | ||
54 | and *B<flags>, unless these are B<NULL>. *B<data> contains a string | ||
55 | if *B<flags>&B<ERR_TXT_STRING>. If it has been allocated by OPENSSL_malloc(), | ||
56 | *B<flags>&B<ERR_TXT_MALLOCED> is true. | ||
57 | |||
58 | =head1 RETURN VALUES | ||
59 | |||
60 | The error code, or 0 if there is no error in the queue. | ||
61 | |||
62 | =head1 SEE ALSO | ||
63 | |||
64 | L<err(3)|err(3)>, L<ERR_error_string(3)|ERR_error_string(3)>, | ||
65 | L<ERR_GET_LIB(3)|ERR_GET_LIB(3)> | ||
66 | |||
67 | =head1 HISTORY | ||
68 | |||
69 | ERR_get_error(), ERR_peek_error(), ERR_get_error_line() and | ||
70 | ERR_peek_error_line() are available in all versions of SSLeay and | ||
71 | OpenSSL. ERR_get_error_line_data() and ERR_peek_error_line_data() | ||
72 | were added in SSLeay 0.9.0. | ||
73 | ERR_peek_last_error(), ERR_peek_last_error_line() and | ||
74 | ERR_peek_last_error_line_data() were added in OpenSSL 0.9.7. | ||
75 | |||
76 | =cut | ||
diff --git a/src/lib/libcrypto/doc/ERR_load_crypto_strings.pod b/src/lib/libcrypto/doc/ERR_load_crypto_strings.pod deleted file mode 100644 index 9bdec75a46..0000000000 --- a/src/lib/libcrypto/doc/ERR_load_crypto_strings.pod +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | ERR_load_crypto_strings, SSL_load_error_strings, ERR_free_strings - | ||
6 | load and free error strings | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/err.h> | ||
11 | |||
12 | void ERR_load_crypto_strings(void); | ||
13 | void ERR_free_strings(void); | ||
14 | |||
15 | #include <openssl/ssl.h> | ||
16 | |||
17 | void SSL_load_error_strings(void); | ||
18 | |||
19 | =head1 DESCRIPTION | ||
20 | |||
21 | ERR_load_crypto_strings() registers the error strings for all | ||
22 | B<libcrypto> functions. SSL_load_error_strings() does the same, | ||
23 | but also registers the B<libssl> error strings. | ||
24 | |||
25 | One of these functions should be called before generating | ||
26 | textual error messages. However, this is not required when memory | ||
27 | usage is an issue. | ||
28 | |||
29 | ERR_free_strings() frees all previously loaded error strings. | ||
30 | |||
31 | =head1 RETURN VALUES | ||
32 | |||
33 | ERR_load_crypto_strings(), SSL_load_error_strings() and | ||
34 | ERR_free_strings() return no values. | ||
35 | |||
36 | =head1 SEE ALSO | ||
37 | |||
38 | L<err(3)|err(3)>, L<ERR_error_string(3)|ERR_error_string(3)> | ||
39 | |||
40 | =head1 HISTORY | ||
41 | |||
42 | ERR_load_error_strings(), SSL_load_error_strings() and | ||
43 | ERR_free_strings() are available in all versions of SSLeay and | ||
44 | OpenSSL. | ||
45 | |||
46 | =cut | ||
diff --git a/src/lib/libcrypto/doc/ERR_load_strings.pod b/src/lib/libcrypto/doc/ERR_load_strings.pod deleted file mode 100644 index 5acdd0edbc..0000000000 --- a/src/lib/libcrypto/doc/ERR_load_strings.pod +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | ERR_load_strings, ERR_PACK, ERR_get_next_error_library - load | ||
6 | arbitrary error strings | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/err.h> | ||
11 | |||
12 | void ERR_load_strings(int lib, ERR_STRING_DATA str[]); | ||
13 | |||
14 | int ERR_get_next_error_library(void); | ||
15 | |||
16 | unsigned long ERR_PACK(int lib, int func, int reason); | ||
17 | |||
18 | =head1 DESCRIPTION | ||
19 | |||
20 | ERR_load_strings() registers error strings for library number B<lib>. | ||
21 | |||
22 | B<str> is an array of error string data: | ||
23 | |||
24 | typedef struct ERR_string_data_st | ||
25 | { | ||
26 | unsigned long error; | ||
27 | char *string; | ||
28 | } ERR_STRING_DATA; | ||
29 | |||
30 | The error code is generated from the library number and a function and | ||
31 | reason code: B<error> = ERR_PACK(B<lib>, B<func>, B<reason>). | ||
32 | ERR_PACK() is a macro. | ||
33 | |||
34 | The last entry in the array is {0,0}. | ||
35 | |||
36 | ERR_get_next_error_library() can be used to assign library numbers | ||
37 | to user libraries at runtime. | ||
38 | |||
39 | =head1 RETURN VALUE | ||
40 | |||
41 | ERR_load_strings() returns no value. ERR_PACK() return the error code. | ||
42 | ERR_get_next_error_library() returns a new library number. | ||
43 | |||
44 | =head1 SEE ALSO | ||
45 | |||
46 | L<err(3)|err(3)>, L<ERR_load_strings(3)|ERR_load_strings(3)> | ||
47 | |||
48 | =head1 HISTORY | ||
49 | |||
50 | ERR_load_error_strings() and ERR_PACK() are available in all versions | ||
51 | of SSLeay and OpenSSL. ERR_get_next_error_library() was added in | ||
52 | SSLeay 0.9.0. | ||
53 | |||
54 | =cut | ||
diff --git a/src/lib/libcrypto/doc/ERR_print_errors.pod b/src/lib/libcrypto/doc/ERR_print_errors.pod deleted file mode 100644 index b100a5fa2b..0000000000 --- a/src/lib/libcrypto/doc/ERR_print_errors.pod +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | ERR_print_errors, ERR_print_errors_fp - print error messages | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/err.h> | ||
10 | |||
11 | void ERR_print_errors(BIO *bp); | ||
12 | void ERR_print_errors_fp(FILE *fp); | ||
13 | |||
14 | =head1 DESCRIPTION | ||
15 | |||
16 | ERR_print_errors() is a convenience function that prints the error | ||
17 | strings for all errors that OpenSSL has recorded to B<bp>, thus | ||
18 | emptying the error queue. | ||
19 | |||
20 | ERR_print_errors_fp() is the same, except that the output goes to a | ||
21 | B<FILE>. | ||
22 | |||
23 | |||
24 | The error strings will have the following format: | ||
25 | |||
26 | [pid]:error:[error code]:[library name]:[function name]:[reason string]:[file name]:[line]:[optional text message] | ||
27 | |||
28 | I<error code> is an 8 digit hexadecimal number. I<library name>, | ||
29 | I<function name> and I<reason string> are ASCII text, as is I<optional | ||
30 | text message> if one was set for the respective error code. | ||
31 | |||
32 | If there is no text string registered for the given error code, | ||
33 | the error string will contain the numeric code. | ||
34 | |||
35 | =head1 RETURN VALUES | ||
36 | |||
37 | ERR_print_errors() and ERR_print_errors_fp() return no values. | ||
38 | |||
39 | =head1 SEE ALSO | ||
40 | |||
41 | L<err(3)|err(3)>, L<ERR_error_string(3)|ERR_error_string(3)>, | ||
42 | L<ERR_get_error(3)|ERR_get_error(3)>, | ||
43 | L<ERR_load_crypto_strings(3)|ERR_load_crypto_strings(3)>, | ||
44 | L<SSL_load_error_strings(3)|SSL_load_error_strings(3)> | ||
45 | |||
46 | =head1 HISTORY | ||
47 | |||
48 | ERR_print_errors() and ERR_print_errors_fp() | ||
49 | are available in all versions of SSLeay and OpenSSL. | ||
50 | |||
51 | =cut | ||
diff --git a/src/lib/libcrypto/doc/ERR_put_error.pod b/src/lib/libcrypto/doc/ERR_put_error.pod deleted file mode 100644 index acd241fbe4..0000000000 --- a/src/lib/libcrypto/doc/ERR_put_error.pod +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | ERR_put_error, ERR_add_error_data - record an error | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/err.h> | ||
10 | |||
11 | void ERR_put_error(int lib, int func, int reason, const char *file, | ||
12 | int line); | ||
13 | |||
14 | void ERR_add_error_data(int num, ...); | ||
15 | |||
16 | =head1 DESCRIPTION | ||
17 | |||
18 | ERR_put_error() adds an error code to the thread's error queue. It | ||
19 | signals that the error of reason code B<reason> occurred in function | ||
20 | B<func> of library B<lib>, in line number B<line> of B<file>. | ||
21 | This function is usually called by a macro. | ||
22 | |||
23 | ERR_add_error_data() associates the concatenation of its B<num> string | ||
24 | arguments with the error code added last. | ||
25 | |||
26 | L<ERR_load_strings(3)|ERR_load_strings(3)> can be used to register | ||
27 | error strings so that the application can a generate human-readable | ||
28 | error messages for the error code. | ||
29 | |||
30 | =head1 RETURN VALUES | ||
31 | |||
32 | ERR_put_error() and ERR_add_error_data() return | ||
33 | no values. | ||
34 | |||
35 | =head1 SEE ALSO | ||
36 | |||
37 | L<err(3)|err(3)>, L<ERR_load_strings(3)|ERR_load_strings(3)> | ||
38 | |||
39 | =head1 HISTORY | ||
40 | |||
41 | ERR_put_error() is available in all versions of SSLeay and OpenSSL. | ||
42 | ERR_add_error_data() was added in SSLeay 0.9.0. | ||
43 | |||
44 | =cut | ||
diff --git a/src/lib/libcrypto/doc/ERR_remove_state.pod b/src/lib/libcrypto/doc/ERR_remove_state.pod deleted file mode 100644 index 72925fb9f4..0000000000 --- a/src/lib/libcrypto/doc/ERR_remove_state.pod +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | ERR_remove_state - free a thread's error queue | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/err.h> | ||
10 | |||
11 | void ERR_remove_state(unsigned long pid); | ||
12 | |||
13 | =head1 DESCRIPTION | ||
14 | |||
15 | ERR_remove_state() frees the error queue associated with thread B<pid>. | ||
16 | If B<pid> == 0, the current thread will have its error queue removed. | ||
17 | |||
18 | Since error queue data structures are allocated automatically for new | ||
19 | threads, they must be freed when threads are terminated in order to | ||
20 | avoid memory leaks. | ||
21 | |||
22 | =head1 RETURN VALUE | ||
23 | |||
24 | ERR_remove_state() returns no value. | ||
25 | |||
26 | =head1 SEE ALSO | ||
27 | |||
28 | L<err(3)|err(3)> | ||
29 | |||
30 | =head1 HISTORY | ||
31 | |||
32 | ERR_remove_state() is available in all versions of SSLeay and OpenSSL. | ||
33 | |||
34 | =cut | ||
diff --git a/src/lib/libcrypto/doc/EVP_BytesToKey.pod b/src/lib/libcrypto/doc/EVP_BytesToKey.pod deleted file mode 100644 index 016381f3e9..0000000000 --- a/src/lib/libcrypto/doc/EVP_BytesToKey.pod +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | EVP_BytesToKey - password based encryption routine | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/evp.h> | ||
10 | |||
11 | int EVP_BytesToKey(const EVP_CIPHER *type,const EVP_MD *md, | ||
12 | const unsigned char *salt, | ||
13 | const unsigned char *data, int datal, int count, | ||
14 | unsigned char *key,unsigned char *iv); | ||
15 | |||
16 | =head1 DESCRIPTION | ||
17 | |||
18 | EVP_BytesToKey() derives a key and IV from various parameters. B<type> is | ||
19 | the cipher to derive the key and IV for. B<md> is the message digest to use. | ||
20 | The B<salt> paramter is used as a salt in the derivation: it should point to | ||
21 | an 8 byte buffer or NULL if no salt is used. B<data> is a buffer containing | ||
22 | B<datal> bytes which is used to derive the keying data. B<count> is the | ||
23 | iteration count to use. The derived key and IV will be written to B<key> | ||
24 | and B<iv> respectively. | ||
25 | |||
26 | =head1 NOTES | ||
27 | |||
28 | A typical application of this function is to derive keying material for an | ||
29 | encryption algorithm from a password in the B<data> parameter. | ||
30 | |||
31 | Increasing the B<count> parameter slows down the algorithm which makes it | ||
32 | harder for an attacker to peform a brute force attack using a large number | ||
33 | of candidate passwords. | ||
34 | |||
35 | If the total key and IV length is less than the digest length and | ||
36 | B<MD5> is used then the derivation algorithm is compatible with PKCS#5 v1.5 | ||
37 | otherwise a non standard extension is used to derive the extra data. | ||
38 | |||
39 | Newer applications should use more standard algorithms such as PKCS#5 | ||
40 | v2.0 for key derivation. | ||
41 | |||
42 | =head1 KEY DERIVATION ALGORITHM | ||
43 | |||
44 | The key and IV is derived by concatenating D_1, D_2, etc until | ||
45 | enough data is available for the key and IV. D_i is defined as: | ||
46 | |||
47 | D_i = HASH^count(D_(i-1) || data || salt) | ||
48 | |||
49 | where || denotes concatentaion, D_0 is empty, HASH is the digest | ||
50 | algorithm in use, HASH^1(data) is simply HASH(data), HASH^2(data) | ||
51 | is HASH(HASH(data)) and so on. | ||
52 | |||
53 | The initial bytes are used for the key and the subsequent bytes for | ||
54 | the IV. | ||
55 | |||
56 | =head1 RETURN VALUES | ||
57 | |||
58 | EVP_BytesToKey() returns the size of the derived key in bytes. | ||
59 | |||
60 | =head1 SEE ALSO | ||
61 | |||
62 | L<evp(3)|evp(3)>, L<rand(3)|rand(3)>, | ||
63 | L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>, | ||
64 | |||
65 | =head1 HISTORY | ||
66 | |||
67 | =cut | ||
diff --git a/src/lib/libcrypto/doc/EVP_DigestInit.pod b/src/lib/libcrypto/doc/EVP_DigestInit.pod deleted file mode 100644 index faa992286b..0000000000 --- a/src/lib/libcrypto/doc/EVP_DigestInit.pod +++ /dev/null | |||
@@ -1,256 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | EVP_MD_CTX_init, EVP_MD_CTX_create, EVP_DigestInit_ex, EVP_DigestUpdate, | ||
6 | EVP_DigestFinal_ex, EVP_MD_CTX_cleanup, EVP_MD_CTX_destroy, EVP_MAX_MD_SIZE, | ||
7 | EVP_MD_CTX_copy_ex, EVP_MD_CTX_copy, EVP_MD_type, EVP_MD_pkey_type, EVP_MD_size, | ||
8 | EVP_MD_block_size, EVP_MD_CTX_md, EVP_MD_CTX_size, EVP_MD_CTX_block_size, EVP_MD_CTX_type, | ||
9 | EVP_md_null, EVP_md2, EVP_md5, EVP_sha, EVP_sha1, EVP_dss, EVP_dss1, EVP_mdc2, | ||
10 | EVP_ripemd160, EVP_get_digestbyname, EVP_get_digestbynid, EVP_get_digestbyobj - | ||
11 | EVP digest routines | ||
12 | |||
13 | =head1 SYNOPSIS | ||
14 | |||
15 | #include <openssl/evp.h> | ||
16 | |||
17 | void EVP_MD_CTX_init(EVP_MD_CTX *ctx); | ||
18 | EVP_MD_CTX *EVP_MD_CTX_create(void); | ||
19 | |||
20 | int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); | ||
21 | int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt); | ||
22 | int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, | ||
23 | unsigned int *s); | ||
24 | |||
25 | int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx); | ||
26 | void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx); | ||
27 | |||
28 | int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out,const EVP_MD_CTX *in); | ||
29 | |||
30 | int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); | ||
31 | int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, | ||
32 | unsigned int *s); | ||
33 | |||
34 | int EVP_MD_CTX_copy(EVP_MD_CTX *out,EVP_MD_CTX *in); | ||
35 | |||
36 | #define EVP_MAX_MD_SIZE (16+20) /* The SSLv3 md5+sha1 type */ | ||
37 | |||
38 | |||
39 | #define EVP_MD_type(e) ((e)->type) | ||
40 | #define EVP_MD_pkey_type(e) ((e)->pkey_type) | ||
41 | #define EVP_MD_size(e) ((e)->md_size) | ||
42 | #define EVP_MD_block_size(e) ((e)->block_size) | ||
43 | |||
44 | #define EVP_MD_CTX_md(e) (e)->digest) | ||
45 | #define EVP_MD_CTX_size(e) EVP_MD_size((e)->digest) | ||
46 | #define EVP_MD_CTX_block_size(e) EVP_MD_block_size((e)->digest) | ||
47 | #define EVP_MD_CTX_type(e) EVP_MD_type((e)->digest) | ||
48 | |||
49 | const EVP_MD *EVP_md_null(void); | ||
50 | const EVP_MD *EVP_md2(void); | ||
51 | const EVP_MD *EVP_md5(void); | ||
52 | const EVP_MD *EVP_sha(void); | ||
53 | const EVP_MD *EVP_sha1(void); | ||
54 | const EVP_MD *EVP_dss(void); | ||
55 | const EVP_MD *EVP_dss1(void); | ||
56 | const EVP_MD *EVP_mdc2(void); | ||
57 | const EVP_MD *EVP_ripemd160(void); | ||
58 | |||
59 | const EVP_MD *EVP_get_digestbyname(const char *name); | ||
60 | #define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a)) | ||
61 | #define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a)) | ||
62 | |||
63 | =head1 DESCRIPTION | ||
64 | |||
65 | The EVP digest routines are a high level interface to message digests. | ||
66 | |||
67 | EVP_MD_CTX_init() initializes digest contet B<ctx>. | ||
68 | |||
69 | EVP_MD_CTX_create() allocates, initializes and returns a digest contet. | ||
70 | |||
71 | EVP_DigestInit_ex() sets up digest context B<ctx> to use a digest | ||
72 | B<type> from ENGINE B<impl>. B<ctx> must be initialized before calling this | ||
73 | function. B<type> will typically be supplied by a functionsuch as EVP_sha1(). | ||
74 | If B<impl> is NULL then the default implementation of digest B<type> is used. | ||
75 | |||
76 | EVP_DigestUpdate() hashes B<cnt> bytes of data at B<d> into the | ||
77 | digest context B<ctx>. This function can be called several times on the | ||
78 | same B<ctx> to hash additional data. | ||
79 | |||
80 | EVP_DigestFinal_ex() retrieves the digest value from B<ctx> and places | ||
81 | it in B<md>. If the B<s> parameter is not NULL then the number of | ||
82 | bytes of data written (i.e. the length of the digest) will be written | ||
83 | to the integer at B<s>, at most B<EVP_MAX_MD_SIZE> bytes will be written. | ||
84 | After calling EVP_DigestFinal_ex() no additional calls to EVP_DigestUpdate() | ||
85 | can be made, but EVP_DigestInit_ex() can be called to initialize a new | ||
86 | digest operation. | ||
87 | |||
88 | EVP_MD_CTX_cleanup() cleans up digest context B<ctx>, it should be called | ||
89 | after a digest context is no longer needed. | ||
90 | |||
91 | EVP_MD_CTX_destroy() cleans up digest context B<ctx> and frees up the | ||
92 | space allocated to it, it should be called only on a context created | ||
93 | using EVP_MD_CTX_create(). | ||
94 | |||
95 | EVP_MD_CTX_copy_ex() can be used to copy the message digest state from | ||
96 | B<in> to B<out>. This is useful if large amounts of data are to be | ||
97 | hashed which only differ in the last few bytes. B<out> must be initialized | ||
98 | before calling this function. | ||
99 | |||
100 | EVP_DigestInit() behaves in the same way as EVP_DigestInit_ex() except | ||
101 | the passed context B<ctx> does not have to be initialized, and it always | ||
102 | uses the default digest implementation. | ||
103 | |||
104 | EVP_DigestFinal() is similar to EVP_DigestFinal_ex() except the digest | ||
105 | contet B<ctx> is automatically cleaned up. | ||
106 | |||
107 | EVP_MD_CTX_copy() is similar to EVP_MD_CTX_copy_ex() except the destination | ||
108 | B<out> does not have to be initialized. | ||
109 | |||
110 | EVP_MD_size() and EVP_MD_CTX_size() return the size of the message digest | ||
111 | when passed an B<EVP_MD> or an B<EVP_MD_CTX> structure, i.e. the size of the | ||
112 | hash. | ||
113 | |||
114 | EVP_MD_block_size() and EVP_MD_CTX_block_size() return the block size of the | ||
115 | message digest when passed an B<EVP_MD> or an B<EVP_MD_CTX> structure. | ||
116 | |||
117 | EVP_MD_type() and EVP_MD_CTX_type() return the NID of the OBJECT IDENTIFIER | ||
118 | representing the given message digest when passed an B<EVP_MD> structure. | ||
119 | For example EVP_MD_type(EVP_sha1()) returns B<NID_sha1>. This function is | ||
120 | normally used when setting ASN1 OIDs. | ||
121 | |||
122 | EVP_MD_CTX_md() returns the B<EVP_MD> structure corresponding to the passed | ||
123 | B<EVP_MD_CTX>. | ||
124 | |||
125 | EVP_MD_pkey_type() returns the NID of the public key signing algorithm associated | ||
126 | with this digest. For example EVP_sha1() is associated with RSA so this will | ||
127 | return B<NID_sha1WithRSAEncryption>. This "link" between digests and signature | ||
128 | algorithms may not be retained in future versions of OpenSSL. | ||
129 | |||
130 | EVP_md2(), EVP_md5(), EVP_sha(), EVP_sha1(), EVP_mdc2() and EVP_ripemd160() | ||
131 | return B<EVP_MD> structures for the MD2, MD5, SHA, SHA1, MDC2 and RIPEMD160 digest | ||
132 | algorithms respectively. The associated signature algorithm is RSA in each case. | ||
133 | |||
134 | EVP_dss() and EVP_dss1() return B<EVP_MD> structures for SHA and SHA1 digest | ||
135 | algorithms but using DSS (DSA) for the signature algorithm. | ||
136 | |||
137 | EVP_md_null() is a "null" message digest that does nothing: i.e. the hash it | ||
138 | returns is of zero length. | ||
139 | |||
140 | EVP_get_digestbyname(), EVP_get_digestbynid() and EVP_get_digestbyobj() | ||
141 | return an B<EVP_MD> structure when passed a digest name, a digest NID or | ||
142 | an ASN1_OBJECT structure respectively. The digest table must be initialized | ||
143 | using, for example, OpenSSL_add_all_digests() for these functions to work. | ||
144 | |||
145 | =head1 RETURN VALUES | ||
146 | |||
147 | EVP_DigestInit_ex(), EVP_DigestUpdate() and EVP_DigestFinal_ex() return 1 for | ||
148 | success and 0 for failure. | ||
149 | |||
150 | EVP_MD_CTX_copy_ex() returns 1 if successful or 0 for failure. | ||
151 | |||
152 | EVP_MD_type(), EVP_MD_pkey_type() and EVP_MD_type() return the NID of the | ||
153 | corresponding OBJECT IDENTIFIER or NID_undef if none exists. | ||
154 | |||
155 | EVP_MD_size(), EVP_MD_block_size(), EVP_MD_CTX_size(e), EVP_MD_size(), | ||
156 | EVP_MD_CTX_block_size() and EVP_MD_block_size() return the digest or block | ||
157 | size in bytes. | ||
158 | |||
159 | EVP_md_null(), EVP_md2(), EVP_md5(), EVP_sha(), EVP_sha1(), EVP_dss(), | ||
160 | EVP_dss1(), EVP_mdc2() and EVP_ripemd160() return pointers to the | ||
161 | corresponding EVP_MD structures. | ||
162 | |||
163 | EVP_get_digestbyname(), EVP_get_digestbynid() and EVP_get_digestbyobj() | ||
164 | return either an B<EVP_MD> structure or NULL if an error occurs. | ||
165 | |||
166 | =head1 NOTES | ||
167 | |||
168 | The B<EVP> interface to message digests should almost always be used in | ||
169 | preference to the low level interfaces. This is because the code then becomes | ||
170 | transparent to the digest used and much more flexible. | ||
171 | |||
172 | SHA1 is the digest of choice for new applications. The other digest algorithms | ||
173 | are still in common use. | ||
174 | |||
175 | For most applications the B<impl> parameter to EVP_DigestInit_ex() will be | ||
176 | set to NULL to use the default digest implementation. | ||
177 | |||
178 | The functions EVP_DigestInit(), EVP_DigestFinal() and EVP_MD_CTX_copy() are | ||
179 | obsolete but are retained to maintain compatibility with existing code. New | ||
180 | applications should use EVP_DigestInit_ex(), EVP_DigestFinal_ex() and | ||
181 | EVP_MD_CTX_copy_ex() because they can efficiently reuse a digest context | ||
182 | instead of initializing and cleaning it up on each call and allow non default | ||
183 | implementations of digests to be specified. | ||
184 | |||
185 | In OpenSSL 0.9.7 and later if digest contexts are not cleaned up after use | ||
186 | memory leaks will occur. | ||
187 | |||
188 | =head1 EXAMPLE | ||
189 | |||
190 | This example digests the data "Test Message\n" and "Hello World\n", using the | ||
191 | digest name passed on the command line. | ||
192 | |||
193 | #include <stdio.h> | ||
194 | #include <openssl/evp.h> | ||
195 | |||
196 | main(int argc, char *argv[]) | ||
197 | { | ||
198 | EVP_MD_CTX mdctx; | ||
199 | const EVP_MD *md; | ||
200 | char mess1[] = "Test Message\n"; | ||
201 | char mess2[] = "Hello World\n"; | ||
202 | unsigned char md_value[EVP_MAX_MD_SIZE]; | ||
203 | int md_len, i; | ||
204 | |||
205 | OpenSSL_add_all_digests(); | ||
206 | |||
207 | if(!argv[1]) { | ||
208 | printf("Usage: mdtest digestname\n"); | ||
209 | exit(1); | ||
210 | } | ||
211 | |||
212 | md = EVP_get_digestbyname(argv[1]); | ||
213 | |||
214 | if(!md) { | ||
215 | printf("Unknown message digest %s\n", argv[1]); | ||
216 | exit(1); | ||
217 | } | ||
218 | |||
219 | EVP_MD_CTX_init(&mdctx); | ||
220 | EVP_DigestInit_ex(&mdctx, md, NULL); | ||
221 | EVP_DigestUpdate(&mdctx, mess1, strlen(mess1)); | ||
222 | EVP_DigestUpdate(&mdctx, mess2, strlen(mess2)); | ||
223 | EVP_DigestFinal_ex(&mdctx, md_value, &md_len); | ||
224 | EVP_MD_CTX_cleanup(&mdctx); | ||
225 | |||
226 | printf("Digest is: "); | ||
227 | for(i = 0; i < md_len; i++) printf("%02x", md_value[i]); | ||
228 | printf("\n"); | ||
229 | } | ||
230 | |||
231 | =head1 BUGS | ||
232 | |||
233 | The link between digests and signing algorithms results in a situation where | ||
234 | EVP_sha1() must be used with RSA and EVP_dss1() must be used with DSS | ||
235 | even though they are identical digests. | ||
236 | |||
237 | =head1 SEE ALSO | ||
238 | |||
239 | L<evp(3)|evp(3)>, L<HMAC(3)|HMAC(3)>, L<MD2(3)|MD2(3)>, | ||
240 | L<MD5(3)|MD5(3)>, L<MDC2(3)|MDC2(3)>, L<RIPEMD160(3)|RIPEMD160(3)>, | ||
241 | L<SHA1(3)|SHA1(3)> | ||
242 | |||
243 | =head1 HISTORY | ||
244 | |||
245 | EVP_DigestInit(), EVP_DigestUpdate() and EVP_DigestFinal() are | ||
246 | available in all versions of SSLeay and OpenSSL. | ||
247 | |||
248 | EVP_MD_CTX_init(), EVP_MD_CTX_create(), EVP_MD_CTX_copy_ex(), | ||
249 | EVP_MD_CTX_cleanup(), EVP_MD_CTX_destroy(), EVP_DigestInit_ex() | ||
250 | and EVP_DigestFinal_ex() were added in OpenSSL 0.9.7. | ||
251 | |||
252 | EVP_md_null(), EVP_md2(), EVP_md5(), EVP_sha(), EVP_sha1(), | ||
253 | EVP_dss(), EVP_dss1(), EVP_mdc2() and EVP_ripemd160() were | ||
254 | changed to return truely const EVP_MD * in OpenSSL 0.9.7. | ||
255 | |||
256 | =cut | ||
diff --git a/src/lib/libcrypto/doc/EVP_EncryptInit.pod b/src/lib/libcrypto/doc/EVP_EncryptInit.pod deleted file mode 100644 index 8271d3dfc4..0000000000 --- a/src/lib/libcrypto/doc/EVP_EncryptInit.pod +++ /dev/null | |||
@@ -1,511 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | EVP_CIPHER_CTX_init, EVP_EncryptInit_ex, EVP_EncryptUpdate, | ||
6 | EVP_EncryptFinal_ex, EVP_DecryptInit_ex, EVP_DecryptUpdate, | ||
7 | EVP_DecryptFinal_ex, EVP_CipherInit_ex, EVP_CipherUpdate, | ||
8 | EVP_CipherFinal_ex, EVP_CIPHER_CTX_set_key_length, | ||
9 | EVP_CIPHER_CTX_ctrl, EVP_CIPHER_CTX_cleanup, EVP_EncryptInit, | ||
10 | EVP_EncryptFinal, EVP_DecryptInit, EVP_DecryptFinal, | ||
11 | EVP_CipherInit, EVP_CipherFinal, EVP_get_cipherbyname, | ||
12 | EVP_get_cipherbynid, EVP_get_cipherbyobj, EVP_CIPHER_nid, | ||
13 | EVP_CIPHER_block_size, EVP_CIPHER_key_length, EVP_CIPHER_iv_length, | ||
14 | EVP_CIPHER_flags, EVP_CIPHER_mode, EVP_CIPHER_type, EVP_CIPHER_CTX_cipher, | ||
15 | EVP_CIPHER_CTX_nid, EVP_CIPHER_CTX_block_size, EVP_CIPHER_CTX_key_length, | ||
16 | EVP_CIPHER_CTX_iv_length, EVP_CIPHER_CTX_get_app_data, | ||
17 | EVP_CIPHER_CTX_set_app_data, EVP_CIPHER_CTX_type, EVP_CIPHER_CTX_flags, | ||
18 | EVP_CIPHER_CTX_mode, EVP_CIPHER_param_to_asn1, EVP_CIPHER_asn1_to_param, | ||
19 | EVP_CIPHER_CTX_set_padding - EVP cipher routines | ||
20 | |||
21 | =head1 SYNOPSIS | ||
22 | |||
23 | #include <openssl/evp.h> | ||
24 | |||
25 | void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a); | ||
26 | |||
27 | int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, | ||
28 | ENGINE *impl, unsigned char *key, unsigned char *iv); | ||
29 | int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
30 | int *outl, unsigned char *in, int inl); | ||
31 | int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
32 | int *outl); | ||
33 | |||
34 | int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, | ||
35 | ENGINE *impl, unsigned char *key, unsigned char *iv); | ||
36 | int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
37 | int *outl, unsigned char *in, int inl); | ||
38 | int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, | ||
39 | int *outl); | ||
40 | |||
41 | int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, | ||
42 | ENGINE *impl, unsigned char *key, unsigned char *iv, int enc); | ||
43 | int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
44 | int *outl, unsigned char *in, int inl); | ||
45 | int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, | ||
46 | int *outl); | ||
47 | |||
48 | int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, | ||
49 | unsigned char *key, unsigned char *iv); | ||
50 | int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
51 | int *outl); | ||
52 | |||
53 | int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, | ||
54 | unsigned char *key, unsigned char *iv); | ||
55 | int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, | ||
56 | int *outl); | ||
57 | |||
58 | int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, | ||
59 | unsigned char *key, unsigned char *iv, int enc); | ||
60 | int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, | ||
61 | int *outl); | ||
62 | |||
63 | int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *x, int padding); | ||
64 | int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen); | ||
65 | int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr); | ||
66 | int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); | ||
67 | |||
68 | const EVP_CIPHER *EVP_get_cipherbyname(const char *name); | ||
69 | #define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a)) | ||
70 | #define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)) | ||
71 | |||
72 | #define EVP_CIPHER_nid(e) ((e)->nid) | ||
73 | #define EVP_CIPHER_block_size(e) ((e)->block_size) | ||
74 | #define EVP_CIPHER_key_length(e) ((e)->key_len) | ||
75 | #define EVP_CIPHER_iv_length(e) ((e)->iv_len) | ||
76 | #define EVP_CIPHER_flags(e) ((e)->flags) | ||
77 | #define EVP_CIPHER_mode(e) ((e)->flags) & EVP_CIPH_MODE) | ||
78 | int EVP_CIPHER_type(const EVP_CIPHER *ctx); | ||
79 | |||
80 | #define EVP_CIPHER_CTX_cipher(e) ((e)->cipher) | ||
81 | #define EVP_CIPHER_CTX_nid(e) ((e)->cipher->nid) | ||
82 | #define EVP_CIPHER_CTX_block_size(e) ((e)->cipher->block_size) | ||
83 | #define EVP_CIPHER_CTX_key_length(e) ((e)->key_len) | ||
84 | #define EVP_CIPHER_CTX_iv_length(e) ((e)->cipher->iv_len) | ||
85 | #define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data) | ||
86 | #define EVP_CIPHER_CTX_set_app_data(e,d) ((e)->app_data=(char *)(d)) | ||
87 | #define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) | ||
88 | #define EVP_CIPHER_CTX_flags(e) ((e)->cipher->flags) | ||
89 | #define EVP_CIPHER_CTX_mode(e) ((e)->cipher->flags & EVP_CIPH_MODE) | ||
90 | |||
91 | int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type); | ||
92 | int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); | ||
93 | |||
94 | =head1 DESCRIPTION | ||
95 | |||
96 | The EVP cipher routines are a high level interface to certain | ||
97 | symmetric ciphers. | ||
98 | |||
99 | EVP_CIPHER_CTX_init() initializes cipher contex B<ctx>. | ||
100 | |||
101 | EVP_EncryptInit_ex() sets up cipher context B<ctx> for encryption | ||
102 | with cipher B<type> from ENGINE B<impl>. B<ctx> must be initialized | ||
103 | before calling this function. B<type> is normally supplied | ||
104 | by a function such as EVP_des_cbc(). If B<impl> is NULL then the | ||
105 | default implementation is used. B<key> is the symmetric key to use | ||
106 | and B<iv> is the IV to use (if necessary), the actual number of bytes | ||
107 | used for the key and IV depends on the cipher. It is possible to set | ||
108 | all parameters to NULL except B<type> in an initial call and supply | ||
109 | the remaining parameters in subsequent calls, all of which have B<type> | ||
110 | set to NULL. This is done when the default cipher parameters are not | ||
111 | appropriate. | ||
112 | |||
113 | EVP_EncryptUpdate() encrypts B<inl> bytes from the buffer B<in> and | ||
114 | writes the encrypted version to B<out>. This function can be called | ||
115 | multiple times to encrypt successive blocks of data. The amount | ||
116 | of data written depends on the block alignment of the encrypted data: | ||
117 | as a result the amount of data written may be anything from zero bytes | ||
118 | to (inl + cipher_block_size - 1) so B<outl> should contain sufficient | ||
119 | room. The actual number of bytes written is placed in B<outl>. | ||
120 | |||
121 | If padding is enabled (the default) then EVP_EncryptFinal_ex() encrypts | ||
122 | the "final" data, that is any data that remains in a partial block. | ||
123 | It uses L<standard block padding|/NOTES> (aka PKCS padding). The encrypted | ||
124 | final data is written to B<out> which should have sufficient space for | ||
125 | one cipher block. The number of bytes written is placed in B<outl>. After | ||
126 | this function is called the encryption operation is finished and no further | ||
127 | calls to EVP_EncryptUpdate() should be made. | ||
128 | |||
129 | If padding is disabled then EVP_EncryptFinal_ex() will not encrypt any more | ||
130 | data and it will return an error if any data remains in a partial block: | ||
131 | that is if the total data length is not a multiple of the block size. | ||
132 | |||
133 | EVP_DecryptInit_ex(), EVP_DecryptUpdate() and EVP_DecryptFinal_ex() are the | ||
134 | corresponding decryption operations. EVP_DecryptFinal() will return an | ||
135 | error code if padding is enabled and the final block is not correctly | ||
136 | formatted. The parameters and restrictions are identical to the encryption | ||
137 | operations except that if padding is enabled the decrypted data buffer B<out> | ||
138 | passed to EVP_DecryptUpdate() should have sufficient room for | ||
139 | (B<inl> + cipher_block_size) bytes unless the cipher block size is 1 in | ||
140 | which case B<inl> bytes is sufficient. | ||
141 | |||
142 | EVP_CipherInit_ex(), EVP_CipherUpdate() and EVP_CipherFinal_ex() are | ||
143 | functions that can be used for decryption or encryption. The operation | ||
144 | performed depends on the value of the B<enc> parameter. It should be set | ||
145 | to 1 for encryption, 0 for decryption and -1 to leave the value unchanged | ||
146 | (the actual value of 'enc' being supplied in a previous call). | ||
147 | |||
148 | EVP_CIPHER_CTX_cleanup() clears all information from a cipher context | ||
149 | and free up any allocated memory associate with it. It should be called | ||
150 | after all operations using a cipher are complete so sensitive information | ||
151 | does not remain in memory. | ||
152 | |||
153 | EVP_EncryptInit(), EVP_DecryptInit() and EVP_CipherInit() behave in a | ||
154 | similar way to EVP_EncryptInit_ex(), EVP_DecryptInit_ex and | ||
155 | EVP_CipherInit_ex() except the B<ctx> paramter does not need to be | ||
156 | initialized and they always use the default cipher implementation. | ||
157 | |||
158 | EVP_EncryptFinal(), EVP_DecryptFinal() and EVP_CipherFinal() behave in a | ||
159 | similar way to EVP_EncryptFinal_ex(), EVP_DecryptFinal_ex() and | ||
160 | EVP_CipherFinal_ex() except B<ctx> is automatically cleaned up | ||
161 | after the call. | ||
162 | |||
163 | EVP_get_cipherbyname(), EVP_get_cipherbynid() and EVP_get_cipherbyobj() | ||
164 | return an EVP_CIPHER structure when passed a cipher name, a NID or an | ||
165 | ASN1_OBJECT structure. | ||
166 | |||
167 | EVP_CIPHER_nid() and EVP_CIPHER_CTX_nid() return the NID of a cipher when | ||
168 | passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX> structure. The actual NID | ||
169 | value is an internal value which may not have a corresponding OBJECT | ||
170 | IDENTIFIER. | ||
171 | |||
172 | EVP_CIPHER_CTX_set_padding() enables or disables padding. By default | ||
173 | encryption operations are padded using standard block padding and the | ||
174 | padding is checked and removed when decrypting. If the B<pad> parameter | ||
175 | is zero then no padding is performed, the total amount of data encrypted | ||
176 | or decrypted must then be a multiple of the block size or an error will | ||
177 | occur. | ||
178 | |||
179 | EVP_CIPHER_key_length() and EVP_CIPHER_CTX_key_length() return the key | ||
180 | length of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX> | ||
181 | structure. The constant B<EVP_MAX_KEY_LENGTH> is the maximum key length | ||
182 | for all ciphers. Note: although EVP_CIPHER_key_length() is fixed for a | ||
183 | given cipher, the value of EVP_CIPHER_CTX_key_length() may be different | ||
184 | for variable key length ciphers. | ||
185 | |||
186 | EVP_CIPHER_CTX_set_key_length() sets the key length of the cipher ctx. | ||
187 | If the cipher is a fixed length cipher then attempting to set the key | ||
188 | length to any value other than the fixed value is an error. | ||
189 | |||
190 | EVP_CIPHER_iv_length() and EVP_CIPHER_CTX_iv_length() return the IV | ||
191 | length of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX>. | ||
192 | It will return zero if the cipher does not use an IV. The constant | ||
193 | B<EVP_MAX_IV_LENGTH> is the maximum IV length for all ciphers. | ||
194 | |||
195 | EVP_CIPHER_block_size() and EVP_CIPHER_CTX_block_size() return the block | ||
196 | size of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX> | ||
197 | structure. The constant B<EVP_MAX_IV_LENGTH> is also the maximum block | ||
198 | length for all ciphers. | ||
199 | |||
200 | EVP_CIPHER_type() and EVP_CIPHER_CTX_type() return the type of the passed | ||
201 | cipher or context. This "type" is the actual NID of the cipher OBJECT | ||
202 | IDENTIFIER as such it ignores the cipher parameters and 40 bit RC2 and | ||
203 | 128 bit RC2 have the same NID. If the cipher does not have an object | ||
204 | identifier or does not have ASN1 support this function will return | ||
205 | B<NID_undef>. | ||
206 | |||
207 | EVP_CIPHER_CTX_cipher() returns the B<EVP_CIPHER> structure when passed | ||
208 | an B<EVP_CIPHER_CTX> structure. | ||
209 | |||
210 | EVP_CIPHER_mode() and EVP_CIPHER_CTX_mode() return the block cipher mode: | ||
211 | EVP_CIPH_ECB_MODE, EVP_CIPH_CBC_MODE, EVP_CIPH_CFB_MODE or | ||
212 | EVP_CIPH_OFB_MODE. If the cipher is a stream cipher then | ||
213 | EVP_CIPH_STREAM_CIPHER is returned. | ||
214 | |||
215 | EVP_CIPHER_param_to_asn1() sets the AlgorithmIdentifier "parameter" based | ||
216 | on the passed cipher. This will typically include any parameters and an | ||
217 | IV. The cipher IV (if any) must be set when this call is made. This call | ||
218 | should be made before the cipher is actually "used" (before any | ||
219 | EVP_EncryptUpdate(), EVP_DecryptUpdate() calls for example). This function | ||
220 | may fail if the cipher does not have any ASN1 support. | ||
221 | |||
222 | EVP_CIPHER_asn1_to_param() sets the cipher parameters based on an ASN1 | ||
223 | AlgorithmIdentifier "parameter". The precise effect depends on the cipher | ||
224 | In the case of RC2, for example, it will set the IV and effective key length. | ||
225 | This function should be called after the base cipher type is set but before | ||
226 | the key is set. For example EVP_CipherInit() will be called with the IV and | ||
227 | key set to NULL, EVP_CIPHER_asn1_to_param() will be called and finally | ||
228 | EVP_CipherInit() again with all parameters except the key set to NULL. It is | ||
229 | possible for this function to fail if the cipher does not have any ASN1 support | ||
230 | or the parameters cannot be set (for example the RC2 effective key length | ||
231 | is not supported. | ||
232 | |||
233 | EVP_CIPHER_CTX_ctrl() allows various cipher specific parameters to be determined | ||
234 | and set. Currently only the RC2 effective key length and the number of rounds of | ||
235 | RC5 can be set. | ||
236 | |||
237 | =head1 RETURN VALUES | ||
238 | |||
239 | EVP_EncryptInit_ex(), EVP_EncryptUpdate() and EVP_EncryptFinal_ex() | ||
240 | return 1 for success and 0 for failure. | ||
241 | |||
242 | EVP_DecryptInit_ex() and EVP_DecryptUpdate() return 1 for success and 0 for failure. | ||
243 | EVP_DecryptFinal_ex() returns 0 if the decrypt failed or 1 for success. | ||
244 | |||
245 | EVP_CipherInit_ex() and EVP_CipherUpdate() return 1 for success and 0 for failure. | ||
246 | EVP_CipherFinal_ex() returns 0 for a decryption failure or 1 for success. | ||
247 | |||
248 | EVP_CIPHER_CTX_cleanup() returns 1 for success and 0 for failure. | ||
249 | |||
250 | EVP_get_cipherbyname(), EVP_get_cipherbynid() and EVP_get_cipherbyobj() | ||
251 | return an B<EVP_CIPHER> structure or NULL on error. | ||
252 | |||
253 | EVP_CIPHER_nid() and EVP_CIPHER_CTX_nid() return a NID. | ||
254 | |||
255 | EVP_CIPHER_block_size() and EVP_CIPHER_CTX_block_size() return the block | ||
256 | size. | ||
257 | |||
258 | EVP_CIPHER_key_length() and EVP_CIPHER_CTX_key_length() return the key | ||
259 | length. | ||
260 | |||
261 | EVP_CIPHER_CTX_set_padding() always returns 1. | ||
262 | |||
263 | EVP_CIPHER_iv_length() and EVP_CIPHER_CTX_iv_length() return the IV | ||
264 | length or zero if the cipher does not use an IV. | ||
265 | |||
266 | EVP_CIPHER_type() and EVP_CIPHER_CTX_type() return the NID of the cipher's | ||
267 | OBJECT IDENTIFIER or NID_undef if it has no defined OBJECT IDENTIFIER. | ||
268 | |||
269 | EVP_CIPHER_CTX_cipher() returns an B<EVP_CIPHER> structure. | ||
270 | |||
271 | EVP_CIPHER_param_to_asn1() and EVP_CIPHER_asn1_to_param() return 1 for | ||
272 | success or zero for failure. | ||
273 | |||
274 | =head1 CIPHER LISTING | ||
275 | |||
276 | All algorithms have a fixed key length unless otherwise stated. | ||
277 | |||
278 | =over 4 | ||
279 | |||
280 | =item EVP_enc_null() | ||
281 | |||
282 | Null cipher: does nothing. | ||
283 | |||
284 | =item EVP_des_cbc(void), EVP_des_ecb(void), EVP_des_cfb(void), EVP_des_ofb(void) | ||
285 | |||
286 | DES in CBC, ECB, CFB and OFB modes respectively. | ||
287 | |||
288 | =item EVP_des_ede_cbc(void), EVP_des_ede(), EVP_des_ede_ofb(void), EVP_des_ede_cfb(void) | ||
289 | |||
290 | Two key triple DES in CBC, ECB, CFB and OFB modes respectively. | ||
291 | |||
292 | =item EVP_des_ede3_cbc(void), EVP_des_ede3(), EVP_des_ede3_ofb(void), EVP_des_ede3_cfb(void) | ||
293 | |||
294 | Three key triple DES in CBC, ECB, CFB and OFB modes respectively. | ||
295 | |||
296 | =item EVP_desx_cbc(void) | ||
297 | |||
298 | DESX algorithm in CBC mode. | ||
299 | |||
300 | =item EVP_rc4(void) | ||
301 | |||
302 | RC4 stream cipher. This is a variable key length cipher with default key length 128 bits. | ||
303 | |||
304 | =item EVP_rc4_40(void) | ||
305 | |||
306 | RC4 stream cipher with 40 bit key length. This is obsolete and new code should use EVP_rc4() | ||
307 | and the EVP_CIPHER_CTX_set_key_length() function. | ||
308 | |||
309 | =item EVP_idea_cbc() EVP_idea_ecb(void), EVP_idea_cfb(void), EVP_idea_ofb(void), EVP_idea_cbc(void) | ||
310 | |||
311 | IDEA encryption algorithm in CBC, ECB, CFB and OFB modes respectively. | ||
312 | |||
313 | =item EVP_rc2_cbc(void), EVP_rc2_ecb(void), EVP_rc2_cfb(void), EVP_rc2_ofb(void) | ||
314 | |||
315 | RC2 encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key | ||
316 | length cipher with an additional parameter called "effective key bits" or "effective key length". | ||
317 | By default both are set to 128 bits. | ||
318 | |||
319 | =item EVP_rc2_40_cbc(void), EVP_rc2_64_cbc(void) | ||
320 | |||
321 | RC2 algorithm in CBC mode with a default key length and effective key length of 40 and 64 bits. | ||
322 | These are obsolete and new code should use EVP_rc2_cbc(), EVP_CIPHER_CTX_set_key_length() and | ||
323 | EVP_CIPHER_CTX_ctrl() to set the key length and effective key length. | ||
324 | |||
325 | =item EVP_bf_cbc(void), EVP_bf_ecb(void), EVP_bf_cfb(void), EVP_bf_ofb(void); | ||
326 | |||
327 | Blowfish encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key | ||
328 | length cipher. | ||
329 | |||
330 | =item EVP_cast5_cbc(void), EVP_cast5_ecb(void), EVP_cast5_cfb(void), EVP_cast5_ofb(void) | ||
331 | |||
332 | CAST encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key | ||
333 | length cipher. | ||
334 | |||
335 | =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) | ||
336 | |||
337 | RC5 encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key length | ||
338 | cipher with an additional "number of rounds" parameter. By default the key length is set to 128 | ||
339 | bits and 12 rounds. | ||
340 | |||
341 | =back | ||
342 | |||
343 | =head1 NOTES | ||
344 | |||
345 | Where possible the B<EVP> interface to symmetric ciphers should be used in | ||
346 | preference to the low level interfaces. This is because the code then becomes | ||
347 | transparent to the cipher used and much more flexible. | ||
348 | |||
349 | PKCS padding works by adding B<n> padding bytes of value B<n> to make the total | ||
350 | length of the encrypted data a multiple of the block size. Padding is always | ||
351 | added so if the data is already a multiple of the block size B<n> will equal | ||
352 | the block size. For example if the block size is 8 and 11 bytes are to be | ||
353 | encrypted then 5 padding bytes of value 5 will be added. | ||
354 | |||
355 | When decrypting the final block is checked to see if it has the correct form. | ||
356 | |||
357 | Although the decryption operation can produce an error if padding is enabled, | ||
358 | it is not a strong test that the input data or key is correct. A random block | ||
359 | has better than 1 in 256 chance of being of the correct format and problems with | ||
360 | the input data earlier on will not produce a final decrypt error. | ||
361 | |||
362 | If padding is disabled then the decryption operation will always succeed if | ||
363 | the total amount of data decrypted is a multiple of the block size. | ||
364 | |||
365 | The functions EVP_EncryptInit(), EVP_EncryptFinal(), EVP_DecryptInit(), | ||
366 | EVP_CipherInit() and EVP_CipherFinal() are obsolete but are retained for | ||
367 | compatibility with existing code. New code should use EVP_EncryptInit_ex(), | ||
368 | EVP_EncryptFinal_ex(), EVP_DecryptInit_ex(), EVP_DecryptFinal_ex(), | ||
369 | EVP_CipherInit_ex() and EVP_CipherFinal_ex() because they can reuse an | ||
370 | existing context without allocating and freeing it up on each call. | ||
371 | |||
372 | =head1 BUGS | ||
373 | |||
374 | For RC5 the number of rounds can currently only be set to 8, 12 or 16. This is | ||
375 | a limitation of the current RC5 code rather than the EVP interface. | ||
376 | |||
377 | EVP_MAX_KEY_LENGTH and EVP_MAX_IV_LENGTH only refer to the internal ciphers with | ||
378 | default key lengths. If custom ciphers exceed these values the results are | ||
379 | unpredictable. This is because it has become standard practice to define a | ||
380 | generic key as a fixed unsigned char array containing EVP_MAX_KEY_LENGTH bytes. | ||
381 | |||
382 | The ASN1 code is incomplete (and sometimes inaccurate) it has only been tested | ||
383 | for certain common S/MIME ciphers (RC2, DES, triple DES) in CBC mode. | ||
384 | |||
385 | =head1 EXAMPLES | ||
386 | |||
387 | Get the number of rounds used in RC5: | ||
388 | |||
389 | int nrounds; | ||
390 | EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC5_ROUNDS, 0, &nrounds); | ||
391 | |||
392 | Get the RC2 effective key length: | ||
393 | |||
394 | int key_bits; | ||
395 | EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC2_KEY_BITS, 0, &key_bits); | ||
396 | |||
397 | Set the number of rounds used in RC5: | ||
398 | |||
399 | int nrounds; | ||
400 | EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC5_ROUNDS, nrounds, NULL); | ||
401 | |||
402 | Set the effective key length used in RC2: | ||
403 | |||
404 | int key_bits; | ||
405 | EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC2_KEY_BITS, key_bits, NULL); | ||
406 | |||
407 | Encrypt a string using blowfish: | ||
408 | |||
409 | int do_crypt(char *outfile) | ||
410 | { | ||
411 | unsigned char outbuf[1024]; | ||
412 | int outlen, tmplen; | ||
413 | /* Bogus key and IV: we'd normally set these from | ||
414 | * another source. | ||
415 | */ | ||
416 | unsigned char key[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; | ||
417 | unsigned char iv[] = {1,2,3,4,5,6,7,8}; | ||
418 | char intext[] = "Some Crypto Text"; | ||
419 | EVP_CIPHER_CTX ctx; | ||
420 | FILE *out; | ||
421 | EVP_CIPHER_CTX_init(&ctx); | ||
422 | EVP_EncryptInit_ex(&ctx, EVP_bf_cbc(), NULL, key, iv); | ||
423 | |||
424 | if(!EVP_EncryptUpdate(&ctx, outbuf, &outlen, intext, strlen(intext))) | ||
425 | { | ||
426 | /* Error */ | ||
427 | return 0; | ||
428 | } | ||
429 | /* Buffer passed to EVP_EncryptFinal() must be after data just | ||
430 | * encrypted to avoid overwriting it. | ||
431 | */ | ||
432 | if(!EVP_EncryptFinal_ex(&ctx, outbuf + outlen, &tmplen)) | ||
433 | { | ||
434 | /* Error */ | ||
435 | return 0; | ||
436 | } | ||
437 | outlen += tmplen; | ||
438 | EVP_CIPHER_CTX_cleanup(&ctx); | ||
439 | /* Need binary mode for fopen because encrypted data is | ||
440 | * binary data. Also cannot use strlen() on it because | ||
441 | * it wont be null terminated and may contain embedded | ||
442 | * nulls. | ||
443 | */ | ||
444 | out = fopen(outfile, "wb"); | ||
445 | fwrite(outbuf, 1, outlen, out); | ||
446 | fclose(out); | ||
447 | return 1; | ||
448 | } | ||
449 | |||
450 | The ciphertext from the above example can be decrypted using the B<openssl> | ||
451 | utility with the command line: | ||
452 | |||
453 | S<openssl bf -in cipher.bin -K 000102030405060708090A0B0C0D0E0F -iv 0102030405060708 -d> | ||
454 | |||
455 | General encryption, decryption function example using FILE I/O and RC2 with an | ||
456 | 80 bit key: | ||
457 | |||
458 | int do_crypt(FILE *in, FILE *out, int do_encrypt) | ||
459 | { | ||
460 | /* Allow enough space in output buffer for additional block */ | ||
461 | inbuf[1024], outbuf[1024 + EVP_MAX_BLOCK_LENGTH]; | ||
462 | int inlen, outlen; | ||
463 | /* Bogus key and IV: we'd normally set these from | ||
464 | * another source. | ||
465 | */ | ||
466 | unsigned char key[] = "0123456789"; | ||
467 | unsigned char iv[] = "12345678"; | ||
468 | /* Don't set key or IV because we will modify the parameters */ | ||
469 | EVP_CIPHER_CTX_init(&ctx); | ||
470 | EVP_CipherInit_ex(&ctx, EVP_rc2(), NULL, NULL, NULL, do_encrypt); | ||
471 | EVP_CIPHER_CTX_set_key_length(&ctx, 10); | ||
472 | /* We finished modifying parameters so now we can set key and IV */ | ||
473 | EVP_CipherInit_ex(&ctx, NULL, NULL, key, iv, do_encrypt); | ||
474 | |||
475 | for(;;) | ||
476 | { | ||
477 | inlen = fread(inbuf, 1, 1024, in); | ||
478 | if(inlen <= 0) break; | ||
479 | if(!EVP_CipherUpdate(&ctx, outbuf, &outlen, inbuf, inlen)) | ||
480 | { | ||
481 | /* Error */ | ||
482 | EVP_CIPHER_CTX_cleanup(&ctx); | ||
483 | return 0; | ||
484 | } | ||
485 | fwrite(outbuf, 1, outlen, out); | ||
486 | } | ||
487 | if(!EVP_CipherFinal_ex(&ctx, outbuf, &outlen)) | ||
488 | { | ||
489 | /* Error */ | ||
490 | EVP_CIPHER_CTX_cleanup(&ctx); | ||
491 | return 0; | ||
492 | } | ||
493 | fwrite(outbuf, 1, outlen, out); | ||
494 | |||
495 | EVP_CIPHER_CTX_cleanup(&ctx); | ||
496 | return 1; | ||
497 | } | ||
498 | |||
499 | |||
500 | =head1 SEE ALSO | ||
501 | |||
502 | L<evp(3)|evp(3)> | ||
503 | |||
504 | =head1 HISTORY | ||
505 | |||
506 | EVP_CIPHER_CTX_init(), EVP_EncryptInit_ex(), EVP_EncryptFinal_ex(), | ||
507 | EVP_DecryptInit_ex(), EVP_DecryptFinal_ex(), EVP_CipherInit_ex(), | ||
508 | EVP_CipherFinal_ex() and EVP_CIPHER_CTX_set_padding() appeared in | ||
509 | OpenSSL 0.9.7. | ||
510 | |||
511 | =cut | ||
diff --git a/src/lib/libcrypto/doc/EVP_OpenInit.pod b/src/lib/libcrypto/doc/EVP_OpenInit.pod deleted file mode 100644 index 2e710da945..0000000000 --- a/src/lib/libcrypto/doc/EVP_OpenInit.pod +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | EVP_OpenInit, EVP_OpenUpdate, EVP_OpenFinal - EVP envelope decryption | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/evp.h> | ||
10 | |||
11 | int EVP_OpenInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type,unsigned char *ek, | ||
12 | int ekl,unsigned char *iv,EVP_PKEY *priv); | ||
13 | int EVP_OpenUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
14 | int *outl, unsigned char *in, int inl); | ||
15 | int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
16 | int *outl); | ||
17 | |||
18 | =head1 DESCRIPTION | ||
19 | |||
20 | The EVP envelope routines are a high level interface to envelope | ||
21 | decryption. They decrypt a public key encrypted symmetric key and | ||
22 | then decrypt data using it. | ||
23 | |||
24 | EVP_OpenInit() initializes a cipher context B<ctx> for decryption | ||
25 | with cipher B<type>. It decrypts the encrypted symmetric key of length | ||
26 | B<ekl> bytes passed in the B<ek> parameter using the private key B<priv>. | ||
27 | The IV is supplied in the B<iv> parameter. | ||
28 | |||
29 | EVP_OpenUpdate() and EVP_OpenFinal() have exactly the same properties | ||
30 | as the EVP_DecryptUpdate() and EVP_DecryptFinal() routines, as | ||
31 | documented on the L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> manual | ||
32 | page. | ||
33 | |||
34 | =head1 NOTES | ||
35 | |||
36 | It is possible to call EVP_OpenInit() twice in the same way as | ||
37 | EVP_DecryptInit(). The first call should have B<priv> set to NULL | ||
38 | and (after setting any cipher parameters) it should be called again | ||
39 | with B<type> set to NULL. | ||
40 | |||
41 | If the cipher passed in the B<type> parameter is a variable length | ||
42 | cipher then the key length will be set to the value of the recovered | ||
43 | key length. If the cipher is a fixed length cipher then the recovered | ||
44 | key length must match the fixed cipher length. | ||
45 | |||
46 | =head1 RETURN VALUES | ||
47 | |||
48 | EVP_OpenInit() returns 0 on error or a non zero integer (actually the | ||
49 | recovered secret key size) if successful. | ||
50 | |||
51 | EVP_OpenUpdate() returns 1 for success or 0 for failure. | ||
52 | |||
53 | EVP_OpenFinal() returns 0 if the decrypt failed or 1 for success. | ||
54 | |||
55 | =head1 SEE ALSO | ||
56 | |||
57 | L<evp(3)|evp(3)>, L<rand(3)|rand(3)>, | ||
58 | L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>, | ||
59 | L<EVP_SealInit(3)|EVP_SealInit(3)> | ||
60 | |||
61 | =head1 HISTORY | ||
62 | |||
63 | =cut | ||
diff --git a/src/lib/libcrypto/doc/EVP_PKEY_new.pod b/src/lib/libcrypto/doc/EVP_PKEY_new.pod deleted file mode 100644 index 10687e458d..0000000000 --- a/src/lib/libcrypto/doc/EVP_PKEY_new.pod +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | EVP_PKEY_new, EVP_PKEY_free - private key allocation functions. | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/evp.h> | ||
10 | |||
11 | EVP_PKEY *EVP_PKEY_new(void); | ||
12 | void EVP_PKEY_free(EVP_PKEY *key); | ||
13 | |||
14 | |||
15 | =head1 DESCRIPTION | ||
16 | |||
17 | The EVP_PKEY_new() function allocates an empty B<EVP_PKEY> | ||
18 | structure which is used by OpenSSL to store private keys. | ||
19 | |||
20 | EVP_PKEY_free() frees up the private key B<key>. | ||
21 | |||
22 | =head1 NOTES | ||
23 | |||
24 | The B<EVP_PKEY> structure is used by various OpenSSL functions | ||
25 | which require a general private key without reference to any | ||
26 | particular algorithm. | ||
27 | |||
28 | The structure returned by EVP_PKEY_new() is empty. To add a | ||
29 | private key to this empty structure the functions described in | ||
30 | L<EVP_PKEY_set1_RSA(3)|EVP_PKEY_set1_RSA(3)> should be used. | ||
31 | |||
32 | =head1 RETURN VALUES | ||
33 | |||
34 | EVP_PKEY_new() returns either the newly allocated B<EVP_PKEY> | ||
35 | structure of B<NULL> if an error occurred. | ||
36 | |||
37 | EVP_PKEY_free() does not return a value. | ||
38 | |||
39 | =head1 SEE ALSO | ||
40 | |||
41 | L<EVP_PKEY_set1_RSA(3)|EVP_PKEY_set1_RSA(3)> | ||
42 | |||
43 | =head1 HISTORY | ||
44 | |||
45 | TBA | ||
46 | |||
47 | =cut | ||
diff --git a/src/lib/libcrypto/doc/EVP_PKEY_set1_RSA.pod b/src/lib/libcrypto/doc/EVP_PKEY_set1_RSA.pod deleted file mode 100644 index 2db692e271..0000000000 --- a/src/lib/libcrypto/doc/EVP_PKEY_set1_RSA.pod +++ /dev/null | |||
@@ -1,80 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | EVP_PKEY_set1_RSA, EVP_PKEY_set1_DSA, EVP_PKEY_set1_DH, EVP_PKEY_set1_EC_KEY, | ||
6 | EVP_PKEY_get1_RSA, EVP_PKEY_get1_DSA, EVP_PKEY_get1_DH, EVP_PKEY_get1_EC_KEY, | ||
7 | EVP_PKEY_assign_RSA, EVP_PKEY_assign_DSA, EVP_PKEY_assign_DH, EVP_PKEY_assign_EC_KEY, | ||
8 | EVP_PKEY_type - EVP_PKEY assignment functions. | ||
9 | |||
10 | =head1 SYNOPSIS | ||
11 | |||
12 | #include <openssl/evp.h> | ||
13 | |||
14 | int EVP_PKEY_set1_RSA(EVP_PKEY *pkey,RSA *key); | ||
15 | int EVP_PKEY_set1_DSA(EVP_PKEY *pkey,DSA *key); | ||
16 | int EVP_PKEY_set1_DH(EVP_PKEY *pkey,DH *key); | ||
17 | int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey,EC_KEY *key); | ||
18 | |||
19 | RSA *EVP_PKEY_get1_RSA(EVP_PKEY *pkey); | ||
20 | DSA *EVP_PKEY_get1_DSA(EVP_PKEY *pkey); | ||
21 | DH *EVP_PKEY_get1_DH(EVP_PKEY *pkey); | ||
22 | EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey); | ||
23 | |||
24 | int EVP_PKEY_assign_RSA(EVP_PKEY *pkey,RSA *key); | ||
25 | int EVP_PKEY_assign_DSA(EVP_PKEY *pkey,DSA *key); | ||
26 | int EVP_PKEY_assign_DH(EVP_PKEY *pkey,DH *key); | ||
27 | int EVP_PKEY_assign_EC_KEY(EVP_PKEY *pkey,EC_KEY *key); | ||
28 | |||
29 | int EVP_PKEY_type(int type); | ||
30 | |||
31 | =head1 DESCRIPTION | ||
32 | |||
33 | EVP_PKEY_set1_RSA(), EVP_PKEY_set1_DSA(), EVP_PKEY_set1_DH() and | ||
34 | EVP_PKEY_set1_EC_KEY() set the key referenced by B<pkey> to B<key>. | ||
35 | |||
36 | EVP_PKEY_get1_RSA(), EVP_PKEY_get1_DSA(), EVP_PKEY_get1_DH() and | ||
37 | EVP_PKEY_get1_EC_KEY() return the referenced key in B<pkey> or | ||
38 | B<NULL> if the key is not of the correct type. | ||
39 | |||
40 | EVP_PKEY_assign_RSA() EVP_PKEY_assign_DSA(), EVP_PKEY_assign_DH() | ||
41 | and EVP_PKEY_assign_EC_KEY() also set the referenced key to B<key> | ||
42 | however these use the supplied B<key> internally and so B<key> | ||
43 | will be freed when the parent B<pkey> is freed. | ||
44 | |||
45 | EVP_PKEY_type() returns the type of key corresponding to the value | ||
46 | B<type>. The type of a key can be obtained with | ||
47 | EVP_PKEY_type(pkey->type). The return value will be EVP_PKEY_RSA, | ||
48 | EVP_PKEY_DSA, EVP_PKEY_DH or EVP_PKEY_EC for the corresponding | ||
49 | key types or NID_undef if the key type is unassigned. | ||
50 | |||
51 | =head1 NOTES | ||
52 | |||
53 | In accordance with the OpenSSL naming convention the key obtained | ||
54 | from or assigned to the B<pkey> using the B<1> functions must be | ||
55 | freed as well as B<pkey>. | ||
56 | |||
57 | EVP_PKEY_assign_RSA() EVP_PKEY_assign_DSA(), EVP_PKEY_assign_DH() | ||
58 | EVP_PKEY_assign_EC_KEY() are implemented as macros. | ||
59 | |||
60 | =head1 RETURN VALUES | ||
61 | |||
62 | EVP_PKEY_set1_RSA(), EVP_PKEY_set1_DSA(), EVP_PKEY_set1_DH() and | ||
63 | EVP_PKEY_set1_EC_KEY() return 1 for success or 0 for failure. | ||
64 | |||
65 | EVP_PKEY_get1_RSA(), EVP_PKEY_get1_DSA(), EVP_PKEY_get1_DH() and | ||
66 | EVP_PKEY_get1_EC_KEY() return the referenced key or B<NULL> if | ||
67 | an error occurred. | ||
68 | |||
69 | EVP_PKEY_assign_RSA() EVP_PKEY_assign_DSA(), EVP_PKEY_assign_DH() | ||
70 | and EVP_PKEY_assign_EC_KEY() return 1 for success and 0 for failure. | ||
71 | |||
72 | =head1 SEE ALSO | ||
73 | |||
74 | L<EVP_PKEY_new(3)|EVP_PKEY_new(3)> | ||
75 | |||
76 | =head1 HISTORY | ||
77 | |||
78 | TBA | ||
79 | |||
80 | =cut | ||
diff --git a/src/lib/libcrypto/doc/EVP_SealInit.pod b/src/lib/libcrypto/doc/EVP_SealInit.pod deleted file mode 100644 index 48a0e29954..0000000000 --- a/src/lib/libcrypto/doc/EVP_SealInit.pod +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | EVP_SealInit, EVP_SealUpdate, EVP_SealFinal - EVP envelope encryption | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/evp.h> | ||
10 | |||
11 | int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, | ||
12 | unsigned char **ek, int *ekl, unsigned char *iv, | ||
13 | EVP_PKEY **pubk, int npubk); | ||
14 | int EVP_SealUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
15 | int *outl, unsigned char *in, int inl); | ||
16 | int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
17 | int *outl); | ||
18 | |||
19 | =head1 DESCRIPTION | ||
20 | |||
21 | The EVP envelope routines are a high level interface to envelope | ||
22 | encryption. They generate a random key and IV (if required) then | ||
23 | "envelope" it by using public key encryption. Data can then be | ||
24 | encrypted using this key. | ||
25 | |||
26 | EVP_SealInit() initializes a cipher context B<ctx> for encryption | ||
27 | with cipher B<type> using a random secret key and IV. B<type> is normally | ||
28 | supplied by a function such as EVP_des_cbc(). The secret key is encrypted | ||
29 | using one or more public keys, this allows the same encrypted data to be | ||
30 | decrypted using any of the corresponding private keys. B<ek> is an array of | ||
31 | buffers where the public key encrypted secret key will be written, each buffer | ||
32 | must contain enough room for the corresponding encrypted key: that is | ||
33 | B<ek[i]> must have room for B<EVP_PKEY_size(pubk[i])> bytes. The actual | ||
34 | size of each encrypted secret key is written to the array B<ekl>. B<pubk> is | ||
35 | an array of B<npubk> public keys. | ||
36 | |||
37 | The B<iv> parameter is a buffer where the generated IV is written to. It must | ||
38 | contain enough room for the corresponding cipher's IV, as determined by (for | ||
39 | example) EVP_CIPHER_iv_length(type). | ||
40 | |||
41 | If the cipher does not require an IV then the B<iv> parameter is ignored | ||
42 | and can be B<NULL>. | ||
43 | |||
44 | EVP_SealUpdate() and EVP_SealFinal() have exactly the same properties | ||
45 | as the EVP_EncryptUpdate() and EVP_EncryptFinal() routines, as | ||
46 | documented on the L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> manual | ||
47 | page. | ||
48 | |||
49 | =head1 RETURN VALUES | ||
50 | |||
51 | EVP_SealInit() returns 0 on error or B<npubk> if successful. | ||
52 | |||
53 | EVP_SealUpdate() and EVP_SealFinal() return 1 for success and 0 for | ||
54 | failure. | ||
55 | |||
56 | =head1 NOTES | ||
57 | |||
58 | Because a random secret key is generated the random number generator | ||
59 | must be seeded before calling EVP_SealInit(). | ||
60 | |||
61 | The public key must be RSA because it is the only OpenSSL public key | ||
62 | algorithm that supports key transport. | ||
63 | |||
64 | Envelope encryption is the usual method of using public key encryption | ||
65 | on large amounts of data, this is because public key encryption is slow | ||
66 | but symmetric encryption is fast. So symmetric encryption is used for | ||
67 | bulk encryption and the small random symmetric key used is transferred | ||
68 | using public key encryption. | ||
69 | |||
70 | It is possible to call EVP_SealInit() twice in the same way as | ||
71 | EVP_EncryptInit(). The first call should have B<npubk> set to 0 | ||
72 | and (after setting any cipher parameters) it should be called again | ||
73 | with B<type> set to NULL. | ||
74 | |||
75 | =head1 SEE ALSO | ||
76 | |||
77 | L<evp(3)|evp(3)>, L<rand(3)|rand(3)>, | ||
78 | L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>, | ||
79 | L<EVP_OpenInit(3)|EVP_OpenInit(3)> | ||
80 | |||
81 | =head1 HISTORY | ||
82 | |||
83 | EVP_SealFinal() did not return a value before OpenSSL 0.9.7. | ||
84 | |||
85 | =cut | ||
diff --git a/src/lib/libcrypto/doc/EVP_SignInit.pod b/src/lib/libcrypto/doc/EVP_SignInit.pod deleted file mode 100644 index 0bace24938..0000000000 --- a/src/lib/libcrypto/doc/EVP_SignInit.pod +++ /dev/null | |||
@@ -1,95 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | EVP_SignInit, EVP_SignUpdate, EVP_SignFinal - EVP signing functions | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/evp.h> | ||
10 | |||
11 | int EVP_SignInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); | ||
12 | int EVP_SignUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt); | ||
13 | int EVP_SignFinal(EVP_MD_CTX *ctx,unsigned char *sig,unsigned int *s, EVP_PKEY *pkey); | ||
14 | |||
15 | void EVP_SignInit(EVP_MD_CTX *ctx, const EVP_MD *type); | ||
16 | |||
17 | int EVP_PKEY_size(EVP_PKEY *pkey); | ||
18 | |||
19 | =head1 DESCRIPTION | ||
20 | |||
21 | The EVP signature routines are a high level interface to digital | ||
22 | signatures. | ||
23 | |||
24 | EVP_SignInit_ex() sets up signing context B<ctx> to use digest | ||
25 | B<type> from ENGINE B<impl>. B<ctx> must be initialized with | ||
26 | EVP_MD_CTX_init() before calling this function. | ||
27 | |||
28 | EVP_SignUpdate() hashes B<cnt> bytes of data at B<d> into the | ||
29 | signature context B<ctx>. This function can be called several times on the | ||
30 | same B<ctx> to include additional data. | ||
31 | |||
32 | EVP_SignFinal() signs the data in B<ctx> using the private key B<pkey> and | ||
33 | places the signature in B<sig>. The number of bytes of data written (i.e. the | ||
34 | length of the signature) will be written to the integer at B<s>, at most | ||
35 | EVP_PKEY_size(pkey) bytes will be written. | ||
36 | |||
37 | EVP_SignInit() initializes a signing context B<ctx> to use the default | ||
38 | implementation of digest B<type>. | ||
39 | |||
40 | EVP_PKEY_size() returns the maximum size of a signature in bytes. The actual | ||
41 | signature returned by EVP_SignFinal() may be smaller. | ||
42 | |||
43 | =head1 RETURN VALUES | ||
44 | |||
45 | EVP_SignInit_ex(), EVP_SignUpdate() and EVP_SignFinal() return 1 | ||
46 | for success and 0 for failure. | ||
47 | |||
48 | EVP_PKEY_size() returns the maximum size of a signature in bytes. | ||
49 | |||
50 | The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
51 | |||
52 | =head1 NOTES | ||
53 | |||
54 | The B<EVP> interface to digital signatures should almost always be used in | ||
55 | preference to the low level interfaces. This is because the code then becomes | ||
56 | transparent to the algorithm used and much more flexible. | ||
57 | |||
58 | Due to the link between message digests and public key algorithms the correct | ||
59 | digest algorithm must be used with the correct public key type. A list of | ||
60 | algorithms and associated public key algorithms appears in | ||
61 | L<EVP_DigestInit(3)|EVP_DigestInit(3)>. | ||
62 | |||
63 | When signing with DSA private keys the random number generator must be seeded | ||
64 | or the operation will fail. The random number generator does not need to be | ||
65 | seeded for RSA signatures. | ||
66 | |||
67 | The call to EVP_SignFinal() internally finalizes a copy of the digest context. | ||
68 | This means that calls to EVP_SignUpdate() and EVP_SignFinal() can be called | ||
69 | later to digest and sign additional data. | ||
70 | |||
71 | Since only a copy of the digest context is ever finalized the context must | ||
72 | be cleaned up after use by calling EVP_MD_CTX_cleanup() or a memory leak | ||
73 | will occur. | ||
74 | |||
75 | =head1 BUGS | ||
76 | |||
77 | Older versions of this documentation wrongly stated that calls to | ||
78 | EVP_SignUpdate() could not be made after calling EVP_SignFinal(). | ||
79 | |||
80 | =head1 SEE ALSO | ||
81 | |||
82 | L<EVP_VerifyInit(3)|EVP_VerifyInit(3)>, | ||
83 | L<EVP_DigestInit(3)|EVP_DigestInit(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, | ||
84 | L<evp(3)|evp(3)>, L<HMAC(3)|HMAC(3)>, L<MD2(3)|MD2(3)>, | ||
85 | L<MD5(3)|MD5(3)>, L<MDC2(3)|MDC2(3)>, L<RIPEMD(3)|RIPEMD(3)>, | ||
86 | L<SHA1(3)|SHA1(3)>, L<digest(1)|digest(1)> | ||
87 | |||
88 | =head1 HISTORY | ||
89 | |||
90 | EVP_SignInit(), EVP_SignUpdate() and EVP_SignFinal() are | ||
91 | available in all versions of SSLeay and OpenSSL. | ||
92 | |||
93 | EVP_SignInit_ex() was added in OpenSSL 0.9.7. | ||
94 | |||
95 | =cut | ||
diff --git a/src/lib/libcrypto/doc/EVP_VerifyInit.pod b/src/lib/libcrypto/doc/EVP_VerifyInit.pod deleted file mode 100644 index b6afaedee5..0000000000 --- a/src/lib/libcrypto/doc/EVP_VerifyInit.pod +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | EVP_VerifyInit, EVP_VerifyUpdate, EVP_VerifyFinal - EVP signature verification functions | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/evp.h> | ||
10 | |||
11 | int EVP_VerifyInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); | ||
12 | int EVP_VerifyUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt); | ||
13 | int EVP_VerifyFinal(EVP_MD_CTX *ctx,unsigned char *sigbuf, unsigned int siglen,EVP_PKEY *pkey); | ||
14 | |||
15 | int EVP_VerifyInit(EVP_MD_CTX *ctx, const EVP_MD *type); | ||
16 | |||
17 | =head1 DESCRIPTION | ||
18 | |||
19 | The EVP signature verification routines are a high level interface to digital | ||
20 | signatures. | ||
21 | |||
22 | EVP_VerifyInit_ex() sets up verification context B<ctx> to use digest | ||
23 | B<type> from ENGINE B<impl>. B<ctx> must be initialized by calling | ||
24 | EVP_MD_CTX_init() before calling this function. | ||
25 | |||
26 | EVP_VerifyUpdate() hashes B<cnt> bytes of data at B<d> into the | ||
27 | verification context B<ctx>. This function can be called several times on the | ||
28 | same B<ctx> to include additional data. | ||
29 | |||
30 | EVP_VerifyFinal() verifies the data in B<ctx> using the public key B<pkey> | ||
31 | and against the B<siglen> bytes at B<sigbuf>. | ||
32 | |||
33 | EVP_VerifyInit() initializes verification context B<ctx> to use the default | ||
34 | implementation of digest B<type>. | ||
35 | |||
36 | =head1 RETURN VALUES | ||
37 | |||
38 | EVP_VerifyInit_ex() and EVP_VerifyUpdate() return 1 for success and 0 for | ||
39 | failure. | ||
40 | |||
41 | EVP_VerifyFinal() returns 1 for a correct signature, 0 for failure and -1 if some | ||
42 | other error occurred. | ||
43 | |||
44 | The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
45 | |||
46 | =head1 NOTES | ||
47 | |||
48 | The B<EVP> interface to digital signatures should almost always be used in | ||
49 | preference to the low level interfaces. This is because the code then becomes | ||
50 | transparent to the algorithm used and much more flexible. | ||
51 | |||
52 | Due to the link between message digests and public key algorithms the correct | ||
53 | digest algorithm must be used with the correct public key type. A list of | ||
54 | algorithms and associated public key algorithms appears in | ||
55 | L<EVP_DigestInit(3)|EVP_DigestInit(3)>. | ||
56 | |||
57 | The call to EVP_VerifyFinal() internally finalizes a copy of the digest context. | ||
58 | This means that calls to EVP_VerifyUpdate() and EVP_VerifyFinal() can be called | ||
59 | later to digest and verify additional data. | ||
60 | |||
61 | Since only a copy of the digest context is ever finalized the context must | ||
62 | be cleaned up after use by calling EVP_MD_CTX_cleanup() or a memory leak | ||
63 | will occur. | ||
64 | |||
65 | =head1 BUGS | ||
66 | |||
67 | Older versions of this documentation wrongly stated that calls to | ||
68 | EVP_VerifyUpdate() could not be made after calling EVP_VerifyFinal(). | ||
69 | |||
70 | =head1 SEE ALSO | ||
71 | |||
72 | L<evp(3)|evp(3)>, | ||
73 | L<EVP_SignInit(3)|EVP_SignInit(3)>, | ||
74 | L<EVP_DigestInit(3)|EVP_DigestInit(3)>, L<err(3)|err(3)>, | ||
75 | L<evp(3)|evp(3)>, L<hmac(3)|hmac(3)>, L<md2(3)|md2(3)>, | ||
76 | L<md5(3)|md5(3)>, L<mdc2(3)|mdc2(3)>, L<ripemd(3)|ripemd(3)>, | ||
77 | L<sha(3)|sha(3)>, L<dgst(1)|dgst(1)> | ||
78 | |||
79 | =head1 HISTORY | ||
80 | |||
81 | EVP_VerifyInit(), EVP_VerifyUpdate() and EVP_VerifyFinal() are | ||
82 | available in all versions of SSLeay and OpenSSL. | ||
83 | |||
84 | EVP_VerifyInit_ex() was added in OpenSSL 0.9.7 | ||
85 | |||
86 | =cut | ||
diff --git a/src/lib/libcrypto/doc/OBJ_nid2obj.pod b/src/lib/libcrypto/doc/OBJ_nid2obj.pod deleted file mode 100644 index 7dcc07923f..0000000000 --- a/src/lib/libcrypto/doc/OBJ_nid2obj.pod +++ /dev/null | |||
@@ -1,149 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | OBJ_nid2obj, OBJ_nid2ln, OBJ_nid2sn, OBJ_obj2nid, OBJ_txt2nid, OBJ_ln2nid, OBJ_sn2nid, | ||
6 | OBJ_cmp, OBJ_dup, OBJ_txt2obj, OBJ_obj2txt, OBJ_create, OBJ_cleanup - ASN1 object utility | ||
7 | functions | ||
8 | |||
9 | =head1 SYNOPSIS | ||
10 | |||
11 | ASN1_OBJECT * OBJ_nid2obj(int n); | ||
12 | const char * OBJ_nid2ln(int n); | ||
13 | const char * OBJ_nid2sn(int n); | ||
14 | |||
15 | int OBJ_obj2nid(const ASN1_OBJECT *o); | ||
16 | int OBJ_ln2nid(const char *ln); | ||
17 | int OBJ_sn2nid(const char *sn); | ||
18 | |||
19 | int OBJ_txt2nid(const char *s); | ||
20 | |||
21 | ASN1_OBJECT * OBJ_txt2obj(const char *s, int no_name); | ||
22 | int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name); | ||
23 | |||
24 | int OBJ_cmp(const ASN1_OBJECT *a,const ASN1_OBJECT *b); | ||
25 | ASN1_OBJECT * OBJ_dup(const ASN1_OBJECT *o); | ||
26 | |||
27 | int OBJ_create(const char *oid,const char *sn,const char *ln); | ||
28 | void OBJ_cleanup(void); | ||
29 | |||
30 | =head1 DESCRIPTION | ||
31 | |||
32 | The ASN1 object utility functions process ASN1_OBJECT structures which are | ||
33 | a representation of the ASN1 OBJECT IDENTIFIER (OID) type. | ||
34 | |||
35 | OBJ_nid2obj(), OBJ_nid2ln() and OBJ_nid2sn() convert the NID B<n> to | ||
36 | an ASN1_OBJECT structure, its long name and its short name respectively, | ||
37 | or B<NULL> is an error occurred. | ||
38 | |||
39 | OBJ_obj2nid(), OBJ_ln2nid(), OBJ_sn2nid() return the corresponding NID | ||
40 | for the object B<o>, the long name <ln> or the short name <sn> respectively | ||
41 | or NID_undef if an error occurred. | ||
42 | |||
43 | OBJ_txt2nid() returns NID corresponding to text string <s>. B<s> can be | ||
44 | a long name, a short name or the numerical respresentation of an object. | ||
45 | |||
46 | OBJ_txt2obj() converts the text string B<s> into an ASN1_OBJECT structure. | ||
47 | If B<no_name> is 0 then long names and short names will be interpreted | ||
48 | as well as numerical forms. If B<no_name> is 1 only the numerical form | ||
49 | is acceptable. | ||
50 | |||
51 | OBJ_obj2txt() converts the B<ASN1_OBJECT> B<a> into a textual representation. | ||
52 | The representation is written as a null terminated string to B<buf> | ||
53 | at most B<buf_len> bytes are written, truncating the result if necessary. | ||
54 | The total amount of space required is returned. If B<no_name> is 0 then | ||
55 | if the object has a long or short name then that will be used, otherwise | ||
56 | the numerical form will be used. If B<no_name> is 1 then the numerical | ||
57 | form will always be used. | ||
58 | |||
59 | OBJ_cmp() compares B<a> to B<b>. If the two are identical 0 is returned. | ||
60 | |||
61 | OBJ_dup() returns a copy of B<o>. | ||
62 | |||
63 | OBJ_create() adds a new object to the internal table. B<oid> is the | ||
64 | numerical form of the object, B<sn> the short name and B<ln> the | ||
65 | long name. A new NID is returned for the created object. | ||
66 | |||
67 | OBJ_cleanup() cleans up OpenSSLs internal object table: this should | ||
68 | be called before an application exits if any new objects were added | ||
69 | using OBJ_create(). | ||
70 | |||
71 | =head1 NOTES | ||
72 | |||
73 | Objects in OpenSSL can have a short name, a long name and a numerical | ||
74 | identifier (NID) associated with them. A standard set of objects is | ||
75 | represented in an internal table. The appropriate values are defined | ||
76 | in the header file B<objects.h>. | ||
77 | |||
78 | For example the OID for commonName has the following definitions: | ||
79 | |||
80 | #define SN_commonName "CN" | ||
81 | #define LN_commonName "commonName" | ||
82 | #define NID_commonName 13 | ||
83 | |||
84 | New objects can be added by calling OBJ_create(). | ||
85 | |||
86 | Table objects have certain advantages over other objects: for example | ||
87 | their NIDs can be used in a C language switch statement. They are | ||
88 | also static constant structures which are shared: that is there | ||
89 | is only a single constant structure for each table object. | ||
90 | |||
91 | Objects which are not in the table have the NID value NID_undef. | ||
92 | |||
93 | Objects do not need to be in the internal tables to be processed, | ||
94 | the functions OBJ_txt2obj() and OBJ_obj2txt() can process the numerical | ||
95 | form of an OID. | ||
96 | |||
97 | =head1 EXAMPLES | ||
98 | |||
99 | Create an object for B<commonName>: | ||
100 | |||
101 | ASN1_OBJECT *o; | ||
102 | o = OBJ_nid2obj(NID_commonName); | ||
103 | |||
104 | Check if an object is B<commonName> | ||
105 | |||
106 | if (OBJ_obj2nid(obj) == NID_commonName) | ||
107 | /* Do something */ | ||
108 | |||
109 | Create a new NID and initialize an object from it: | ||
110 | |||
111 | int new_nid; | ||
112 | ASN1_OBJECT *obj; | ||
113 | new_nid = OBJ_create("1.2.3.4", "NewOID", "New Object Identifier"); | ||
114 | |||
115 | obj = OBJ_nid2obj(new_nid); | ||
116 | |||
117 | Create a new object directly: | ||
118 | |||
119 | obj = OBJ_txt2obj("1.2.3.4", 1); | ||
120 | |||
121 | =head1 BUGS | ||
122 | |||
123 | OBJ_obj2txt() is awkward and messy to use: it doesn't follow the | ||
124 | convention of other OpenSSL functions where the buffer can be set | ||
125 | to B<NULL> to determine the amount of data that should be written. | ||
126 | Instead B<buf> must point to a valid buffer and B<buf_len> should | ||
127 | be set to a positive value. A buffer length of 80 should be more | ||
128 | than enough to handle any OID encountered in practice. | ||
129 | |||
130 | =head1 RETURN VALUES | ||
131 | |||
132 | OBJ_nid2obj() returns an B<ASN1_OBJECT> structure or B<NULL> is an | ||
133 | error occurred. | ||
134 | |||
135 | OBJ_nid2ln() and OBJ_nid2sn() returns a valid string or B<NULL> | ||
136 | on error. | ||
137 | |||
138 | OBJ_obj2nid(), OBJ_ln2nid(), OBJ_sn2nid() and OBJ_txt2nid() return | ||
139 | a NID or B<NID_undef> on error. | ||
140 | |||
141 | =head1 SEE ALSO | ||
142 | |||
143 | L<ERR_get_error(3)|ERR_get_error(3)> | ||
144 | |||
145 | =head1 HISTORY | ||
146 | |||
147 | TBA | ||
148 | |||
149 | =cut | ||
diff --git a/src/lib/libcrypto/doc/OPENSSL_VERSION_NUMBER.pod b/src/lib/libcrypto/doc/OPENSSL_VERSION_NUMBER.pod deleted file mode 100644 index c39ac35e78..0000000000 --- a/src/lib/libcrypto/doc/OPENSSL_VERSION_NUMBER.pod +++ /dev/null | |||
@@ -1,101 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | OPENSSL_VERSION_NUMBER, SSLeay, SSLeay_version - get OpenSSL version number | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/opensslv.h> | ||
10 | #define OPENSSL_VERSION_NUMBER 0xnnnnnnnnnL | ||
11 | |||
12 | #include <openssl/crypto.h> | ||
13 | long SSLeay(void); | ||
14 | const char *SSLeay_version(int t); | ||
15 | |||
16 | =head1 DESCRIPTION | ||
17 | |||
18 | OPENSSL_VERSION_NUMBER is a numeric release version identifier: | ||
19 | |||
20 | MMNNFFPPS: major minor fix patch status | ||
21 | |||
22 | The status nibble has one of the values 0 for development, 1 to e for betas | ||
23 | 1 to 14, and f for release. | ||
24 | |||
25 | for example | ||
26 | |||
27 | 0x000906000 == 0.9.6 dev | ||
28 | 0x000906023 == 0.9.6b beta 3 | ||
29 | 0x00090605f == 0.9.6e release | ||
30 | |||
31 | Versions prior to 0.9.3 have identifiers E<lt> 0x0930. | ||
32 | Versions between 0.9.3 and 0.9.5 had a version identifier with this | ||
33 | interpretation: | ||
34 | |||
35 | MMNNFFRBB major minor fix final beta/patch | ||
36 | |||
37 | for example | ||
38 | |||
39 | 0x000904100 == 0.9.4 release | ||
40 | 0x000905000 == 0.9.5 dev | ||
41 | |||
42 | Version 0.9.5a had an interim interpretation that is like the current one, | ||
43 | except the patch level got the highest bit set, to keep continuity. The | ||
44 | number was therefore 0x0090581f. | ||
45 | |||
46 | |||
47 | For backward compatibility, SSLEAY_VERSION_NUMBER is also defined. | ||
48 | |||
49 | SSLeay() returns this number. The return value can be compared to the | ||
50 | macro to make sure that the correct version of the library has been | ||
51 | loaded, especially when using DLLs on Windows systems. | ||
52 | |||
53 | SSLeay_version() returns different strings depending on B<t>: | ||
54 | |||
55 | =over 4 | ||
56 | |||
57 | =item SSLEAY_VERSION | ||
58 | |||
59 | The text variant of the version number and the release date. For example, | ||
60 | "OpenSSL 0.9.5a 1 Apr 2000". | ||
61 | |||
62 | =item SSLEAY_CFLAGS | ||
63 | |||
64 | The compiler flags set for the compilation process in the form | ||
65 | "compiler: ..." if available or "compiler: information not available" | ||
66 | otherwise. | ||
67 | |||
68 | =item SSLEAY_BUILT_ON | ||
69 | |||
70 | The date of the build process in the form "built on: ..." if available | ||
71 | or "built on: date not available" otherwise. | ||
72 | |||
73 | =item SSLEAY_PLATFORM | ||
74 | |||
75 | The "Configure" target of the library build in the form "platform: ..." | ||
76 | if available or "platform: information not available" otherwise. | ||
77 | |||
78 | =item SSLEAY_DIR | ||
79 | |||
80 | The "OPENSSLDIR" setting of the library build in the form "OPENSSLDIR: "..."" | ||
81 | if available or "OPENSSLDIR: N/A" otherwise. | ||
82 | |||
83 | =back | ||
84 | |||
85 | For an unknown B<t>, the text "not available" is returned. | ||
86 | |||
87 | =head1 RETURN VALUE | ||
88 | |||
89 | The version number. | ||
90 | |||
91 | =head1 SEE ALSO | ||
92 | |||
93 | L<crypto(3)|crypto(3)> | ||
94 | |||
95 | =head1 HISTORY | ||
96 | |||
97 | SSLeay() and SSLEAY_VERSION_NUMBER are available in all versions of SSLeay and OpenSSL. | ||
98 | OPENSSL_VERSION_NUMBER is available in all versions of OpenSSL. | ||
99 | B<SSLEAY_DIR> was added in OpenSSL 0.9.7. | ||
100 | |||
101 | =cut | ||
diff --git a/src/lib/libcrypto/doc/OPENSSL_config.pod b/src/lib/libcrypto/doc/OPENSSL_config.pod deleted file mode 100644 index e7bba2aaca..0000000000 --- a/src/lib/libcrypto/doc/OPENSSL_config.pod +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | OPENSSL_config, OPENSSL_no_config - simple OpenSSL configuration functions | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/conf.h> | ||
10 | |||
11 | void OPENSSL_config(const char *config_name); | ||
12 | void OPENSSL_no_config(void); | ||
13 | |||
14 | =head1 DESCRIPTION | ||
15 | |||
16 | OPENSSL_config() configures OpenSSL using the standard B<openssl.cnf> | ||
17 | configuration file name using B<config_name>. If B<config_name> is NULL then | ||
18 | the default name B<openssl_conf> will be used. Any errors are ignored. Further | ||
19 | calls to OPENSSL_config() will have no effect. The configuration file format | ||
20 | is documented in the L<conf(5)|conf(5)> manual page. | ||
21 | |||
22 | OPENSSL_no_config() disables configuration. If called before OPENSSL_config() | ||
23 | no configuration takes place. | ||
24 | |||
25 | =head1 NOTES | ||
26 | |||
27 | It is B<strongly> recommended that B<all> new applications call OPENSSL_config() | ||
28 | or the more sophisticated functions such as CONF_modules_load() during | ||
29 | initialization (that is before starting any threads). By doing this | ||
30 | an application does not need to keep track of all configuration options | ||
31 | and some new functionality can be supported automatically. | ||
32 | |||
33 | It is also possible to automatically call OPENSSL_config() when an application | ||
34 | calls OPENSSL_add_all_algorithms() by compiling an application with the | ||
35 | preprocessor symbol B<OPENSSL_LOAD_CONF> #define'd. In this way configuration | ||
36 | can be added without source changes. | ||
37 | |||
38 | The environment variable B<OPENSSL_CONF> can be set to specify the location | ||
39 | of the configuration file. | ||
40 | |||
41 | Currently ASN1 OBJECTs and ENGINE configuration can be performed future | ||
42 | versions of OpenSSL will add new configuration options. | ||
43 | |||
44 | There are several reasons why calling the OpenSSL configuration routines is | ||
45 | advisable. For example new ENGINE functionality was added to OpenSSL 0.9.7. | ||
46 | In OpenSSL 0.9.7 control functions can be supported by ENGINEs, this can be | ||
47 | used (among other things) to load dynamic ENGINEs from shared libraries (DSOs). | ||
48 | However very few applications currently support the control interface and so | ||
49 | very few can load and use dynamic ENGINEs. Equally in future more sophisticated | ||
50 | ENGINEs will require certain control operations to customize them. If an | ||
51 | application calls OPENSSL_config() it doesn't need to know or care about | ||
52 | ENGINE control operations because they can be performed by editing a | ||
53 | configuration file. | ||
54 | |||
55 | Applications should free up configuration at application closedown by calling | ||
56 | CONF_modules_free(). | ||
57 | |||
58 | =head1 RESTRICTIONS | ||
59 | |||
60 | The OPENSSL_config() function is designed to be a very simple "call it and | ||
61 | forget it" function. As a result its behaviour is somewhat limited. It ignores | ||
62 | all errors silently and it can only load from the standard configuration file | ||
63 | location for example. | ||
64 | |||
65 | It is however B<much> better than nothing. Applications which need finer | ||
66 | control over their configuration functionality should use the configuration | ||
67 | functions such as CONF_load_modules() directly. | ||
68 | |||
69 | =head1 RETURN VALUES | ||
70 | |||
71 | Neither OPENSSL_config() nor OPENSSL_no_config() return a value. | ||
72 | |||
73 | =head1 SEE ALSO | ||
74 | |||
75 | L<conf(5)|conf(5)>, L<CONF_load_modules_file(3)|CONF_load_modules_file(3)>, | ||
76 | L<CONF_modules_free(3),CONF_modules_free(3)> | ||
77 | |||
78 | =head1 HISTORY | ||
79 | |||
80 | OPENSSL_config() and OPENSSL_no_config() first appeared in OpenSSL 0.9.7 | ||
81 | |||
82 | =cut | ||
diff --git a/src/lib/libcrypto/doc/OPENSSL_load_builtin_modules.pod b/src/lib/libcrypto/doc/OPENSSL_load_builtin_modules.pod deleted file mode 100644 index f14dfaf005..0000000000 --- a/src/lib/libcrypto/doc/OPENSSL_load_builtin_modules.pod +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | OPENSSL_load_builtin_modules - add standard configuration modules | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/conf.h> | ||
10 | |||
11 | void OPENSSL_load_builtin_modules(void); | ||
12 | void ASN1_add_oid_module(void); | ||
13 | ENGINE_add_conf_module(); | ||
14 | |||
15 | =head1 DESCRIPTION | ||
16 | |||
17 | The function OPENSSL_load_builtin_modules() adds all the standard OpenSSL | ||
18 | configuration modules to the internal list. They can then be used by the | ||
19 | OpenSSL configuration code. | ||
20 | |||
21 | ASN1_add_oid_module() adds just the ASN1 OBJECT module. | ||
22 | |||
23 | ENGINE_add_conf_module() adds just the ENGINE configuration module. | ||
24 | |||
25 | =head1 NOTES | ||
26 | |||
27 | If the simple configuration function OPENSSL_config() is called then | ||
28 | OPENSSL_load_builtin_modules() is called automatically. | ||
29 | |||
30 | Applications which use the configuration functions directly will need to | ||
31 | call OPENSSL_load_builtin_modules() themselves I<before> any other | ||
32 | configuration code. | ||
33 | |||
34 | Applications should call OPENSSL_load_builtin_modules() to load all | ||
35 | configuration modules instead of adding modules selectively: otherwise | ||
36 | functionality may be missing from the application if an when new | ||
37 | modules are added. | ||
38 | |||
39 | =head1 RETURN VALUE | ||
40 | |||
41 | None of the functions return a value. | ||
42 | |||
43 | =head1 SEE ALSO | ||
44 | |||
45 | L<conf(3)|conf(3)>, L<OPENSSL_config(3)|OPENSSL_config(3)> | ||
46 | |||
47 | =head1 HISTORY | ||
48 | |||
49 | These functions first appeared in OpenSSL 0.9.7. | ||
50 | |||
51 | =cut | ||
diff --git a/src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod b/src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod deleted file mode 100644 index e63411b5bb..0000000000 --- a/src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | OpenSSL_add_all_algorithms, OpenSSL_add_all_ciphers, OpenSSL_add_all_digests - | ||
6 | add algorithms to internal table | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/evp.h> | ||
11 | |||
12 | void OpenSSL_add_all_algorithms(void); | ||
13 | void OpenSSL_add_all_ciphers(void); | ||
14 | void OpenSSL_add_all_digests(void); | ||
15 | |||
16 | void EVP_cleanup(void); | ||
17 | |||
18 | =head1 DESCRIPTION | ||
19 | |||
20 | OpenSSL keeps an internal table of digest algorithms and ciphers. It uses | ||
21 | this table to lookup ciphers via functions such as EVP_get_cipher_byname(). | ||
22 | |||
23 | OpenSSL_add_all_digests() adds all digest algorithms to the table. | ||
24 | |||
25 | OpenSSL_add_all_algorithms() adds all algorithms to the table (digests and | ||
26 | ciphers). | ||
27 | |||
28 | OpenSSL_add_all_ciphers() adds all encryption algorithms to the table including | ||
29 | password based encryption algorithms. | ||
30 | |||
31 | EVP_cleanup() removes all ciphers and digests from the table. | ||
32 | |||
33 | =head1 RETURN VALUES | ||
34 | |||
35 | None of the functions return a value. | ||
36 | |||
37 | =head1 NOTES | ||
38 | |||
39 | A typical application will call OpenSSL_add_all_algorithms() initially and | ||
40 | EVP_cleanup() before exiting. | ||
41 | |||
42 | An application does not need to add algorithms to use them explicitly, for example | ||
43 | by EVP_sha1(). It just needs to add them if it (or any of the functions it calls) | ||
44 | needs to lookup algorithms. | ||
45 | |||
46 | The cipher and digest lookup functions are used in many parts of the library. If | ||
47 | the table is not initialized several functions will misbehave and complain they | ||
48 | cannot find algorithms. This includes the PEM, PKCS#12, SSL and S/MIME libraries. | ||
49 | This is a common query in the OpenSSL mailing lists. | ||
50 | |||
51 | Calling OpenSSL_add_all_algorithms() links in all algorithms: as a result a | ||
52 | statically linked executable can be quite large. If this is important it is possible | ||
53 | to just add the required ciphers and digests. | ||
54 | |||
55 | =head1 BUGS | ||
56 | |||
57 | Although the functions do not return error codes it is possible for them to fail. | ||
58 | This will only happen as a result of a memory allocation failure so this is not | ||
59 | too much of a problem in practice. | ||
60 | |||
61 | =head1 SEE ALSO | ||
62 | |||
63 | L<evp(3)|evp(3)>, L<EVP_DigestInit(3)|EVP_DigestInit(3)>, | ||
64 | L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> | ||
65 | |||
66 | =cut | ||
diff --git a/src/lib/libcrypto/doc/PKCS12_create.pod b/src/lib/libcrypto/doc/PKCS12_create.pod deleted file mode 100644 index 48f3bb8cb8..0000000000 --- a/src/lib/libcrypto/doc/PKCS12_create.pod +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | PKCS12_create - create a PKCS#12 structure | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/pkcs12.h> | ||
10 | |||
11 | PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, STACK_OF(X509) *ca, | ||
12 | int nid_key, int nid_cert, int iter, int mac_iter, int keytype); | ||
13 | |||
14 | =head1 DESCRIPTION | ||
15 | |||
16 | PKCS12_create() creates a PKCS#12 structure. | ||
17 | |||
18 | B<pass> is the passphrase to use. B<name> is the B<friendlyName> to use for | ||
19 | the supplied certifictate and key. B<pkey> is the private key to include in | ||
20 | the structure and B<cert> its corresponding certificates. B<ca>, if not B<NULL> | ||
21 | is an optional set of certificates to also include in the structure. | ||
22 | |||
23 | B<nid_key> and B<nid_cert> are the encryption algorithms that should be used | ||
24 | for the key and certificate respectively. B<iter> is the encryption algorithm | ||
25 | iteration count to use and B<mac_iter> is the MAC iteration count to use. | ||
26 | B<keytype> is the type of key. | ||
27 | |||
28 | =head1 NOTES | ||
29 | |||
30 | The parameters B<nid_key>, B<nid_cert>, B<iter>, B<mac_iter> and B<keytype> | ||
31 | can all be set to zero and sensible defaults will be used. | ||
32 | |||
33 | These defaults are: 40 bit RC2 encryption for certificates, triple DES | ||
34 | encryption for private keys, a key iteration count of PKCS12_DEFAULT_ITER | ||
35 | (currently 2048) and a MAC iteration count of 1. | ||
36 | |||
37 | The default MAC iteration count is 1 in order to retain compatibility with | ||
38 | old software which did not interpret MAC iteration counts. If such compatibility | ||
39 | is not required then B<mac_iter> should be set to PKCS12_DEFAULT_ITER. | ||
40 | |||
41 | B<keytype> adds a flag to the store private key. This is a non standard extension | ||
42 | that is only currently interpreted by MSIE. If set to zero the flag is omitted, | ||
43 | if set to B<KEY_SIG> the key can be used for signing only, if set to B<KEY_EX> | ||
44 | it can be used for signing and encryption. This option was useful for old | ||
45 | export grade software which could use signing only keys of arbitrary size but | ||
46 | had restrictions on the permissible sizes of keys which could be used for | ||
47 | encryption. | ||
48 | |||
49 | =head1 SEE ALSO | ||
50 | |||
51 | L<d2i_PKCS12(3)|d2i_PKCS12(3)> | ||
52 | |||
53 | =head1 HISTORY | ||
54 | |||
55 | PKCS12_create was added in OpenSSL 0.9.3 | ||
56 | |||
57 | =cut | ||
diff --git a/src/lib/libcrypto/doc/PKCS12_parse.pod b/src/lib/libcrypto/doc/PKCS12_parse.pod deleted file mode 100644 index 51344f883a..0000000000 --- a/src/lib/libcrypto/doc/PKCS12_parse.pod +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | PKCS12_parse - parse a PKCS#12 structure | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/pkcs12.h> | ||
10 | |||
11 | int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca); | ||
12 | |||
13 | =head1 DESCRIPTION | ||
14 | |||
15 | PKCS12_parse() parses a PKCS12 structure. | ||
16 | |||
17 | B<p12> is the B<PKCS12> structure to parse. B<pass> is the passphrase to use. | ||
18 | If successful the private key will be written to B<*pkey>, the corresponding | ||
19 | certificate to B<*cert> and any additional certificates to B<*ca>. | ||
20 | |||
21 | =head1 NOTES | ||
22 | |||
23 | The parameters B<pkey> and B<cert> cannot be B<NULL>. B<ca> can be <NULL> | ||
24 | in which case additional certificates will be discarded. B<*ca> can also | ||
25 | be a valid STACK in which case additional certificates are appended to | ||
26 | B<*ca>. If B<*ca> is B<NULL> a new STACK will be allocated. | ||
27 | |||
28 | The B<friendlyName> and B<localKeyID> attributes (if present) on each certificate | ||
29 | will be stored in the B<alias> and B<keyid> attributes of the B<X509> structure. | ||
30 | |||
31 | =head1 BUGS | ||
32 | |||
33 | Only a single private key and corresponding certificate is returned by this function. | ||
34 | More complex PKCS#12 files with multiple private keys will only return the first | ||
35 | match. | ||
36 | |||
37 | Only B<friendlyName> and B<localKeyID> attributes are currently stored in certificates. | ||
38 | Other attributes are discarded. | ||
39 | |||
40 | Attributes currently cannot be store in the private key B<EVP_PKEY> structure. | ||
41 | |||
42 | =head1 SEE ALSO | ||
43 | |||
44 | L<d2i_PKCS12(3)|d2i_PKCS12(3)> | ||
45 | |||
46 | =head1 HISTORY | ||
47 | |||
48 | PKCS12_parse was added in OpenSSL 0.9.3 | ||
49 | |||
50 | =cut | ||
diff --git a/src/lib/libcrypto/doc/PKCS7_decrypt.pod b/src/lib/libcrypto/doc/PKCS7_decrypt.pod deleted file mode 100644 index b0ca067b89..0000000000 --- a/src/lib/libcrypto/doc/PKCS7_decrypt.pod +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | PKCS7_decrypt - decrypt content from a PKCS#7 envelopedData structure | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); | ||
10 | |||
11 | =head1 DESCRIPTION | ||
12 | |||
13 | PKCS7_decrypt() extracts and decrypts the content from a PKCS#7 envelopedData | ||
14 | structure. B<pkey> is the private key of the recipient, B<cert> is the | ||
15 | recipients certificate, B<data> is a BIO to write the content to and | ||
16 | B<flags> is an optional set of flags. | ||
17 | |||
18 | =head1 NOTES | ||
19 | |||
20 | OpenSSL_add_all_algorithms() (or equivalent) should be called before using this | ||
21 | function or errors about unknown algorithms will occur. | ||
22 | |||
23 | Although the recipients certificate is not needed to decrypt the data it is needed | ||
24 | to locate the appropriate (of possible several) recipients in the PKCS#7 structure. | ||
25 | |||
26 | The following flags can be passed in the B<flags> parameter. | ||
27 | |||
28 | If the B<PKCS7_TEXT> flag is set MIME headers for type B<text/plain> are deleted | ||
29 | from the content. If the content is not of type B<text/plain> then an error is | ||
30 | returned. | ||
31 | |||
32 | =head1 RETURN VALUES | ||
33 | |||
34 | PKCS7_decrypt() returns either 1 for success or 0 for failure. | ||
35 | The error can be obtained from ERR_get_error(3) | ||
36 | |||
37 | =head1 BUGS | ||
38 | |||
39 | PKCS7_decrypt() must be passed the correct recipient key and certificate. It would | ||
40 | be better if it could look up the correct key and certificate from a database. | ||
41 | |||
42 | The lack of single pass processing and need to hold all data in memory as | ||
43 | mentioned in PKCS7_sign() also applies to PKCS7_verify(). | ||
44 | |||
45 | =head1 SEE ALSO | ||
46 | |||
47 | L<ERR_get_error(3)|ERR_get_error(3)>, L<PKCS7_encrypt(3)|PKCS7_encrypt(3)> | ||
48 | |||
49 | =head1 HISTORY | ||
50 | |||
51 | PKCS7_decrypt() was added to OpenSSL 0.9.5 | ||
52 | |||
53 | =cut | ||
diff --git a/src/lib/libcrypto/doc/PKCS7_encrypt.pod b/src/lib/libcrypto/doc/PKCS7_encrypt.pod deleted file mode 100644 index 1a507b22a2..0000000000 --- a/src/lib/libcrypto/doc/PKCS7_encrypt.pod +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | PKCS7_encrypt - create a PKCS#7 envelopedData structure | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, int flags); | ||
10 | |||
11 | =head1 DESCRIPTION | ||
12 | |||
13 | PKCS7_encrypt() creates and returns a PKCS#7 envelopedData structure. B<certs> | ||
14 | is a list of recipient certificates. B<in> is the content to be encrypted. | ||
15 | B<cipher> is the symmetric cipher to use. B<flags> is an optional set of flags. | ||
16 | |||
17 | =head1 NOTES | ||
18 | |||
19 | Only RSA keys are supported in PKCS#7 and envelopedData so the recipient certificates | ||
20 | supplied to this function must all contain RSA public keys, though they do not have to | ||
21 | be signed using the RSA algorithm. | ||
22 | |||
23 | EVP_des_ede3_cbc() (triple DES) is the algorithm of choice for S/MIME use because | ||
24 | most clients will support it. | ||
25 | |||
26 | Some old "export grade" clients may only support weak encryption using 40 or 64 bit | ||
27 | RC2. These can be used by passing EVP_rc2_40_cbc() and EVP_rc2_64_cbc() respectively. | ||
28 | |||
29 | The algorithm passed in the B<cipher> parameter must support ASN1 encoding of its | ||
30 | parameters. | ||
31 | |||
32 | Many browsers implement a "sign and encrypt" option which is simply an S/MIME | ||
33 | envelopedData containing an S/MIME signed message. This can be readily produced | ||
34 | by storing the S/MIME signed message in a memory BIO and passing it to | ||
35 | PKCS7_encrypt(). | ||
36 | |||
37 | The following flags can be passed in the B<flags> parameter. | ||
38 | |||
39 | If the B<PKCS7_TEXT> flag is set MIME headers for type B<text/plain> are prepended | ||
40 | to the data. | ||
41 | |||
42 | Normally the supplied content is translated into MIME canonical format (as required | ||
43 | by the S/MIME specifications) if B<PKCS7_BINARY> is set no translation occurs. This | ||
44 | option should be used if the supplied data is in binary format otherwise the translation | ||
45 | will corrupt it. If B<PKCS7_BINARY> is set then B<PKCS7_TEXT> is ignored. | ||
46 | |||
47 | =head1 RETURN VALUES | ||
48 | |||
49 | PKCS7_encrypt() returns either a valid PKCS7 structure or NULL if an error occurred. | ||
50 | The error can be obtained from ERR_get_error(3). | ||
51 | |||
52 | =head1 BUGS | ||
53 | |||
54 | The lack of single pass processing and need to hold all data in memory as | ||
55 | mentioned in PKCS7_sign() also applies to PKCS7_verify(). | ||
56 | |||
57 | =head1 SEE ALSO | ||
58 | |||
59 | L<ERR_get_error(3)|ERR_get_error(3)>, L<PKCS7_decrypt(3)|PKCS7_decrypt(3)> | ||
60 | |||
61 | =head1 HISTORY | ||
62 | |||
63 | PKCS7_decrypt() was added to OpenSSL 0.9.5 | ||
64 | |||
65 | =cut | ||
diff --git a/src/lib/libcrypto/doc/PKCS7_sign.pod b/src/lib/libcrypto/doc/PKCS7_sign.pod deleted file mode 100644 index fc7e649b34..0000000000 --- a/src/lib/libcrypto/doc/PKCS7_sign.pod +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | PKCS7_sign - create a PKCS#7 signedData structure | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, BIO *data, int flags); | ||
10 | |||
11 | =head1 DESCRIPTION | ||
12 | |||
13 | PKCS7_sign() creates and returns a PKCS#7 signedData structure. B<signcert> | ||
14 | is the certificate to sign with, B<pkey> is the corresponsding private key. | ||
15 | B<certs> is an optional additional set of certificates to include in the | ||
16 | PKCS#7 structure (for example any intermediate CAs in the chain). | ||
17 | |||
18 | The data to be signed is read from BIO B<data>. | ||
19 | |||
20 | B<flags> is an optional set of flags. | ||
21 | |||
22 | =head1 NOTES | ||
23 | |||
24 | Any of the following flags (ored together) can be passed in the B<flags> parameter. | ||
25 | |||
26 | Many S/MIME clients expect the signed content to include valid MIME headers. If | ||
27 | the B<PKCS7_TEXT> flag is set MIME headers for type B<text/plain> are prepended | ||
28 | to the data. | ||
29 | |||
30 | If B<PKCS7_NOCERTS> is set the signer's certificate will not be included in the | ||
31 | PKCS7 structure, the signer's certificate must still be supplied in the B<signcert> | ||
32 | parameter though. This can reduce the size of the signature if the signers certificate | ||
33 | can be obtained by other means: for example a previously signed message. | ||
34 | |||
35 | The data being signed is included in the PKCS7 structure, unless B<PKCS7_DETACHED> | ||
36 | is set in which case it is omitted. This is used for PKCS7 detached signatures | ||
37 | which are used in S/MIME plaintext signed messages for example. | ||
38 | |||
39 | Normally the supplied content is translated into MIME canonical format (as required | ||
40 | by the S/MIME specifications) if B<PKCS7_BINARY> is set no translation occurs. This | ||
41 | option should be used if the supplied data is in binary format otherwise the translation | ||
42 | will corrupt it. | ||
43 | |||
44 | The signedData structure includes several PKCS#7 autenticatedAttributes including | ||
45 | the signing time, the PKCS#7 content type and the supported list of ciphers in | ||
46 | an SMIMECapabilities attribute. If B<PKCS7_NOATTR> is set then no authenticatedAttributes | ||
47 | will be used. If B<PKCS7_NOSMIMECAP> is set then just the SMIMECapabilities are | ||
48 | omitted. | ||
49 | |||
50 | If present the SMIMECapabilities attribute indicates support for the following | ||
51 | algorithms: triple DES, 128 bit RC2, 64 bit RC2, DES and 40 bit RC2. If any | ||
52 | of these algorithms is disabled then it will not be included. | ||
53 | |||
54 | =head1 BUGS | ||
55 | |||
56 | PKCS7_sign() is somewhat limited. It does not support multiple signers, some | ||
57 | advanced attributes such as counter signatures are not supported. | ||
58 | |||
59 | The SHA1 digest algorithm is currently always used. | ||
60 | |||
61 | When the signed data is not detached it will be stored in memory within the | ||
62 | B<PKCS7> structure. This effectively limits the size of messages which can be | ||
63 | signed due to memory restraints. There should be a way to sign data without | ||
64 | having to hold it all in memory, this would however require fairly major | ||
65 | revisions of the OpenSSL ASN1 code. | ||
66 | |||
67 | Clear text signing does not store the content in memory but the way PKCS7_sign() | ||
68 | operates means that two passes of the data must typically be made: one to compute | ||
69 | the signatures and a second to output the data along with the signature. There | ||
70 | should be a way to process the data with only a single pass. | ||
71 | |||
72 | =head1 RETURN VALUES | ||
73 | |||
74 | PKCS7_sign() returns either a valid PKCS7 structure or NULL if an error occurred. | ||
75 | The error can be obtained from ERR_get_error(3). | ||
76 | |||
77 | =head1 SEE ALSO | ||
78 | |||
79 | L<ERR_get_error(3)|ERR_get_error(3)>, L<PKCS7_verify(3)|PKCS7_verify(3)> | ||
80 | |||
81 | =head1 HISTORY | ||
82 | |||
83 | PKCS7_sign() was added to OpenSSL 0.9.5 | ||
84 | |||
85 | =cut | ||
diff --git a/src/lib/libcrypto/doc/PKCS7_verify.pod b/src/lib/libcrypto/doc/PKCS7_verify.pod deleted file mode 100644 index 3490b5dc82..0000000000 --- a/src/lib/libcrypto/doc/PKCS7_verify.pod +++ /dev/null | |||
@@ -1,116 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | PKCS7_verify - verify a PKCS#7 signedData structure | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, BIO *indata, BIO *out, int flags); | ||
10 | |||
11 | STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags); | ||
12 | |||
13 | =head1 DESCRIPTION | ||
14 | |||
15 | PKCS7_verify() verifies a PKCS#7 signedData structure. B<p7> is the PKCS7 | ||
16 | structure to verify. B<certs> is a set of certificates in which to search for | ||
17 | the signer's certificate. B<store> is a trusted certficate store (used for | ||
18 | chain verification). B<indata> is the signed data if the content is not | ||
19 | present in B<p7> (that is it is detached). The content is written to B<out> | ||
20 | if it is not NULL. | ||
21 | |||
22 | B<flags> is an optional set of flags, which can be used to modify the verify | ||
23 | operation. | ||
24 | |||
25 | PKCS7_get0_signers() retrieves the signer's certificates from B<p7>, it does | ||
26 | B<not> check their validity or whether any signatures are valid. The B<certs> | ||
27 | and B<flags> parameters have the same meanings as in PKCS7_verify(). | ||
28 | |||
29 | =head1 VERIFY PROCESS | ||
30 | |||
31 | Normally the verify process proceeds as follows. | ||
32 | |||
33 | Initially some sanity checks are performed on B<p7>. The type of B<p7> must | ||
34 | be signedData. There must be at least one signature on the data and if | ||
35 | the content is detached B<indata> cannot be B<NULL>. | ||
36 | |||
37 | An attempt is made to locate all the signer's certificates, first looking in | ||
38 | the B<certs> parameter (if it is not B<NULL>) and then looking in any certificates | ||
39 | contained in the B<p7> structure itself. If any signer's certificates cannot be | ||
40 | located the operation fails. | ||
41 | |||
42 | Each signer's certificate is chain verified using the B<smimesign> purpose and | ||
43 | the supplied trusted certificate store. Any internal certificates in the message | ||
44 | are used as untrusted CAs. If any chain verify fails an error code is returned. | ||
45 | |||
46 | Finally the signed content is read (and written to B<out> is it is not NULL) and | ||
47 | the signature's checked. | ||
48 | |||
49 | If all signature's verify correctly then the function is successful. | ||
50 | |||
51 | Any of the following flags (ored together) can be passed in the B<flags> parameter | ||
52 | to change the default verify behaviour. Only the flag B<PKCS7_NOINTERN> is | ||
53 | meaningful to PKCS7_get0_signers(). | ||
54 | |||
55 | If B<PKCS7_NOINTERN> is set the certificates in the message itself are not | ||
56 | searched when locating the signer's certificate. This means that all the signers | ||
57 | certificates must be in the B<certs> parameter. | ||
58 | |||
59 | If the B<PKCS7_TEXT> flag is set MIME headers for type B<text/plain> are deleted | ||
60 | from the content. If the content is not of type B<text/plain> then an error is | ||
61 | returned. | ||
62 | |||
63 | If B<PKCS7_NOVERIFY> is set the signer's certificates are not chain verified. | ||
64 | |||
65 | If B<PKCS7_NOCHAIN> is set then the certificates contained in the message are | ||
66 | not used as untrusted CAs. This means that the whole verify chain (apart from | ||
67 | the signer's certificate) must be contained in the trusted store. | ||
68 | |||
69 | If B<PKCS7_NOSIGS> is set then the signatures on the data are not checked. | ||
70 | |||
71 | =head1 NOTES | ||
72 | |||
73 | One application of B<PKCS7_NOINTERN> is to only accept messages signed by | ||
74 | a small number of certificates. The acceptable certificates would be passed | ||
75 | in the B<certs> parameter. In this case if the signer is not one of the | ||
76 | certificates supplied in B<certs> then the verify will fail because the | ||
77 | signer cannot be found. | ||
78 | |||
79 | Care should be taken when modifying the default verify behaviour, for example | ||
80 | setting B<PKCS7_NOVERIFY|PKCS7_NOSIGS> will totally disable all verification | ||
81 | and any signed message will be considered valid. This combination is however | ||
82 | useful if one merely wishes to write the content to B<out> and its validity | ||
83 | is not considered important. | ||
84 | |||
85 | Chain verification should arguably be performed using the signing time rather | ||
86 | than the current time. However since the signing time is supplied by the | ||
87 | signer it cannot be trusted without additional evidence (such as a trusted | ||
88 | timestamp). | ||
89 | |||
90 | =head1 RETURN VALUES | ||
91 | |||
92 | PKCS7_verify() returns 1 for a successful verification and zero or a negative | ||
93 | value if an error occurs. | ||
94 | |||
95 | PKCS7_get0_signers() returns all signers or B<NULL> if an error occurred. | ||
96 | |||
97 | The error can be obtained from L<ERR_get_error(3)|ERR_get_error(3)> | ||
98 | |||
99 | =head1 BUGS | ||
100 | |||
101 | The trusted certificate store is not searched for the signers certificate, | ||
102 | this is primarily due to the inadequacies of the current B<X509_STORE> | ||
103 | functionality. | ||
104 | |||
105 | The lack of single pass processing and need to hold all data in memory as | ||
106 | mentioned in PKCS7_sign() also applies to PKCS7_verify(). | ||
107 | |||
108 | =head1 SEE ALSO | ||
109 | |||
110 | L<ERR_get_error(3)|ERR_get_error(3)>, L<PKCS7_sign(3)|PKCS7_sign(3)> | ||
111 | |||
112 | =head1 HISTORY | ||
113 | |||
114 | PKCS7_verify() was added to OpenSSL 0.9.5 | ||
115 | |||
116 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RAND_add.pod b/src/lib/libcrypto/doc/RAND_add.pod deleted file mode 100644 index 67c66f3e0c..0000000000 --- a/src/lib/libcrypto/doc/RAND_add.pod +++ /dev/null | |||
@@ -1,77 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RAND_add, RAND_seed, RAND_status, RAND_event, RAND_screen - add | ||
6 | entropy to the PRNG | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/rand.h> | ||
11 | |||
12 | void RAND_seed(const void *buf, int num); | ||
13 | |||
14 | void RAND_add(const void *buf, int num, double entropy); | ||
15 | |||
16 | int RAND_status(void); | ||
17 | |||
18 | int RAND_event(UINT iMsg, WPARAM wParam, LPARAM lParam); | ||
19 | void RAND_screen(void); | ||
20 | |||
21 | =head1 DESCRIPTION | ||
22 | |||
23 | RAND_add() mixes the B<num> bytes at B<buf> into the PRNG state. Thus, | ||
24 | if the data at B<buf> are unpredictable to an adversary, this | ||
25 | increases the uncertainty about the state and makes the PRNG output | ||
26 | less predictable. Suitable input comes from user interaction (random | ||
27 | key presses, mouse movements) and certain hardware events. The | ||
28 | B<entropy> argument is (the lower bound of) an estimate of how much | ||
29 | randomness is contained in B<buf>, measured in bytes. Details about | ||
30 | sources of randomness and how to estimate their entropy can be found | ||
31 | in the literature, e.g. RFC 1750. | ||
32 | |||
33 | RAND_add() may be called with sensitive data such as user entered | ||
34 | passwords. The seed values cannot be recovered from the PRNG output. | ||
35 | |||
36 | OpenSSL makes sure that the PRNG state is unique for each thread. On | ||
37 | systems that provide C</dev/urandom>, the randomness device is used | ||
38 | to seed the PRNG transparently. However, on all other systems, the | ||
39 | application is responsible for seeding the PRNG by calling RAND_add(), | ||
40 | L<RAND_egd(3)|RAND_egd(3)> | ||
41 | or L<RAND_load_file(3)|RAND_load_file(3)>. | ||
42 | |||
43 | RAND_seed() is equivalent to RAND_add() when B<num == entropy>. | ||
44 | |||
45 | RAND_event() collects the entropy from Windows events such as mouse | ||
46 | movements and other user interaction. It should be called with the | ||
47 | B<iMsg>, B<wParam> and B<lParam> arguments of I<all> messages sent to | ||
48 | the window procedure. It will estimate the entropy contained in the | ||
49 | event message (if any), and add it to the PRNG. The program can then | ||
50 | process the messages as usual. | ||
51 | |||
52 | The RAND_screen() function is available for the convenience of Windows | ||
53 | programmers. It adds the current contents of the screen to the PRNG. | ||
54 | For applications that can catch Windows events, seeding the PRNG by | ||
55 | calling RAND_event() is a significantly better source of | ||
56 | randomness. It should be noted that both methods cannot be used on | ||
57 | servers that run without user interaction. | ||
58 | |||
59 | =head1 RETURN VALUES | ||
60 | |||
61 | RAND_status() and RAND_event() return 1 if the PRNG has been seeded | ||
62 | with enough data, 0 otherwise. | ||
63 | |||
64 | The other functions do not return values. | ||
65 | |||
66 | =head1 SEE ALSO | ||
67 | |||
68 | L<rand(3)|rand(3)>, L<RAND_egd(3)|RAND_egd(3)>, | ||
69 | L<RAND_load_file(3)|RAND_load_file(3)>, L<RAND_cleanup(3)|RAND_cleanup(3)> | ||
70 | |||
71 | =head1 HISTORY | ||
72 | |||
73 | RAND_seed() and RAND_screen() are available in all versions of SSLeay | ||
74 | and OpenSSL. RAND_add() and RAND_status() have been added in OpenSSL | ||
75 | 0.9.5, RAND_event() in OpenSSL 0.9.5a. | ||
76 | |||
77 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RAND_bytes.pod b/src/lib/libcrypto/doc/RAND_bytes.pod deleted file mode 100644 index ce6329ce54..0000000000 --- a/src/lib/libcrypto/doc/RAND_bytes.pod +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RAND_bytes, RAND_pseudo_bytes - generate random data | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/rand.h> | ||
10 | |||
11 | int RAND_bytes(unsigned char *buf, int num); | ||
12 | |||
13 | int RAND_pseudo_bytes(unsigned char *buf, int num); | ||
14 | |||
15 | =head1 DESCRIPTION | ||
16 | |||
17 | RAND_bytes() puts B<num> cryptographically strong pseudo-random bytes | ||
18 | into B<buf>. An error occurs if the PRNG has not been seeded with | ||
19 | enough randomness to ensure an unpredictable byte sequence. | ||
20 | |||
21 | RAND_pseudo_bytes() puts B<num> pseudo-random bytes into B<buf>. | ||
22 | Pseudo-random byte sequences generated by RAND_pseudo_bytes() will be | ||
23 | unique if they are of sufficient length, but are not necessarily | ||
24 | unpredictable. They can be used for non-cryptographic purposes and for | ||
25 | certain purposes in cryptographic protocols, but usually not for key | ||
26 | generation etc. | ||
27 | |||
28 | =head1 RETURN VALUES | ||
29 | |||
30 | RAND_bytes() returns 1 on success, 0 otherwise. The error code can be | ||
31 | obtained by L<ERR_get_error(3)|ERR_get_error(3)>. RAND_pseudo_bytes() returns 1 if the | ||
32 | bytes generated are cryptographically strong, 0 otherwise. Both | ||
33 | functions return -1 if they are not supported by the current RAND | ||
34 | method. | ||
35 | |||
36 | =head1 SEE ALSO | ||
37 | |||
38 | L<rand(3)|rand(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, | ||
39 | L<RAND_add(3)|RAND_add(3)> | ||
40 | |||
41 | =head1 HISTORY | ||
42 | |||
43 | RAND_bytes() is available in all versions of SSLeay and OpenSSL. It | ||
44 | has a return value since OpenSSL 0.9.5. RAND_pseudo_bytes() was added | ||
45 | in OpenSSL 0.9.5. | ||
46 | |||
47 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RAND_cleanup.pod b/src/lib/libcrypto/doc/RAND_cleanup.pod deleted file mode 100644 index 3a8f0749a8..0000000000 --- a/src/lib/libcrypto/doc/RAND_cleanup.pod +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RAND_cleanup - erase the PRNG state | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/rand.h> | ||
10 | |||
11 | void RAND_cleanup(void); | ||
12 | |||
13 | =head1 DESCRIPTION | ||
14 | |||
15 | RAND_cleanup() erases the memory used by the PRNG. | ||
16 | |||
17 | =head1 RETURN VALUE | ||
18 | |||
19 | RAND_cleanup() returns no value. | ||
20 | |||
21 | =head1 SEE ALSO | ||
22 | |||
23 | L<rand(3)|rand(3)> | ||
24 | |||
25 | =head1 HISTORY | ||
26 | |||
27 | RAND_cleanup() is available in all versions of SSLeay and OpenSSL. | ||
28 | |||
29 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RAND_load_file.pod b/src/lib/libcrypto/doc/RAND_load_file.pod deleted file mode 100644 index d8c134e621..0000000000 --- a/src/lib/libcrypto/doc/RAND_load_file.pod +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RAND_load_file, RAND_write_file, RAND_file_name - PRNG seed file | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/rand.h> | ||
10 | |||
11 | const char *RAND_file_name(char *buf, size_t num); | ||
12 | |||
13 | int RAND_load_file(const char *filename, long max_bytes); | ||
14 | |||
15 | int RAND_write_file(const char *filename); | ||
16 | |||
17 | =head1 DESCRIPTION | ||
18 | |||
19 | RAND_file_name() generates a default path for the random seed | ||
20 | file. B<buf> points to a buffer of size B<num> in which to store the | ||
21 | filename. The seed file is $RANDFILE if that environment variable is | ||
22 | set, $HOME/.rnd otherwise. If $HOME is not set either, or B<num> is | ||
23 | too small for the path name, an error occurs. | ||
24 | |||
25 | RAND_load_file() reads a number of bytes from file B<filename> and | ||
26 | adds them to the PRNG. If B<max_bytes> is non-negative, | ||
27 | up to to B<max_bytes> are read; starting with OpenSSL 0.9.5, | ||
28 | if B<max_bytes> is -1, the complete file is read. | ||
29 | |||
30 | RAND_write_file() writes a number of random bytes (currently 1024) to | ||
31 | file B<filename> which can be used to initialize the PRNG by calling | ||
32 | RAND_load_file() in a later session. | ||
33 | |||
34 | =head1 RETURN VALUES | ||
35 | |||
36 | RAND_load_file() returns the number of bytes read. | ||
37 | |||
38 | RAND_write_file() returns the number of bytes written, and -1 if the | ||
39 | bytes written were generated without appropriate seed. | ||
40 | |||
41 | RAND_file_name() returns a pointer to B<buf> on success, and NULL on | ||
42 | error. | ||
43 | |||
44 | =head1 SEE ALSO | ||
45 | |||
46 | L<rand(3)|rand(3)>, L<RAND_add(3)|RAND_add(3)>, L<RAND_cleanup(3)|RAND_cleanup(3)> | ||
47 | |||
48 | =head1 HISTORY | ||
49 | |||
50 | RAND_load_file(), RAND_write_file() and RAND_file_name() are available in | ||
51 | all versions of SSLeay and OpenSSL. | ||
52 | |||
53 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RAND_set_rand_method.pod b/src/lib/libcrypto/doc/RAND_set_rand_method.pod deleted file mode 100644 index c9bb6d9f27..0000000000 --- a/src/lib/libcrypto/doc/RAND_set_rand_method.pod +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RAND_set_rand_method, RAND_get_rand_method, RAND_SSLeay - select RAND method | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/rand.h> | ||
10 | |||
11 | void RAND_set_rand_method(const RAND_METHOD *meth); | ||
12 | |||
13 | const RAND_METHOD *RAND_get_rand_method(void); | ||
14 | |||
15 | RAND_METHOD *RAND_SSLeay(void); | ||
16 | |||
17 | =head1 DESCRIPTION | ||
18 | |||
19 | A B<RAND_METHOD> specifies the functions that OpenSSL uses for random number | ||
20 | generation. By modifying the method, alternative implementations such as | ||
21 | hardware RNGs may be used. IMPORTANT: See the NOTES section for important | ||
22 | information about how these RAND API functions are affected by the use of | ||
23 | B<ENGINE> API calls. | ||
24 | |||
25 | Initially, the default RAND_METHOD is the OpenSSL internal implementation, as | ||
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. | ||
35 | |||
36 | =head1 THE RAND_METHOD STRUCTURE | ||
37 | |||
38 | typedef struct rand_meth_st | ||
39 | { | ||
40 | void (*seed)(const void *buf, int num); | ||
41 | int (*bytes)(unsigned char *buf, int num); | ||
42 | void (*cleanup)(void); | ||
43 | void (*add)(const void *buf, int num, int entropy); | ||
44 | int (*pseudorand)(unsigned char *buf, int num); | ||
45 | int (*status)(void); | ||
46 | } RAND_METHOD; | ||
47 | |||
48 | The components point to the implementation of RAND_seed(), | ||
49 | RAND_bytes(), RAND_cleanup(), RAND_add(), RAND_pseudo_rand() | ||
50 | and RAND_status(). | ||
51 | Each component may be NULL if the function is not implemented. | ||
52 | |||
53 | =head1 RETURN VALUES | ||
54 | |||
55 | RAND_set_rand_method() returns no value. RAND_get_rand_method() and | ||
56 | RAND_SSLeay() return pointers to the respective methods. | ||
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 | |||
68 | =head1 SEE ALSO | ||
69 | |||
70 | L<rand(3)|rand(3)>, L<engine(3)|engine(3)> | ||
71 | |||
72 | =head1 HISTORY | ||
73 | |||
74 | RAND_set_rand_method(), RAND_get_rand_method() and RAND_SSLeay() are | ||
75 | available in all versions of OpenSSL. | ||
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 | |||
83 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RSA_blinding_on.pod b/src/lib/libcrypto/doc/RSA_blinding_on.pod deleted file mode 100644 index fd2c69abd8..0000000000 --- a/src/lib/libcrypto/doc/RSA_blinding_on.pod +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RSA_blinding_on, RSA_blinding_off - protect the RSA operation from timing attacks | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/rsa.h> | ||
10 | |||
11 | int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); | ||
12 | |||
13 | void RSA_blinding_off(RSA *rsa); | ||
14 | |||
15 | =head1 DESCRIPTION | ||
16 | |||
17 | RSA is vulnerable to timing attacks. In a setup where attackers can | ||
18 | measure the time of RSA decryption or signature operations, blinding | ||
19 | must be used to protect the RSA operation from that attack. | ||
20 | |||
21 | RSA_blinding_on() turns blinding on for key B<rsa> and generates a | ||
22 | random blinding factor. B<ctx> is B<NULL> or a pre-allocated and | ||
23 | initialized B<BN_CTX>. The random number generator must be seeded | ||
24 | prior to calling RSA_blinding_on(). | ||
25 | |||
26 | RSA_blinding_off() turns blinding off and frees the memory used for | ||
27 | the blinding factor. | ||
28 | |||
29 | =head1 RETURN VALUES | ||
30 | |||
31 | RSA_blinding_on() returns 1 on success, and 0 if an error occurred. | ||
32 | |||
33 | RSA_blinding_off() returns no value. | ||
34 | |||
35 | =head1 SEE ALSO | ||
36 | |||
37 | L<rsa(3)|rsa(3)>, L<rand(3)|rand(3)> | ||
38 | |||
39 | =head1 HISTORY | ||
40 | |||
41 | RSA_blinding_on() and RSA_blinding_off() appeared in SSLeay 0.9.0. | ||
42 | |||
43 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RSA_check_key.pod b/src/lib/libcrypto/doc/RSA_check_key.pod deleted file mode 100644 index a5198f3db5..0000000000 --- a/src/lib/libcrypto/doc/RSA_check_key.pod +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RSA_check_key - validate private RSA keys | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/rsa.h> | ||
10 | |||
11 | int RSA_check_key(RSA *rsa); | ||
12 | |||
13 | =head1 DESCRIPTION | ||
14 | |||
15 | This function validates RSA keys. It checks that B<p> and B<q> are | ||
16 | in fact prime, and that B<n = p*q>. | ||
17 | |||
18 | It also checks that B<d*e = 1 mod (p-1*q-1)>, | ||
19 | and that B<dmp1>, B<dmq1> and B<iqmp> are set correctly or are B<NULL>. | ||
20 | |||
21 | As such, this function can not be used with any arbitrary RSA key object, | ||
22 | even if it is otherwise fit for regular RSA operation. See B<NOTES> for more | ||
23 | information. | ||
24 | |||
25 | =head1 RETURN VALUE | ||
26 | |||
27 | RSA_check_key() returns 1 if B<rsa> is a valid RSA key, and 0 otherwise. | ||
28 | -1 is returned if an error occurs while checking the key. | ||
29 | |||
30 | If the key is invalid or an error occurred, the reason code can be | ||
31 | obtained using L<ERR_get_error(3)|ERR_get_error(3)>. | ||
32 | |||
33 | =head1 NOTES | ||
34 | |||
35 | This function does not work on RSA public keys that have only the modulus | ||
36 | and public exponent elements populated. It performs integrity checks on all | ||
37 | the RSA key material, so the RSA key structure must contain all the private | ||
38 | key data too. | ||
39 | |||
40 | Unlike most other RSA functions, this function does B<not> work | ||
41 | transparently with any underlying ENGINE implementation because it uses the | ||
42 | key data in the RSA structure directly. An ENGINE implementation can | ||
43 | override the way key data is stored and handled, and can even provide | ||
44 | support for HSM keys - in which case the RSA structure may contain B<no> | ||
45 | key data at all! If the ENGINE in question is only being used for | ||
46 | acceleration or analysis purposes, then in all likelihood the RSA key data | ||
47 | is complete and untouched, but this can't be assumed in the general case. | ||
48 | |||
49 | =head1 BUGS | ||
50 | |||
51 | A method of verifying the RSA key using opaque RSA API functions might need | ||
52 | to be considered. Right now RSA_check_key() simply uses the RSA structure | ||
53 | elements directly, bypassing the RSA_METHOD table altogether (and | ||
54 | completely violating encapsulation and object-orientation in the process). | ||
55 | The best fix will probably be to introduce a "check_key()" handler to the | ||
56 | RSA_METHOD function table so that alternative implementations can also | ||
57 | provide their own verifiers. | ||
58 | |||
59 | =head1 SEE ALSO | ||
60 | |||
61 | L<rsa(3)|rsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)> | ||
62 | |||
63 | =head1 HISTORY | ||
64 | |||
65 | RSA_check_key() appeared in OpenSSL 0.9.4. | ||
66 | |||
67 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RSA_generate_key.pod b/src/lib/libcrypto/doc/RSA_generate_key.pod deleted file mode 100644 index 52dbb14a53..0000000000 --- a/src/lib/libcrypto/doc/RSA_generate_key.pod +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RSA_generate_key - generate RSA key pair | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/rsa.h> | ||
10 | |||
11 | RSA *RSA_generate_key(int num, unsigned long e, | ||
12 | void (*callback)(int,int,void *), void *cb_arg); | ||
13 | |||
14 | =head1 DESCRIPTION | ||
15 | |||
16 | RSA_generate_key() generates a key pair and returns it in a newly | ||
17 | allocated B<RSA> structure. The pseudo-random number generator must | ||
18 | be seeded prior to calling RSA_generate_key(). | ||
19 | |||
20 | The modulus size will be B<num> bits, and the public exponent will be | ||
21 | B<e>. Key sizes with B<num> E<lt> 1024 should be considered insecure. | ||
22 | The exponent is an odd number, typically 3, 17 or 65537. | ||
23 | |||
24 | A callback function may be used to provide feedback about the | ||
25 | progress of the key generation. If B<callback> is not B<NULL>, it | ||
26 | will be called as follows: | ||
27 | |||
28 | =over 4 | ||
29 | |||
30 | =item * | ||
31 | |||
32 | While a random prime number is generated, it is called as | ||
33 | described in L<BN_generate_prime(3)|BN_generate_prime(3)>. | ||
34 | |||
35 | =item * | ||
36 | |||
37 | When the n-th randomly generated prime is rejected as not | ||
38 | suitable for the key, B<callback(2, n, cb_arg)> is called. | ||
39 | |||
40 | =item * | ||
41 | |||
42 | When a random p has been found with p-1 relatively prime to B<e>, | ||
43 | it is called as B<callback(3, 0, cb_arg)>. | ||
44 | |||
45 | =back | ||
46 | |||
47 | The process is then repeated for prime q with B<callback(3, 1, cb_arg)>. | ||
48 | |||
49 | =head1 RETURN VALUE | ||
50 | |||
51 | If key generation fails, RSA_generate_key() returns B<NULL>; the | ||
52 | error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
53 | |||
54 | =head1 BUGS | ||
55 | |||
56 | B<callback(2, x, cb_arg)> is used with two different meanings. | ||
57 | |||
58 | RSA_generate_key() goes into an infinite loop for illegal input values. | ||
59 | |||
60 | =head1 SEE ALSO | ||
61 | |||
62 | L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, | ||
63 | L<RSA_free(3)|RSA_free(3)> | ||
64 | |||
65 | =head1 HISTORY | ||
66 | |||
67 | The B<cb_arg> argument was added in SSLeay 0.9.0. | ||
68 | |||
69 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod b/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod deleted file mode 100644 index 46cc8f5359..0000000000 --- a/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod +++ /dev/null | |||
@@ -1,120 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data - add application specific data to RSA structures | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/rsa.h> | ||
10 | |||
11 | int RSA_get_ex_new_index(long argl, void *argp, | ||
12 | CRYPTO_EX_new *new_func, | ||
13 | CRYPTO_EX_dup *dup_func, | ||
14 | CRYPTO_EX_free *free_func); | ||
15 | |||
16 | int RSA_set_ex_data(RSA *r, int idx, void *arg); | ||
17 | |||
18 | void *RSA_get_ex_data(RSA *r, int idx); | ||
19 | |||
20 | typedef int new_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad, | ||
21 | int idx, long argl, void *argp); | ||
22 | typedef void free_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad, | ||
23 | int idx, long argl, void *argp); | ||
24 | typedef int dup_func(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d, | ||
25 | int idx, long argl, void *argp); | ||
26 | |||
27 | =head1 DESCRIPTION | ||
28 | |||
29 | Several OpenSSL structures can have application specific data attached to them. | ||
30 | This has several potential uses, it can be used to cache data associated with | ||
31 | a structure (for example the hash of some part of the structure) or some | ||
32 | additional data (for example a handle to the data in an external library). | ||
33 | |||
34 | Since the application data can be anything at all it is passed and retrieved | ||
35 | as a B<void *> type. | ||
36 | |||
37 | The B<RSA_get_ex_new_index()> function is initially called to "register" some | ||
38 | new application specific data. It takes three optional function pointers which | ||
39 | are called when the parent structure (in this case an RSA structure) is | ||
40 | initially created, when it is copied and when it is freed up. If any or all of | ||
41 | these function pointer arguments are not used they should be set to NULL. The | ||
42 | precise manner in which these function pointers are called is described in more | ||
43 | detail below. B<RSA_get_ex_new_index()> also takes additional long and pointer | ||
44 | parameters which will be passed to the supplied functions but which otherwise | ||
45 | have no special meaning. It returns an B<index> which should be stored | ||
46 | (typically in a static variable) and passed used in the B<idx> parameter in | ||
47 | the remaining functions. Each successful call to B<RSA_get_ex_new_index()> | ||
48 | will return an index greater than any previously returned, this is important | ||
49 | because the optional functions are called in order of increasing index value. | ||
50 | |||
51 | B<RSA_set_ex_data()> is used to set application specific data, the data is | ||
52 | supplied in the B<arg> parameter and its precise meaning is up to the | ||
53 | application. | ||
54 | |||
55 | B<RSA_get_ex_data()> is used to retrieve application specific data. The data | ||
56 | is returned to the application, this will be the same value as supplied to | ||
57 | a previous B<RSA_set_ex_data()> call. | ||
58 | |||
59 | B<new_func()> is called when a structure is initially allocated (for example | ||
60 | with B<RSA_new()>. The parent structure members will not have any meaningful | ||
61 | values at this point. This function will typically be used to allocate any | ||
62 | application specific structure. | ||
63 | |||
64 | B<free_func()> is called when a structure is being freed up. The dynamic parent | ||
65 | structure members should not be accessed because they will be freed up when | ||
66 | this function is called. | ||
67 | |||
68 | B<new_func()> and B<free_func()> take the same parameters. B<parent> is a | ||
69 | pointer to the parent RSA structure. B<ptr> is a the application specific data | ||
70 | (this wont be of much use in B<new_func()>. B<ad> is a pointer to the | ||
71 | B<CRYPTO_EX_DATA> structure from the parent RSA structure: the functions | ||
72 | B<CRYPTO_get_ex_data()> and B<CRYPTO_set_ex_data()> can be called to manipulate | ||
73 | it. The B<idx> parameter is the index: this will be the same value returned by | ||
74 | B<RSA_get_ex_new_index()> when the functions were initially registered. Finally | ||
75 | the B<argl> and B<argp> parameters are the values originally passed to the same | ||
76 | corresponding parameters when B<RSA_get_ex_new_index()> was called. | ||
77 | |||
78 | B<dup_func()> is called when a structure is being copied. Pointers to the | ||
79 | destination and source B<CRYPTO_EX_DATA> structures are passed in the B<to> and | ||
80 | B<from> parameters respectively. The B<from_d> parameter is passed a pointer to | ||
81 | the source application data when the function is called, when the function returns | ||
82 | the value is copied to the destination: the application can thus modify the data | ||
83 | pointed to by B<from_d> and have different values in the source and destination. | ||
84 | The B<idx>, B<argl> and B<argp> parameters are the same as those in B<new_func()> | ||
85 | and B<free_func()>. | ||
86 | |||
87 | =head1 RETURN VALUES | ||
88 | |||
89 | B<RSA_get_ex_new_index()> returns a new index or -1 on failure (note 0 is a valid | ||
90 | index value). | ||
91 | |||
92 | B<RSA_set_ex_data()> returns 1 on success or 0 on failure. | ||
93 | |||
94 | B<RSA_get_ex_data()> returns the application data or 0 on failure. 0 may also | ||
95 | be valid application data but currently it can only fail if given an invalid B<idx> | ||
96 | parameter. | ||
97 | |||
98 | B<new_func()> and B<dup_func()> should return 0 for failure and 1 for success. | ||
99 | |||
100 | On failure an error code can be obtained from L<ERR_get_error(3)|ERR_get_error(3)>. | ||
101 | |||
102 | =head1 BUGS | ||
103 | |||
104 | B<dup_func()> is currently never called. | ||
105 | |||
106 | The return value of B<new_func()> is ignored. | ||
107 | |||
108 | The B<new_func()> function isn't very useful because no meaningful values are | ||
109 | present in the parent RSA structure when it is called. | ||
110 | |||
111 | =head1 SEE ALSO | ||
112 | |||
113 | L<rsa(3)|rsa(3)>, L<CRYPTO_set_ex_data(3)|CRYPTO_set_ex_data(3)> | ||
114 | |||
115 | =head1 HISTORY | ||
116 | |||
117 | RSA_get_ex_new_index(), RSA_set_ex_data() and RSA_get_ex_data() are | ||
118 | available since SSLeay 0.9.0. | ||
119 | |||
120 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RSA_new.pod b/src/lib/libcrypto/doc/RSA_new.pod deleted file mode 100644 index 3d15b92824..0000000000 --- a/src/lib/libcrypto/doc/RSA_new.pod +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RSA_new, RSA_free - allocate and free RSA objects | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/rsa.h> | ||
10 | |||
11 | RSA * RSA_new(void); | ||
12 | |||
13 | void RSA_free(RSA *rsa); | ||
14 | |||
15 | =head1 DESCRIPTION | ||
16 | |||
17 | RSA_new() allocates and initializes an B<RSA> structure. It is equivalent to | ||
18 | calling RSA_new_method(NULL). | ||
19 | |||
20 | RSA_free() frees the B<RSA> structure and its components. The key is | ||
21 | erased before the memory is returned to the system. | ||
22 | |||
23 | =head1 RETURN VALUES | ||
24 | |||
25 | If the allocation fails, RSA_new() returns B<NULL> and sets an error | ||
26 | code that can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. Otherwise it returns | ||
27 | a pointer to the newly allocated structure. | ||
28 | |||
29 | RSA_free() returns no value. | ||
30 | |||
31 | =head1 SEE ALSO | ||
32 | |||
33 | L<ERR_get_error(3)|ERR_get_error(3)>, L<rsa(3)|rsa(3)>, | ||
34 | L<RSA_generate_key(3)|RSA_generate_key(3)>, | ||
35 | L<RSA_new_method(3)|RSA_new_method(3)> | ||
36 | |||
37 | =head1 HISTORY | ||
38 | |||
39 | RSA_new() and RSA_free() are available in all versions of SSLeay and OpenSSL. | ||
40 | |||
41 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RSA_padding_add_PKCS1_type_1.pod b/src/lib/libcrypto/doc/RSA_padding_add_PKCS1_type_1.pod deleted file mode 100644 index b8f678fe72..0000000000 --- a/src/lib/libcrypto/doc/RSA_padding_add_PKCS1_type_1.pod +++ /dev/null | |||
@@ -1,124 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RSA_padding_add_PKCS1_type_1, RSA_padding_check_PKCS1_type_1, | ||
6 | RSA_padding_add_PKCS1_type_2, RSA_padding_check_PKCS1_type_2, | ||
7 | RSA_padding_add_PKCS1_OAEP, RSA_padding_check_PKCS1_OAEP, | ||
8 | RSA_padding_add_SSLv23, RSA_padding_check_SSLv23, | ||
9 | RSA_padding_add_none, RSA_padding_check_none - asymmetric encryption | ||
10 | padding | ||
11 | |||
12 | =head1 SYNOPSIS | ||
13 | |||
14 | #include <openssl/rsa.h> | ||
15 | |||
16 | int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen, | ||
17 | unsigned char *f, int fl); | ||
18 | |||
19 | int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen, | ||
20 | unsigned char *f, int fl, int rsa_len); | ||
21 | |||
22 | int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen, | ||
23 | unsigned char *f, int fl); | ||
24 | |||
25 | int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen, | ||
26 | unsigned char *f, int fl, int rsa_len); | ||
27 | |||
28 | int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen, | ||
29 | unsigned char *f, int fl, unsigned char *p, int pl); | ||
30 | |||
31 | int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen, | ||
32 | unsigned char *f, int fl, int rsa_len, unsigned char *p, int pl); | ||
33 | |||
34 | int RSA_padding_add_SSLv23(unsigned char *to, int tlen, | ||
35 | unsigned char *f, int fl); | ||
36 | |||
37 | int RSA_padding_check_SSLv23(unsigned char *to, int tlen, | ||
38 | unsigned char *f, int fl, int rsa_len); | ||
39 | |||
40 | int RSA_padding_add_none(unsigned char *to, int tlen, | ||
41 | unsigned char *f, int fl); | ||
42 | |||
43 | int RSA_padding_check_none(unsigned char *to, int tlen, | ||
44 | unsigned char *f, int fl, int rsa_len); | ||
45 | |||
46 | =head1 DESCRIPTION | ||
47 | |||
48 | The RSA_padding_xxx_xxx() functions are called from the RSA encrypt, | ||
49 | decrypt, sign and verify functions. Normally they should not be called | ||
50 | from application programs. | ||
51 | |||
52 | However, they can also be called directly to implement padding for other | ||
53 | asymmetric ciphers. RSA_padding_add_PKCS1_OAEP() and | ||
54 | RSA_padding_check_PKCS1_OAEP() may be used in an application combined | ||
55 | with B<RSA_NO_PADDING> in order to implement OAEP with an encoding | ||
56 | parameter. | ||
57 | |||
58 | RSA_padding_add_xxx() encodes B<fl> bytes from B<f> so as to fit into | ||
59 | B<tlen> bytes and stores the result at B<to>. An error occurs if B<fl> | ||
60 | does not meet the size requirements of the encoding method. | ||
61 | |||
62 | The following encoding methods are implemented: | ||
63 | |||
64 | =over 4 | ||
65 | |||
66 | =item PKCS1_type_1 | ||
67 | |||
68 | PKCS #1 v2.0 EMSA-PKCS1-v1_5 (PKCS #1 v1.5 block type 1); used for signatures | ||
69 | |||
70 | =item PKCS1_type_2 | ||
71 | |||
72 | PKCS #1 v2.0 EME-PKCS1-v1_5 (PKCS #1 v1.5 block type 2) | ||
73 | |||
74 | =item PKCS1_OAEP | ||
75 | |||
76 | PKCS #1 v2.0 EME-OAEP | ||
77 | |||
78 | =item SSLv23 | ||
79 | |||
80 | PKCS #1 EME-PKCS1-v1_5 with SSL-specific modification | ||
81 | |||
82 | =item none | ||
83 | |||
84 | simply copy the data | ||
85 | |||
86 | =back | ||
87 | |||
88 | The random number generator must be seeded prior to calling | ||
89 | RSA_padding_add_xxx(). | ||
90 | |||
91 | RSA_padding_check_xxx() verifies that the B<fl> bytes at B<f> contain | ||
92 | a valid encoding for a B<rsa_len> byte RSA key in the respective | ||
93 | encoding method and stores the recovered data of at most B<tlen> bytes | ||
94 | (for B<RSA_NO_PADDING>: of size B<tlen>) | ||
95 | at B<to>. | ||
96 | |||
97 | For RSA_padding_xxx_OAEP(), B<p> points to the encoding parameter | ||
98 | of length B<pl>. B<p> may be B<NULL> if B<pl> is 0. | ||
99 | |||
100 | =head1 RETURN VALUES | ||
101 | |||
102 | The RSA_padding_add_xxx() functions return 1 on success, 0 on error. | ||
103 | The RSA_padding_check_xxx() functions return the length of the | ||
104 | recovered data, -1 on error. Error codes can be obtained by calling | ||
105 | L<ERR_get_error(3)|ERR_get_error(3)>. | ||
106 | |||
107 | =head1 SEE ALSO | ||
108 | |||
109 | L<RSA_public_encrypt(3)|RSA_public_encrypt(3)>, | ||
110 | L<RSA_private_decrypt(3)|RSA_private_decrypt(3)>, | ||
111 | L<RSA_sign(3)|RSA_sign(3)>, L<RSA_verify(3)|RSA_verify(3)> | ||
112 | |||
113 | =head1 HISTORY | ||
114 | |||
115 | RSA_padding_add_PKCS1_type_1(), RSA_padding_check_PKCS1_type_1(), | ||
116 | RSA_padding_add_PKCS1_type_2(), RSA_padding_check_PKCS1_type_2(), | ||
117 | RSA_padding_add_SSLv23(), RSA_padding_check_SSLv23(), | ||
118 | RSA_padding_add_none() and RSA_padding_check_none() appeared in | ||
119 | SSLeay 0.9.0. | ||
120 | |||
121 | RSA_padding_add_PKCS1_OAEP() and RSA_padding_check_PKCS1_OAEP() were | ||
122 | added in OpenSSL 0.9.2b. | ||
123 | |||
124 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RSA_print.pod b/src/lib/libcrypto/doc/RSA_print.pod deleted file mode 100644 index c971e91f4d..0000000000 --- a/src/lib/libcrypto/doc/RSA_print.pod +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RSA_print, RSA_print_fp, | ||
6 | DSAparams_print, DSAparams_print_fp, DSA_print, DSA_print_fp, | ||
7 | DHparams_print, DHparams_print_fp - print cryptographic parameters | ||
8 | |||
9 | =head1 SYNOPSIS | ||
10 | |||
11 | #include <openssl/rsa.h> | ||
12 | |||
13 | int RSA_print(BIO *bp, RSA *x, int offset); | ||
14 | int RSA_print_fp(FILE *fp, RSA *x, int offset); | ||
15 | |||
16 | #include <openssl/dsa.h> | ||
17 | |||
18 | int DSAparams_print(BIO *bp, DSA *x); | ||
19 | int DSAparams_print_fp(FILE *fp, DSA *x); | ||
20 | int DSA_print(BIO *bp, DSA *x, int offset); | ||
21 | int DSA_print_fp(FILE *fp, DSA *x, int offset); | ||
22 | |||
23 | #include <openssl/dh.h> | ||
24 | |||
25 | int DHparams_print(BIO *bp, DH *x); | ||
26 | int DHparams_print_fp(FILE *fp, DH *x); | ||
27 | |||
28 | =head1 DESCRIPTION | ||
29 | |||
30 | A human-readable hexadecimal output of the components of the RSA | ||
31 | key, DSA parameters or key or DH parameters is printed to B<bp> or B<fp>. | ||
32 | |||
33 | The output lines are indented by B<offset> spaces. | ||
34 | |||
35 | =head1 RETURN VALUES | ||
36 | |||
37 | These functions return 1 on success, 0 on error. | ||
38 | |||
39 | =head1 SEE ALSO | ||
40 | |||
41 | L<dh(3)|dh(3)>, L<dsa(3)|dsa(3)>, L<rsa(3)|rsa(3)>, L<BN_bn2bin(3)|BN_bn2bin(3)> | ||
42 | |||
43 | =head1 HISTORY | ||
44 | |||
45 | RSA_print(), RSA_print_fp(), DSA_print(), DSA_print_fp(), DH_print(), | ||
46 | DH_print_fp() are available in all versions of SSLeay and OpenSSL. | ||
47 | DSAparams_print() and DSAparams_print_fp() were added in SSLeay 0.8. | ||
48 | |||
49 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RSA_private_encrypt.pod b/src/lib/libcrypto/doc/RSA_private_encrypt.pod deleted file mode 100644 index 746a80c79e..0000000000 --- a/src/lib/libcrypto/doc/RSA_private_encrypt.pod +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RSA_private_encrypt, RSA_public_decrypt - low level signature operations | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/rsa.h> | ||
10 | |||
11 | int RSA_private_encrypt(int flen, unsigned char *from, | ||
12 | unsigned char *to, RSA *rsa, int padding); | ||
13 | |||
14 | int RSA_public_decrypt(int flen, unsigned char *from, | ||
15 | unsigned char *to, RSA *rsa, int padding); | ||
16 | |||
17 | =head1 DESCRIPTION | ||
18 | |||
19 | These functions handle RSA signatures at a low level. | ||
20 | |||
21 | RSA_private_encrypt() signs the B<flen> bytes at B<from> (usually a | ||
22 | message digest with an algorithm identifier) using the private key | ||
23 | B<rsa> and stores the signature in B<to>. B<to> must point to | ||
24 | B<RSA_size(rsa)> bytes of memory. | ||
25 | |||
26 | B<padding> denotes one of the following modes: | ||
27 | |||
28 | =over 4 | ||
29 | |||
30 | =item RSA_PKCS1_PADDING | ||
31 | |||
32 | PKCS #1 v1.5 padding. This function does not handle the | ||
33 | B<algorithmIdentifier> specified in PKCS #1. When generating or | ||
34 | verifying PKCS #1 signatures, L<RSA_sign(3)|RSA_sign(3)> and L<RSA_verify(3)|RSA_verify(3)> should be | ||
35 | used. | ||
36 | |||
37 | =item RSA_NO_PADDING | ||
38 | |||
39 | Raw RSA signature. This mode should I<only> be used to implement | ||
40 | cryptographically sound padding modes in the application code. | ||
41 | Signing user data directly with RSA is insecure. | ||
42 | |||
43 | =back | ||
44 | |||
45 | RSA_public_decrypt() recovers the message digest from the B<flen> | ||
46 | bytes long signature at B<from> using the signer's public key | ||
47 | B<rsa>. B<to> must point to a memory section large enough to hold the | ||
48 | message digest (which is smaller than B<RSA_size(rsa) - | ||
49 | 11>). B<padding> is the padding mode that was used to sign the data. | ||
50 | |||
51 | =head1 RETURN VALUES | ||
52 | |||
53 | RSA_private_encrypt() returns the size of the signature (i.e., | ||
54 | RSA_size(rsa)). RSA_public_decrypt() returns the size of the | ||
55 | recovered message digest. | ||
56 | |||
57 | On error, -1 is returned; the error codes can be | ||
58 | obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
59 | |||
60 | =head1 SEE ALSO | ||
61 | |||
62 | L<ERR_get_error(3)|ERR_get_error(3)>, L<rsa(3)|rsa(3)>, | ||
63 | L<RSA_sign(3)|RSA_sign(3)>, L<RSA_verify(3)|RSA_verify(3)> | ||
64 | |||
65 | =head1 HISTORY | ||
66 | |||
67 | The B<padding> argument was added in SSLeay 0.8. RSA_NO_PADDING is | ||
68 | available since SSLeay 0.9.0. | ||
69 | |||
70 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RSA_public_encrypt.pod b/src/lib/libcrypto/doc/RSA_public_encrypt.pod deleted file mode 100644 index ab0fe3b2cd..0000000000 --- a/src/lib/libcrypto/doc/RSA_public_encrypt.pod +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RSA_public_encrypt, RSA_private_decrypt - RSA public key cryptography | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/rsa.h> | ||
10 | |||
11 | int RSA_public_encrypt(int flen, unsigned char *from, | ||
12 | unsigned char *to, RSA *rsa, int padding); | ||
13 | |||
14 | int RSA_private_decrypt(int flen, unsigned char *from, | ||
15 | unsigned char *to, RSA *rsa, int padding); | ||
16 | |||
17 | =head1 DESCRIPTION | ||
18 | |||
19 | RSA_public_encrypt() encrypts the B<flen> bytes at B<from> (usually a | ||
20 | session key) using the public key B<rsa> and stores the ciphertext in | ||
21 | B<to>. B<to> must point to RSA_size(B<rsa>) bytes of memory. | ||
22 | |||
23 | B<padding> denotes one of the following modes: | ||
24 | |||
25 | =over 4 | ||
26 | |||
27 | =item RSA_PKCS1_PADDING | ||
28 | |||
29 | PKCS #1 v1.5 padding. This currently is the most widely used mode. | ||
30 | |||
31 | =item RSA_PKCS1_OAEP_PADDING | ||
32 | |||
33 | EME-OAEP as defined in PKCS #1 v2.0 with SHA-1, MGF1 and an empty | ||
34 | encoding parameter. This mode is recommended for all new applications. | ||
35 | |||
36 | =item RSA_SSLV23_PADDING | ||
37 | |||
38 | PKCS #1 v1.5 padding with an SSL-specific modification that denotes | ||
39 | that the server is SSL3 capable. | ||
40 | |||
41 | =item RSA_NO_PADDING | ||
42 | |||
43 | Raw RSA encryption. This mode should I<only> be used to implement | ||
44 | cryptographically sound padding modes in the application code. | ||
45 | Encrypting user data directly with RSA is insecure. | ||
46 | |||
47 | =back | ||
48 | |||
49 | B<flen> must be less than RSA_size(B<rsa>) - 11 for the PKCS #1 v1.5 | ||
50 | based padding modes, less than RSA_size(B<rsa>) - 41 for | ||
51 | RSA_PKCS1_OAEP_PADDING and exactly RSA_size(B<rsa>) for RSA_NO_PADDING. | ||
52 | The random number generator must be seeded prior to calling | ||
53 | RSA_public_encrypt(). | ||
54 | |||
55 | RSA_private_decrypt() decrypts the B<flen> bytes at B<from> using the | ||
56 | private key B<rsa> and stores the plaintext in B<to>. B<to> must point | ||
57 | to a memory section large enough to hold the decrypted data (which is | ||
58 | smaller than RSA_size(B<rsa>)). B<padding> is the padding mode that | ||
59 | was used to encrypt the data. | ||
60 | |||
61 | =head1 RETURN VALUES | ||
62 | |||
63 | RSA_public_encrypt() returns the size of the encrypted data (i.e., | ||
64 | RSA_size(B<rsa>)). RSA_private_decrypt() returns the size of the | ||
65 | recovered plaintext. | ||
66 | |||
67 | On error, -1 is returned; the error codes can be | ||
68 | obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
69 | |||
70 | =head1 CONFORMING TO | ||
71 | |||
72 | SSL, PKCS #1 v2.0 | ||
73 | |||
74 | =head1 SEE ALSO | ||
75 | |||
76 | L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, | ||
77 | L<RSA_size(3)|RSA_size(3)> | ||
78 | |||
79 | =head1 HISTORY | ||
80 | |||
81 | The B<padding> argument was added in SSLeay 0.8. RSA_NO_PADDING is | ||
82 | available since SSLeay 0.9.0, OAEP was added in OpenSSL 0.9.2b. | ||
83 | |||
84 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RSA_set_method.pod b/src/lib/libcrypto/doc/RSA_set_method.pod deleted file mode 100644 index 0a305f6b14..0000000000 --- a/src/lib/libcrypto/doc/RSA_set_method.pod +++ /dev/null | |||
@@ -1,202 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RSA_set_default_method, RSA_get_default_method, RSA_set_method, | ||
6 | RSA_get_method, RSA_PKCS1_SSLeay, RSA_null_method, RSA_flags, | ||
7 | RSA_new_method - select RSA method | ||
8 | |||
9 | =head1 SYNOPSIS | ||
10 | |||
11 | #include <openssl/rsa.h> | ||
12 | |||
13 | void RSA_set_default_method(const RSA_METHOD *meth); | ||
14 | |||
15 | RSA_METHOD *RSA_get_default_method(void); | ||
16 | |||
17 | int RSA_set_method(RSA *rsa, const RSA_METHOD *meth); | ||
18 | |||
19 | RSA_METHOD *RSA_get_method(const RSA *rsa); | ||
20 | |||
21 | RSA_METHOD *RSA_PKCS1_SSLeay(void); | ||
22 | |||
23 | RSA_METHOD *RSA_null_method(void); | ||
24 | |||
25 | int RSA_flags(const RSA *rsa); | ||
26 | |||
27 | RSA *RSA_new_method(RSA_METHOD *method); | ||
28 | |||
29 | =head1 DESCRIPTION | ||
30 | |||
31 | An B<RSA_METHOD> specifies the functions that OpenSSL uses for RSA | ||
32 | operations. By modifying the method, alternative implementations such as | ||
33 | hardware accelerators may be used. IMPORTANT: See the NOTES section for | ||
34 | important information about how these RSA API functions are affected by the | ||
35 | use of B<ENGINE> API calls. | ||
36 | |||
37 | Initially, the default RSA_METHOD is the OpenSSL internal implementation, | ||
38 | as returned by RSA_PKCS1_SSLeay(). | ||
39 | |||
40 | RSA_set_default_method() makes B<meth> the default method for all RSA | ||
41 | structures created later. B<NB>: This is true only whilst no ENGINE has | ||
42 | been set as a default for RSA, so this function is no longer recommended. | ||
43 | |||
44 | RSA_get_default_method() returns a pointer to the current default | ||
45 | RSA_METHOD. However, the meaningfulness of this result is dependant on | ||
46 | whether the ENGINE API is being used, so this function is no longer | ||
47 | recommended. | ||
48 | |||
49 | RSA_set_method() selects B<meth> to perform all operations using the key | ||
50 | B<rsa>. This will replace the RSA_METHOD used by the RSA key and if the | ||
51 | previous method was supplied by an ENGINE, the handle to that ENGINE will | ||
52 | be released during the change. It is possible to have RSA keys that only | ||
53 | work with certain RSA_METHOD implementations (eg. from an ENGINE module | ||
54 | that supports embedded hardware-protected keys), and in such cases | ||
55 | attempting to change the RSA_METHOD for the key can have unexpected | ||
56 | results. | ||
57 | |||
58 | RSA_get_method() returns a pointer to the RSA_METHOD being used by B<rsa>. | ||
59 | This method may or may not be supplied by an ENGINE implementation, but if | ||
60 | it is, the return value can only be guaranteed to be valid as long as the | ||
61 | RSA key itself is valid and does not have its implementation changed by | ||
62 | RSA_set_method(). | ||
63 | |||
64 | RSA_flags() returns the B<flags> that are set for B<rsa>'s current | ||
65 | RSA_METHOD. See the BUGS section. | ||
66 | |||
67 | RSA_new_method() allocates and initializes an RSA structure so that | ||
68 | B<engine> will be used for the RSA operations. If B<engine> is NULL, the | ||
69 | default ENGINE for RSA operations is used, and if no default ENGINE is set, | ||
70 | the RSA_METHOD controlled by RSA_set_default_method() is used. | ||
71 | |||
72 | RSA_flags() returns the B<flags> that are set for B<rsa>'s current method. | ||
73 | |||
74 | RSA_new_method() allocates and initializes an B<RSA> structure so that | ||
75 | B<method> will be used for the RSA operations. If B<method> is B<NULL>, | ||
76 | the default method is used. | ||
77 | |||
78 | =head1 THE RSA_METHOD STRUCTURE | ||
79 | |||
80 | typedef struct rsa_meth_st | ||
81 | { | ||
82 | /* name of the implementation */ | ||
83 | const char *name; | ||
84 | |||
85 | /* encrypt */ | ||
86 | int (*rsa_pub_enc)(int flen, unsigned char *from, | ||
87 | unsigned char *to, RSA *rsa, int padding); | ||
88 | |||
89 | /* verify arbitrary data */ | ||
90 | int (*rsa_pub_dec)(int flen, unsigned char *from, | ||
91 | unsigned char *to, RSA *rsa, int padding); | ||
92 | |||
93 | /* sign arbitrary data */ | ||
94 | int (*rsa_priv_enc)(int flen, unsigned char *from, | ||
95 | unsigned char *to, RSA *rsa, int padding); | ||
96 | |||
97 | /* decrypt */ | ||
98 | int (*rsa_priv_dec)(int flen, unsigned char *from, | ||
99 | unsigned char *to, RSA *rsa, int padding); | ||
100 | |||
101 | /* compute r0 = r0 ^ I mod rsa->n (May be NULL for some | ||
102 | implementations) */ | ||
103 | int (*rsa_mod_exp)(BIGNUM *r0, BIGNUM *I, RSA *rsa); | ||
104 | |||
105 | /* compute r = a ^ p mod m (May be NULL for some implementations) */ | ||
106 | int (*bn_mod_exp)(BIGNUM *r, BIGNUM *a, const BIGNUM *p, | ||
107 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); | ||
108 | |||
109 | /* called at RSA_new */ | ||
110 | int (*init)(RSA *rsa); | ||
111 | |||
112 | /* called at RSA_free */ | ||
113 | int (*finish)(RSA *rsa); | ||
114 | |||
115 | /* RSA_FLAG_EXT_PKEY - rsa_mod_exp is called for private key | ||
116 | * operations, even if p,q,dmp1,dmq1,iqmp | ||
117 | * are NULL | ||
118 | * RSA_FLAG_SIGN_VER - enable rsa_sign and rsa_verify | ||
119 | * RSA_METHOD_FLAG_NO_CHECK - don't check pub/private match | ||
120 | */ | ||
121 | int flags; | ||
122 | |||
123 | char *app_data; /* ?? */ | ||
124 | |||
125 | /* sign. For backward compatibility, this is used only | ||
126 | * if (flags & RSA_FLAG_SIGN_VER) | ||
127 | */ | ||
128 | int (*rsa_sign)(int type, unsigned char *m, unsigned int m_len, | ||
129 | unsigned char *sigret, unsigned int *siglen, RSA *rsa); | ||
130 | |||
131 | /* verify. For backward compatibility, this is used only | ||
132 | * if (flags & RSA_FLAG_SIGN_VER) | ||
133 | */ | ||
134 | int (*rsa_verify)(int type, unsigned char *m, unsigned int m_len, | ||
135 | unsigned char *sigbuf, unsigned int siglen, RSA *rsa); | ||
136 | |||
137 | } RSA_METHOD; | ||
138 | |||
139 | =head1 RETURN VALUES | ||
140 | |||
141 | RSA_PKCS1_SSLeay(), RSA_PKCS1_null_method(), RSA_get_default_method() | ||
142 | and RSA_get_method() return pointers to the respective RSA_METHODs. | ||
143 | |||
144 | RSA_set_default_method() returns no value. | ||
145 | |||
146 | RSA_set_method() returns a pointer to the old RSA_METHOD implementation | ||
147 | that was replaced. However, this return value should probably be ignored | ||
148 | because if it was supplied by an ENGINE, the pointer could be invalidated | ||
149 | at any time if the ENGINE is unloaded (in fact it could be unloaded as a | ||
150 | result of the RSA_set_method() function releasing its handle to the | ||
151 | ENGINE). For this reason, the return type may be replaced with a B<void> | ||
152 | declaration in a future release. | ||
153 | |||
154 | RSA_new_method() returns NULL and sets an error code that can be obtained | ||
155 | by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise | ||
156 | it returns a pointer to the newly allocated structure. | ||
157 | |||
158 | =head1 NOTES | ||
159 | |||
160 | As of version 0.9.7, RSA_METHOD implementations are grouped together with | ||
161 | other algorithmic APIs (eg. DSA_METHOD, EVP_CIPHER, etc) into B<ENGINE> | ||
162 | modules. If a default ENGINE is specified for RSA functionality using an | ||
163 | ENGINE API function, that will override any RSA defaults set using the RSA | ||
164 | API (ie. RSA_set_default_method()). For this reason, the ENGINE API is the | ||
165 | recommended way to control default implementations for use in RSA and other | ||
166 | cryptographic algorithms. | ||
167 | |||
168 | =head1 BUGS | ||
169 | |||
170 | The behaviour of RSA_flags() is a mis-feature that is left as-is for now | ||
171 | to avoid creating compatibility problems. RSA functionality, such as the | ||
172 | encryption functions, are controlled by the B<flags> value in the RSA key | ||
173 | itself, not by the B<flags> value in the RSA_METHOD attached to the RSA key | ||
174 | (which is what this function returns). If the flags element of an RSA key | ||
175 | is changed, the changes will be honoured by RSA functionality but will not | ||
176 | be reflected in the return value of the RSA_flags() function - in effect | ||
177 | RSA_flags() behaves more like an RSA_default_flags() function (which does | ||
178 | not currently exist). | ||
179 | |||
180 | =head1 SEE ALSO | ||
181 | |||
182 | L<rsa(3)|rsa(3)>, L<RSA_new(3)|RSA_new(3)> | ||
183 | |||
184 | =head1 HISTORY | ||
185 | |||
186 | RSA_new_method() and RSA_set_default_method() appeared in SSLeay 0.8. | ||
187 | RSA_get_default_method(), RSA_set_method() and RSA_get_method() as | ||
188 | well as the rsa_sign and rsa_verify components of RSA_METHOD were | ||
189 | added in OpenSSL 0.9.4. | ||
190 | |||
191 | RSA_set_default_openssl_method() and RSA_get_default_openssl_method() | ||
192 | replaced RSA_set_default_method() and RSA_get_default_method() | ||
193 | respectively, and RSA_set_method() and RSA_new_method() were altered to use | ||
194 | B<ENGINE>s rather than B<RSA_METHOD>s during development of the engine | ||
195 | version of OpenSSL 0.9.6. For 0.9.7, the handling of defaults in the ENGINE | ||
196 | API was restructured so that this change was reversed, and behaviour of the | ||
197 | other functions resembled more closely the previous behaviour. The | ||
198 | behaviour of defaults in the ENGINE API now transparently overrides the | ||
199 | behaviour of defaults in the RSA API without requiring changing these | ||
200 | function prototypes. | ||
201 | |||
202 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RSA_sign.pod b/src/lib/libcrypto/doc/RSA_sign.pod deleted file mode 100644 index 71688a665e..0000000000 --- a/src/lib/libcrypto/doc/RSA_sign.pod +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RSA_sign, RSA_verify - RSA signatures | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/rsa.h> | ||
10 | |||
11 | int RSA_sign(int type, unsigned char *m, unsigned int m_len, | ||
12 | unsigned char *sigret, unsigned int *siglen, RSA *rsa); | ||
13 | |||
14 | int RSA_verify(int type, unsigned char *m, unsigned int m_len, | ||
15 | unsigned char *sigbuf, unsigned int siglen, RSA *rsa); | ||
16 | |||
17 | =head1 DESCRIPTION | ||
18 | |||
19 | RSA_sign() signs the message digest B<m> of size B<m_len> using the | ||
20 | private key B<rsa> as specified in PKCS #1 v2.0. It stores the | ||
21 | signature in B<sigret> and the signature size in B<siglen>. B<sigret> | ||
22 | must point to RSA_size(B<rsa>) bytes of memory. | ||
23 | |||
24 | B<type> denotes the message digest algorithm that was used to generate | ||
25 | B<m>. It usually is one of B<NID_sha1>, B<NID_ripemd160> and B<NID_md5>; | ||
26 | see L<objects(3)|objects(3)> for details. If B<type> is B<NID_md5_sha1>, | ||
27 | an SSL signature (MD5 and SHA1 message digests with PKCS #1 padding | ||
28 | and no algorithm identifier) is created. | ||
29 | |||
30 | RSA_verify() verifies that the signature B<sigbuf> of size B<siglen> | ||
31 | matches a given message digest B<m> of size B<m_len>. B<type> denotes | ||
32 | the message digest algorithm that was used to generate the signature. | ||
33 | B<rsa> is the signer's public key. | ||
34 | |||
35 | =head1 RETURN VALUES | ||
36 | |||
37 | RSA_sign() returns 1 on success, 0 otherwise. RSA_verify() returns 1 | ||
38 | on successful verification, 0 otherwise. | ||
39 | |||
40 | The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
41 | |||
42 | =head1 BUGS | ||
43 | |||
44 | Certain signatures with an improper algorithm identifier are accepted | ||
45 | for compatibility with SSLeay 0.4.5 :-) | ||
46 | |||
47 | =head1 CONFORMING TO | ||
48 | |||
49 | SSL, PKCS #1 v2.0 | ||
50 | |||
51 | =head1 SEE ALSO | ||
52 | |||
53 | L<ERR_get_error(3)|ERR_get_error(3)>, L<objects(3)|objects(3)>, | ||
54 | L<rsa(3)|rsa(3)>, L<RSA_private_encrypt(3)|RSA_private_encrypt(3)>, | ||
55 | L<RSA_public_decrypt(3)|RSA_public_decrypt(3)> | ||
56 | |||
57 | =head1 HISTORY | ||
58 | |||
59 | RSA_sign() and RSA_verify() are available in all versions of SSLeay | ||
60 | and OpenSSL. | ||
61 | |||
62 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RSA_sign_ASN1_OCTET_STRING.pod b/src/lib/libcrypto/doc/RSA_sign_ASN1_OCTET_STRING.pod deleted file mode 100644 index e70380bbfc..0000000000 --- a/src/lib/libcrypto/doc/RSA_sign_ASN1_OCTET_STRING.pod +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RSA_sign_ASN1_OCTET_STRING, RSA_verify_ASN1_OCTET_STRING - RSA signatures | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/rsa.h> | ||
10 | |||
11 | int RSA_sign_ASN1_OCTET_STRING(int dummy, unsigned char *m, | ||
12 | unsigned int m_len, unsigned char *sigret, unsigned int *siglen, | ||
13 | RSA *rsa); | ||
14 | |||
15 | int RSA_verify_ASN1_OCTET_STRING(int dummy, unsigned char *m, | ||
16 | unsigned int m_len, unsigned char *sigbuf, unsigned int siglen, | ||
17 | RSA *rsa); | ||
18 | |||
19 | =head1 DESCRIPTION | ||
20 | |||
21 | RSA_sign_ASN1_OCTET_STRING() signs the octet string B<m> of size | ||
22 | B<m_len> using the private key B<rsa> represented in DER using PKCS #1 | ||
23 | padding. It stores the signature in B<sigret> and the signature size | ||
24 | in B<siglen>. B<sigret> must point to B<RSA_size(rsa)> bytes of | ||
25 | memory. | ||
26 | |||
27 | B<dummy> is ignored. | ||
28 | |||
29 | The random number generator must be seeded prior to calling RSA_sign_ASN1_OCTET_STRING(). | ||
30 | |||
31 | RSA_verify_ASN1_OCTET_STRING() verifies that the signature B<sigbuf> | ||
32 | of size B<siglen> is the DER representation of a given octet string | ||
33 | B<m> of size B<m_len>. B<dummy> is ignored. B<rsa> is the signer's | ||
34 | public key. | ||
35 | |||
36 | =head1 RETURN VALUES | ||
37 | |||
38 | RSA_sign_ASN1_OCTET_STRING() returns 1 on success, 0 otherwise. | ||
39 | RSA_verify_ASN1_OCTET_STRING() returns 1 on successful verification, 0 | ||
40 | otherwise. | ||
41 | |||
42 | The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
43 | |||
44 | =head1 BUGS | ||
45 | |||
46 | These functions serve no recognizable purpose. | ||
47 | |||
48 | =head1 SEE ALSO | ||
49 | |||
50 | L<ERR_get_error(3)|ERR_get_error(3)>, L<objects(3)|objects(3)>, | ||
51 | L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, L<RSA_sign(3)|RSA_sign(3)>, | ||
52 | L<RSA_verify(3)|RSA_verify(3)> | ||
53 | |||
54 | =head1 HISTORY | ||
55 | |||
56 | RSA_sign_ASN1_OCTET_STRING() and RSA_verify_ASN1_OCTET_STRING() were | ||
57 | added in SSLeay 0.8. | ||
58 | |||
59 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RSA_size.pod b/src/lib/libcrypto/doc/RSA_size.pod deleted file mode 100644 index 5b7f835f95..0000000000 --- a/src/lib/libcrypto/doc/RSA_size.pod +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | RSA_size - get RSA modulus size | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/rsa.h> | ||
10 | |||
11 | int RSA_size(const RSA *rsa); | ||
12 | |||
13 | =head1 DESCRIPTION | ||
14 | |||
15 | This function returns the RSA modulus size in bytes. It can be used to | ||
16 | determine how much memory must be allocated for an RSA encrypted | ||
17 | value. | ||
18 | |||
19 | B<rsa-E<gt>n> must not be B<NULL>. | ||
20 | |||
21 | =head1 RETURN VALUE | ||
22 | |||
23 | The size in bytes. | ||
24 | |||
25 | =head1 SEE ALSO | ||
26 | |||
27 | L<rsa(3)|rsa(3)> | ||
28 | |||
29 | =head1 HISTORY | ||
30 | |||
31 | RSA_size() is available in all versions of SSLeay and OpenSSL. | ||
32 | |||
33 | =cut | ||
diff --git a/src/lib/libcrypto/doc/SMIME_read_PKCS7.pod b/src/lib/libcrypto/doc/SMIME_read_PKCS7.pod deleted file mode 100644 index ffafa37887..0000000000 --- a/src/lib/libcrypto/doc/SMIME_read_PKCS7.pod +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | SMIME_read_PKCS7 - parse S/MIME message. | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | PKCS7 *SMIME_read_PKCS7(BIO *in, BIO **bcont); | ||
10 | |||
11 | =head1 DESCRIPTION | ||
12 | |||
13 | SMIME_read_PKCS7() parses a message in S/MIME format. | ||
14 | |||
15 | B<in> is a BIO to read the message from. | ||
16 | |||
17 | If cleartext signing is used then the content is saved in | ||
18 | a memory bio which is written to B<*bcont>, otherwise | ||
19 | B<*bcont> is set to B<NULL>. | ||
20 | |||
21 | The parsed PKCS#7 structure is returned or B<NULL> if an | ||
22 | error occurred. | ||
23 | |||
24 | =head1 NOTES | ||
25 | |||
26 | If B<*bcont> is not B<NULL> then the message is clear text | ||
27 | signed. B<*bcont> can then be passed to PKCS7_verify() with | ||
28 | the B<PKCS7_DETACHED> flag set. | ||
29 | |||
30 | Otherwise the type of the returned structure can be determined | ||
31 | using PKCS7_type(). | ||
32 | |||
33 | To support future functionality if B<bcont> is not B<NULL> | ||
34 | B<*bcont> should be initialized to B<NULL>. For example: | ||
35 | |||
36 | BIO *cont = NULL; | ||
37 | PKCS7 *p7; | ||
38 | |||
39 | p7 = SMIME_read_PKCS7(in, &cont); | ||
40 | |||
41 | =head1 BUGS | ||
42 | |||
43 | The MIME parser used by SMIME_read_PKCS7() is somewhat primitive. | ||
44 | While it will handle most S/MIME messages more complex compound | ||
45 | formats may not work. | ||
46 | |||
47 | The parser assumes that the PKCS7 structure is always base64 | ||
48 | encoded and will not handle the case where it is in binary format | ||
49 | or uses quoted printable format. | ||
50 | |||
51 | The use of a memory BIO to hold the signed content limits the size | ||
52 | of message which can be processed due to memory restraints: a | ||
53 | streaming single pass option should be available. | ||
54 | |||
55 | =head1 RETURN VALUES | ||
56 | |||
57 | SMIME_read_PKCS7() returns a valid B<PKCS7> structure or B<NULL> | ||
58 | is an error occurred. The error can be obtained from ERR_get_error(3). | ||
59 | |||
60 | =head1 SEE ALSO | ||
61 | |||
62 | L<ERR_get_error(3)|ERR_get_error(3)>, L<PKCS7_type(3)|PKCS7_type(3)> | ||
63 | L<SMIME_read_PKCS7(3)|SMIME_read_PKCS7(3)>, L<PKCS7_sign(3)|PKCS7_sign(3)>, | ||
64 | L<PKCS7_verify(3)|PKCS7_verify(3)>, L<PKCS7_encrypt(3)|PKCS7_encrypt(3)> | ||
65 | L<PKCS7_decrypt(3)|PKCS7_decrypt(3)> | ||
66 | |||
67 | =head1 HISTORY | ||
68 | |||
69 | SMIME_read_PKCS7() was added to OpenSSL 0.9.5 | ||
70 | |||
71 | =cut | ||
diff --git a/src/lib/libcrypto/doc/SMIME_write_PKCS7.pod b/src/lib/libcrypto/doc/SMIME_write_PKCS7.pod deleted file mode 100644 index 2cfad2e049..0000000000 --- a/src/lib/libcrypto/doc/SMIME_write_PKCS7.pod +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | SMIME_write_PKCS7 - convert PKCS#7 structure to S/MIME format. | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | int SMIME_write_PKCS7(BIO *out, PKCS7 *p7, BIO *data, int flags); | ||
10 | |||
11 | =head1 DESCRIPTION | ||
12 | |||
13 | SMIME_write_PKCS7() adds the appropriate MIME headers to a PKCS#7 | ||
14 | structure to produce an S/MIME message. | ||
15 | |||
16 | B<out> is the BIO to write the data to. B<p7> is the appropriate | ||
17 | B<PKCS7> structure. If cleartext signing (B<multipart/signed>) is | ||
18 | being used then the signed data must be supplied in the B<data> | ||
19 | argument. B<flags> is an optional set of flags. | ||
20 | |||
21 | =head1 NOTES | ||
22 | |||
23 | The following flags can be passed in the B<flags> parameter. | ||
24 | |||
25 | If B<PKCS7_DETACHED> is set then cleartext signing will be used, | ||
26 | this option only makes sense for signedData where B<PKCS7_DETACHED> | ||
27 | is also set when PKCS7_sign() is also called. | ||
28 | |||
29 | If the B<PKCS7_TEXT> flag is set MIME headers for type B<text/plain> | ||
30 | are added to the content, this only makes sense if B<PKCS7_DETACHED> | ||
31 | is also set. | ||
32 | |||
33 | If cleartext signing is being used then the data must be read twice: | ||
34 | once to compute the signature in PKCS7_sign() and once to output the | ||
35 | S/MIME message. | ||
36 | |||
37 | =head1 BUGS | ||
38 | |||
39 | SMIME_write_PKCS7() always base64 encodes PKCS#7 structures, there | ||
40 | should be an option to disable this. | ||
41 | |||
42 | There should really be a way to produce cleartext signing using only | ||
43 | a single pass of the data. | ||
44 | |||
45 | =head1 RETURN VALUES | ||
46 | |||
47 | SMIME_write_PKCS7() returns 1 for success or 0 for failure. | ||
48 | |||
49 | =head1 SEE ALSO | ||
50 | |||
51 | L<ERR_get_error(3)|ERR_get_error(3)>, L<PKCS7_sign(3)|PKCS7_sign(3)>, | ||
52 | L<PKCS7_verify(3)|PKCS7_verify(3)>, L<PKCS7_encrypt(3)|PKCS7_encrypt(3)> | ||
53 | L<PKCS7_decrypt(3)|PKCS7_decrypt(3)> | ||
54 | |||
55 | =head1 HISTORY | ||
56 | |||
57 | SMIME_write_PKCS7() was added to OpenSSL 0.9.5 | ||
58 | |||
59 | =cut | ||
diff --git a/src/lib/libcrypto/doc/X509_NAME_ENTRY_get_object.pod b/src/lib/libcrypto/doc/X509_NAME_ENTRY_get_object.pod deleted file mode 100644 index 11b35f6fd3..0000000000 --- a/src/lib/libcrypto/doc/X509_NAME_ENTRY_get_object.pod +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | X509_NAME_ENTRY_get_object, X509_NAME_ENTRY_get_data, | ||
6 | X509_NAME_ENTRY_set_object, X509_NAME_ENTRY_set_data, | ||
7 | X509_NAME_ENTRY_create_by_txt, X509_NAME_ENTRY_create_by_NID, | ||
8 | X509_NAME_ENTRY_create_by_OBJ - X509_NAME_ENTRY utility functions | ||
9 | |||
10 | =head1 SYNOPSIS | ||
11 | |||
12 | ASN1_OBJECT * X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne); | ||
13 | ASN1_STRING * X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne); | ||
14 | |||
15 | int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, ASN1_OBJECT *obj); | ||
16 | int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, const unsigned char *bytes, int len); | ||
17 | |||
18 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, const char *field, int type, const unsigned char *bytes, int len); | ||
19 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, int type,unsigned char *bytes, int len); | ||
20 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, ASN1_OBJECT *obj, int type, const unsigned char *bytes, int len); | ||
21 | |||
22 | =head1 DESCRIPTION | ||
23 | |||
24 | X509_NAME_ENTRY_get_object() retrieves the field name of B<ne> in | ||
25 | and B<ASN1_OBJECT> structure. | ||
26 | |||
27 | X509_NAME_ENTRY_get_data() retrieves the field value of B<ne> in | ||
28 | and B<ASN1_STRING> structure. | ||
29 | |||
30 | X509_NAME_ENTRY_set_object() sets the field name of B<ne> to B<obj>. | ||
31 | |||
32 | X509_NAME_ENTRY_set_data() sets the field value of B<ne> to string type | ||
33 | B<type> and value determined by B<bytes> and B<len>. | ||
34 | |||
35 | X509_NAME_ENTRY_create_by_txt(), X509_NAME_ENTRY_create_by_NID() | ||
36 | and X509_NAME_ENTRY_create_by_OBJ() create and return an | ||
37 | B<X509_NAME_ENTRY> structure. | ||
38 | |||
39 | =head1 NOTES | ||
40 | |||
41 | X509_NAME_ENTRY_get_object() and X509_NAME_ENTRY_get_data() can be | ||
42 | used to examine an B<X509_NAME_ENTRY> function as returned by | ||
43 | X509_NAME_get_entry() for example. | ||
44 | |||
45 | X509_NAME_ENTRY_create_by_txt(), X509_NAME_ENTRY_create_by_NID(), | ||
46 | and X509_NAME_ENTRY_create_by_OBJ() create and return an | ||
47 | |||
48 | X509_NAME_ENTRY_create_by_txt(), X509_NAME_ENTRY_create_by_OBJ(), | ||
49 | X509_NAME_ENTRY_create_by_NID() and X509_NAME_ENTRY_set_data() | ||
50 | are seldom used in practice because B<X509_NAME_ENTRY> structures | ||
51 | are almost always part of B<X509_NAME> structures and the | ||
52 | corresponding B<X509_NAME> functions are typically used to | ||
53 | create and add new entries in a single operation. | ||
54 | |||
55 | The arguments of these functions support similar options to the similarly | ||
56 | named ones of the corresponding B<X509_NAME> functions such as | ||
57 | X509_NAME_add_entry_by_txt(). So for example B<type> can be set to | ||
58 | B<MBSTRING_ASC> but in the case of X509_set_data() the field name must be | ||
59 | set first so the relevant field information can be looked up internally. | ||
60 | |||
61 | =head1 RETURN VALUES | ||
62 | |||
63 | =head1 SEE ALSO | ||
64 | |||
65 | L<ERR_get_error(3)|ERR_get_error(3)>, L<d2i_X509_NAME(3)|d2i_X509_NAME(3)>, | ||
66 | L<OBJ_nid2obj(3),OBJ_nid2obj(3)> | ||
67 | |||
68 | =head1 HISTORY | ||
69 | |||
70 | TBA | ||
71 | |||
72 | =cut | ||
diff --git a/src/lib/libcrypto/doc/X509_NAME_add_entry_by_txt.pod b/src/lib/libcrypto/doc/X509_NAME_add_entry_by_txt.pod deleted file mode 100644 index e2ab4b0d2b..0000000000 --- a/src/lib/libcrypto/doc/X509_NAME_add_entry_by_txt.pod +++ /dev/null | |||
@@ -1,114 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | X509_NAME_add_entry_by_txt, X509_NAME_add_entry_by_OBJ, X509_NAME_add_entry_by_NID, | ||
6 | X509_NAME_add_entry, X509_NAME_delete_entry - X509_NAME modification functions | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, const unsigned char *bytes, int len, int loc, int set); | ||
11 | |||
12 | int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, unsigned char *bytes, int len, int loc, int set); | ||
13 | |||
14 | int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, unsigned char *bytes, int len, int loc, int set); | ||
15 | |||
16 | int X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne, int loc, int set); | ||
17 | |||
18 | X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); | ||
19 | |||
20 | =head1 DESCRIPTION | ||
21 | |||
22 | X509_NAME_add_entry_by_txt(), X509_NAME_add_entry_by_OBJ() and | ||
23 | X509_NAME_add_entry_by_NID() add a field whose name is defined | ||
24 | by a string B<field>, an object B<obj> or a NID B<nid> respectively. | ||
25 | The field value to be added is in B<bytes> of length B<len>. If | ||
26 | B<len> is -1 then the field length is calculated internally using | ||
27 | strlen(bytes). | ||
28 | |||
29 | The type of field is determined by B<type> which can either be a | ||
30 | definition of the type of B<bytes> (such as B<MBSTRING_ASC>) or a | ||
31 | standard ASN1 type (such as B<V_ASN1_IA5STRING>). The new entry is | ||
32 | added to a position determined by B<loc> and B<set>. | ||
33 | |||
34 | X509_NAME_add_entry() adds a copy of B<X509_NAME_ENTRY> structure B<ne> | ||
35 | to B<name>. The new entry is added to a position determined by B<loc> | ||
36 | and B<set>. Since a copy of B<ne> is added B<ne> must be freed up after | ||
37 | the call. | ||
38 | |||
39 | X509_NAME_delete_entry() deletes an entry from B<name> at position | ||
40 | B<loc>. The deleted entry is returned and must be freed up. | ||
41 | |||
42 | =head1 NOTES | ||
43 | |||
44 | The use of string types such as B<MBSTRING_ASC> or B<MBSTRING_UTF8> | ||
45 | is strongly recommened for the B<type> parameter. This allows the | ||
46 | internal code to correctly determine the type of the field and to | ||
47 | apply length checks according to the relevant standards. This is | ||
48 | done using ASN1_STRING_set_by_NID(). | ||
49 | |||
50 | If instead an ASN1 type is used no checks are performed and the | ||
51 | supplied data in B<bytes> is used directly. | ||
52 | |||
53 | In X509_NAME_add_entry_by_txt() the B<field> string represents | ||
54 | the field name using OBJ_txt2obj(field, 0). | ||
55 | |||
56 | The B<loc> and B<set> parameters determine where a new entry should | ||
57 | be added. For almost all applications B<loc> can be set to -1 and B<set> | ||
58 | to 0. This adds a new entry to the end of B<name> as a single valued | ||
59 | RelativeDistinguishedName (RDN). | ||
60 | |||
61 | B<loc> actually determines the index where the new entry is inserted: | ||
62 | if it is -1 it is appended. | ||
63 | |||
64 | B<set> determines how the new type is added. If it is zero a | ||
65 | new RDN is created. | ||
66 | |||
67 | If B<set> is -1 or 1 it is added to the previous or next RDN | ||
68 | structure respectively. This will then be a multivalued RDN: | ||
69 | since multivalues RDNs are very seldom used B<set> is almost | ||
70 | always set to zero. | ||
71 | |||
72 | =head1 EXAMPLES | ||
73 | |||
74 | Create an B<X509_NAME> structure: | ||
75 | |||
76 | "C=UK, O=Disorganized Organization, CN=Joe Bloggs" | ||
77 | |||
78 | X509_NAME *nm; | ||
79 | nm = X509_NAME_new(); | ||
80 | if (nm == NULL) | ||
81 | /* Some error */ | ||
82 | if (!X509_NAME_add_entry_by_txt(nm, MBSTRING_ASC, | ||
83 | "C", "UK", -1, -1, 0)) | ||
84 | /* Error */ | ||
85 | if (!X509_NAME_add_entry_by_txt(nm, MBSTRING_ASC, | ||
86 | "O", "Disorganized Organization", -1, -1, 0)) | ||
87 | /* Error */ | ||
88 | if (!X509_NAME_add_entry_by_txt(nm, MBSTRING_ASC, | ||
89 | "CN", "Joe Bloggs", -1, -1, 0)) | ||
90 | /* Error */ | ||
91 | |||
92 | =head1 RETURN VALUES | ||
93 | |||
94 | X509_NAME_add_entry_by_txt(), X509_NAME_add_entry_by_OBJ(), | ||
95 | X509_NAME_add_entry_by_NID() and X509_NAME_add_entry() return 1 for | ||
96 | success of 0 if an error occurred. | ||
97 | |||
98 | X509_NAME_delete_entry() returns either the deleted B<X509_NAME_ENTRY> | ||
99 | structure of B<NULL> if an error occurred. | ||
100 | |||
101 | =head1 BUGS | ||
102 | |||
103 | B<type> can still be set to B<V_ASN1_APP_CHOOSE> to use a | ||
104 | different algorithm to determine field types. Since this form does | ||
105 | not understand multicharacter types, performs no length checks and | ||
106 | can result in invalid field types its use is strongly discouraged. | ||
107 | |||
108 | =head1 SEE ALSO | ||
109 | |||
110 | L<ERR_get_error(3)|ERR_get_error(3)>, L<d2i_X509_NAME(3)|d2i_X509_NAME(3)> | ||
111 | |||
112 | =head1 HISTORY | ||
113 | |||
114 | =cut | ||
diff --git a/src/lib/libcrypto/doc/X509_NAME_get_index_by_NID.pod b/src/lib/libcrypto/doc/X509_NAME_get_index_by_NID.pod deleted file mode 100644 index 333323d734..0000000000 --- a/src/lib/libcrypto/doc/X509_NAME_get_index_by_NID.pod +++ /dev/null | |||
@@ -1,106 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | X509_NAME_get_index_by_NID, X509_NAME_get_index_by_OBJ, X509_NAME_get_entry, | ||
6 | X509_NAME_entry_count, X509_NAME_get_text_by_NID, X509_NAME_get_text_by_OBJ - | ||
7 | X509_NAME lookup and enumeration functions | ||
8 | |||
9 | =head1 SYNOPSIS | ||
10 | |||
11 | int X509_NAME_get_index_by_NID(X509_NAME *name,int nid,int lastpos); | ||
12 | int X509_NAME_get_index_by_OBJ(X509_NAME *name,ASN1_OBJECT *obj, int lastpos); | ||
13 | |||
14 | int X509_NAME_entry_count(X509_NAME *name); | ||
15 | X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc); | ||
16 | |||
17 | int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf,int len); | ||
18 | int X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, char *buf,int len); | ||
19 | |||
20 | =head1 DESCRIPTION | ||
21 | |||
22 | These functions allow an B<X509_NAME> structure to be examined. The | ||
23 | B<X509_NAME> structure is the same as the B<Name> type defined in | ||
24 | RFC2459 (and elsewhere) and used for example in certificate subject | ||
25 | and issuer names. | ||
26 | |||
27 | X509_NAME_get_index_by_NID() and X509_NAME_get_index_by_OBJ() retrieve | ||
28 | the next index matching B<nid> or B<obj> after B<lastpos>. B<lastpos> | ||
29 | should initially be set to -1. If there are no more entries -1 is returned. | ||
30 | |||
31 | X509_NAME_entry_count() returns the total number of entries in B<name>. | ||
32 | |||
33 | X509_NAME_get_entry() retrieves the B<X509_NAME_ENTRY> from B<name> | ||
34 | corresponding to index B<loc>. Acceptable values for B<loc> run from | ||
35 | 0 to (X509_NAME_entry_count(name) - 1). The value returned is an | ||
36 | internal pointer which must not be freed. | ||
37 | |||
38 | X509_NAME_get_text_by_NID(), X509_NAME_get_text_by_OBJ() retrieve | ||
39 | the "text" from the first entry in B<name> which matches B<nid> or | ||
40 | B<obj>, if no such entry exists -1 is returned. At most B<len> bytes | ||
41 | will be written and the text written to B<buf> will be null | ||
42 | terminated. The length of the output string written is returned | ||
43 | excluding the terminating null. If B<buf> is <NULL> then the amount | ||
44 | of space needed in B<buf> (excluding the final null) is returned. | ||
45 | |||
46 | =head1 NOTES | ||
47 | |||
48 | X509_NAME_get_text_by_NID() and X509_NAME_get_text_by_OBJ() are | ||
49 | legacy functions which have various limitations which make them | ||
50 | of minimal use in practice. They can only find the first matching | ||
51 | entry and will copy the contents of the field verbatim: this can | ||
52 | be highly confusing if the target is a muticharacter string type | ||
53 | like a BMPString or a UTF8String. | ||
54 | |||
55 | For a more general solution X509_NAME_get_index_by_NID() or | ||
56 | X509_NAME_get_index_by_OBJ() should be used followed by | ||
57 | X509_NAME_get_entry() on any matching indices and then the | ||
58 | various B<X509_NAME_ENTRY> utility functions on the result. | ||
59 | |||
60 | =head1 EXAMPLES | ||
61 | |||
62 | Process all entries: | ||
63 | |||
64 | int i; | ||
65 | X509_NAME_ENTRY *e; | ||
66 | |||
67 | for (i = 0; i < X509_NAME_entry_count(nm); i++) | ||
68 | { | ||
69 | e = X509_NAME_get_entry(nm, i); | ||
70 | /* Do something with e */ | ||
71 | } | ||
72 | |||
73 | Process all commonName entries: | ||
74 | |||
75 | int loc; | ||
76 | X509_NAME_ENTRY *e; | ||
77 | |||
78 | loc = -1; | ||
79 | for (;;) | ||
80 | { | ||
81 | lastpos = X509_NAME_get_index_by_NID(nm, NID_commonName, lastpos); | ||
82 | if (lastpos == -1) | ||
83 | break; | ||
84 | e = X509_NAME_get_entry(nm, lastpos); | ||
85 | /* Do something with e */ | ||
86 | } | ||
87 | |||
88 | =head1 RETURN VALUES | ||
89 | |||
90 | X509_NAME_get_index_by_NID() and X509_NAME_get_index_by_OBJ() | ||
91 | return the index of the next matching entry or -1 if not found. | ||
92 | |||
93 | X509_NAME_entry_count() returns the total number of entries. | ||
94 | |||
95 | X509_NAME_get_entry() returns an B<X509_NAME> pointer to the | ||
96 | requested entry or B<NULL> if the index is invalid. | ||
97 | |||
98 | =head1 SEE ALSO | ||
99 | |||
100 | L<ERR_get_error(3)|ERR_get_error(3)>, L<d2i_X509_NAME(3)|d2i_X509_NAME(3)> | ||
101 | |||
102 | =head1 HISTORY | ||
103 | |||
104 | TBA | ||
105 | |||
106 | =cut | ||
diff --git a/src/lib/libcrypto/doc/X509_NAME_print_ex.pod b/src/lib/libcrypto/doc/X509_NAME_print_ex.pod deleted file mode 100644 index 919b908919..0000000000 --- a/src/lib/libcrypto/doc/X509_NAME_print_ex.pod +++ /dev/null | |||
@@ -1,105 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | X509_NAME_print_ex, X509_NAME_print_ex_fp, X509_NAME_print, | ||
6 | X509_NAME_oneline - X509_NAME printing routines. | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/x509.h> | ||
11 | |||
12 | int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags); | ||
13 | int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags); | ||
14 | char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); | ||
15 | int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); | ||
16 | |||
17 | =head1 DESCRIPTION | ||
18 | |||
19 | X509_NAME_print_ex() prints a human readable version of B<nm> to BIO B<out>. Each | ||
20 | line (for multiline formats) is indented by B<indent> spaces. The output format | ||
21 | can be extensively customised by use of the B<flags> parameter. | ||
22 | |||
23 | X509_NAME_print_ex_fp() is identical to X509_NAME_print_ex() except the output is | ||
24 | written to FILE pointer B<fp>. | ||
25 | |||
26 | X509_NAME_oneline() prints an ASCII version of B<a> to B<buf>. At most B<size> | ||
27 | bytes will be written. If B<buf> is B<NULL> then a buffer is dynamically allocated | ||
28 | and returned, otherwise B<buf> is returned. | ||
29 | |||
30 | X509_NAME_print() prints out B<name> to B<bp> indenting each line by B<obase> | ||
31 | characters. Multiple lines are used if the output (including indent) exceeds | ||
32 | 80 characters. | ||
33 | |||
34 | =head1 NOTES | ||
35 | |||
36 | The functions X509_NAME_oneline() and X509_NAME_print() are legacy functions which | ||
37 | produce a non standard output form, they don't handle multi character fields and | ||
38 | have various quirks and inconsistencies. Their use is strongly discouraged in new | ||
39 | applications. | ||
40 | |||
41 | Although there are a large number of possible flags for most purposes | ||
42 | B<XN_FLAG_ONELINE>, B<XN_FLAG_MULTILINE> or B<XN_FLAG_RFC2253> will suffice. | ||
43 | As noted on the L<ASN1_STRING_print_ex(3)|ASN1_STRING_print_ex(3)> manual page | ||
44 | for UTF8 terminals the B<ASN1_STRFLGS_ESC_MSB> should be unset: so for example | ||
45 | B<XN_FLAG_ONELINE & ~ASN1_STRFLGS_ESC_MSB> would be used. | ||
46 | |||
47 | The complete set of the flags supported by X509_NAME_print_ex() is listed below. | ||
48 | |||
49 | Several options can be ored together. | ||
50 | |||
51 | The options B<XN_FLAG_SEP_COMMA_PLUS>, B<XN_FLAG_SEP_CPLUS_SPC>, | ||
52 | B<XN_FLAG_SEP_SPLUS_SPC> and B<XN_FLAG_SEP_MULTILINE> determine the field separators | ||
53 | to use. Two distinct separators are used between distinct RelativeDistinguishedName | ||
54 | components and separate values in the same RDN for a multi-valued RDN. Multi-valued | ||
55 | RDNs are currently very rare so the second separator will hardly ever be used. | ||
56 | |||
57 | B<XN_FLAG_SEP_COMMA_PLUS> uses comma and plus as separators. B<XN_FLAG_SEP_CPLUS_SPC> | ||
58 | uses comma and plus with spaces: this is more readable that plain comma and plus. | ||
59 | B<XN_FLAG_SEP_SPLUS_SPC> uses spaced semicolon and plus. B<XN_FLAG_SEP_MULTILINE> uses | ||
60 | spaced newline and plus respectively. | ||
61 | |||
62 | If B<XN_FLAG_DN_REV> is set the whole DN is printed in reversed order. | ||
63 | |||
64 | The fields B<XN_FLAG_FN_SN>, B<XN_FLAG_FN_LN>, B<XN_FLAG_FN_OID>, | ||
65 | B<XN_FLAG_FN_NONE> determine how a field name is displayed. It will | ||
66 | use the short name (e.g. CN) the long name (e.g. commonName) always | ||
67 | use OID numerical form (normally OIDs are only used if the field name is not | ||
68 | recognised) and no field name respectively. | ||
69 | |||
70 | If B<XN_FLAG_SPC_EQ> is set then spaces will be placed around the '=' character | ||
71 | separating field names and values. | ||
72 | |||
73 | If B<XN_FLAG_DUMP_UNKNOWN_FIELDS> is set then the encoding of unknown fields is | ||
74 | printed instead of the values. | ||
75 | |||
76 | If B<XN_FLAG_FN_ALIGN> is set then field names are padded to 20 characters: this | ||
77 | is only of use for multiline format. | ||
78 | |||
79 | Additionally all the options supported by ASN1_STRING_print_ex() can be used to | ||
80 | control how each field value is displayed. | ||
81 | |||
82 | In addition a number options can be set for commonly used formats. | ||
83 | |||
84 | B<XN_FLAG_RFC2253> sets options which produce an output compatible with RFC2253 it | ||
85 | is equivalent to: | ||
86 | B<ASN1_STRFLGS_RFC2253 | XN_FLAG_SEP_COMMA_PLUS | XN_FLAG_DN_REV | XN_FLAG_FN_SN | XN_FLAG_DUMP_UNKNOWN_FIELDS> | ||
87 | |||
88 | |||
89 | B<XN_FLAG_ONELINE> is a more readable one line format it is the same as: | ||
90 | B<ASN1_STRFLGS_RFC2253 | ASN1_STRFLGS_ESC_QUOTE | XN_FLAG_SEP_CPLUS_SPC | XN_FLAG_SPC_EQ | XN_FLAG_FN_SN> | ||
91 | |||
92 | B<XN_FLAG_MULTILINE> is a multiline format is is the same as: | ||
93 | B<ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB | XN_FLAG_SEP_MULTILINE | XN_FLAG_SPC_EQ | XN_FLAG_FN_LN | XN_FLAG_FN_ALIGN> | ||
94 | |||
95 | B<XN_FLAG_COMPAT> uses a format identical to X509_NAME_print(): in fact it calls X509_NAME_print() internally. | ||
96 | |||
97 | =head1 SEE ALSO | ||
98 | |||
99 | L<ASN1_STRING_print_ex(3)|ASN1_STRING_print_ex(3)> | ||
100 | |||
101 | =head1 HISTORY | ||
102 | |||
103 | TBA | ||
104 | |||
105 | =cut | ||
diff --git a/src/lib/libcrypto/doc/X509_new.pod b/src/lib/libcrypto/doc/X509_new.pod deleted file mode 100644 index fd5fc65ce1..0000000000 --- a/src/lib/libcrypto/doc/X509_new.pod +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | X509_new, X509_free - X509 certificate ASN1 allocation functions | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | X509 *X509_new(void); | ||
10 | void X509_free(X509 *a); | ||
11 | |||
12 | =head1 DESCRIPTION | ||
13 | |||
14 | The X509 ASN1 allocation routines, allocate and free an | ||
15 | X509 structure, which represents an X509 certificate. | ||
16 | |||
17 | X509_new() allocates and initializes a X509 structure. | ||
18 | |||
19 | X509_free() frees up the B<X509> structure B<a>. | ||
20 | |||
21 | =head1 RETURN VALUES | ||
22 | |||
23 | If the allocation fails, X509_new() returns B<NULL> and sets an error | ||
24 | code that can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
25 | Otherwise it returns a pointer to the newly allocated structure. | ||
26 | |||
27 | X509_free() returns no value. | ||
28 | |||
29 | =head1 SEE ALSO | ||
30 | |||
31 | L<ERR_get_error(3)|ERR_get_error(3)>, L<d2i_X509(3)|d2i_X509(3)> | ||
32 | |||
33 | =head1 HISTORY | ||
34 | |||
35 | X509_new() and X509_free() are available in all versions of SSLeay and OpenSSL. | ||
36 | |||
37 | =cut | ||
diff --git a/src/lib/libcrypto/doc/bn.pod b/src/lib/libcrypto/doc/bn.pod deleted file mode 100644 index 210dfeac08..0000000000 --- a/src/lib/libcrypto/doc/bn.pod +++ /dev/null | |||
@@ -1,158 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | bn - multiprecision integer arithmetics | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/bn.h> | ||
10 | |||
11 | BIGNUM *BN_new(void); | ||
12 | void BN_free(BIGNUM *a); | ||
13 | void BN_init(BIGNUM *); | ||
14 | void BN_clear(BIGNUM *a); | ||
15 | void BN_clear_free(BIGNUM *a); | ||
16 | |||
17 | BN_CTX *BN_CTX_new(void); | ||
18 | void BN_CTX_init(BN_CTX *c); | ||
19 | void BN_CTX_free(BN_CTX *c); | ||
20 | |||
21 | BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b); | ||
22 | BIGNUM *BN_dup(const BIGNUM *a); | ||
23 | |||
24 | BIGNUM *BN_swap(BIGNUM *a, BIGNUM *b); | ||
25 | |||
26 | int BN_num_bytes(const BIGNUM *a); | ||
27 | int BN_num_bits(const BIGNUM *a); | ||
28 | int BN_num_bits_word(BN_ULONG w); | ||
29 | |||
30 | int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); | ||
31 | int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); | ||
32 | int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); | ||
33 | int BN_sqr(BIGNUM *r, BIGNUM *a, BN_CTX *ctx); | ||
34 | int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *a, const BIGNUM *d, | ||
35 | BN_CTX *ctx); | ||
36 | int BN_mod(BIGNUM *rem, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); | ||
37 | int BN_nnmod(BIGNUM *rem, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); | ||
38 | int BN_mod_add(BIGNUM *ret, BIGNUM *a, BIGNUM *b, const BIGNUM *m, | ||
39 | BN_CTX *ctx); | ||
40 | int BN_mod_sub(BIGNUM *ret, BIGNUM *a, BIGNUM *b, const BIGNUM *m, | ||
41 | BN_CTX *ctx); | ||
42 | int BN_mod_mul(BIGNUM *ret, BIGNUM *a, BIGNUM *b, const BIGNUM *m, | ||
43 | BN_CTX *ctx); | ||
44 | int BN_mod_sqr(BIGNUM *ret, BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); | ||
45 | int BN_exp(BIGNUM *r, BIGNUM *a, BIGNUM *p, BN_CTX *ctx); | ||
46 | int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, | ||
47 | const BIGNUM *m, BN_CTX *ctx); | ||
48 | int BN_gcd(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); | ||
49 | |||
50 | int BN_add_word(BIGNUM *a, BN_ULONG w); | ||
51 | int BN_sub_word(BIGNUM *a, BN_ULONG w); | ||
52 | int BN_mul_word(BIGNUM *a, BN_ULONG w); | ||
53 | BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w); | ||
54 | BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w); | ||
55 | |||
56 | int BN_cmp(BIGNUM *a, BIGNUM *b); | ||
57 | int BN_ucmp(BIGNUM *a, BIGNUM *b); | ||
58 | int BN_is_zero(BIGNUM *a); | ||
59 | int BN_is_one(BIGNUM *a); | ||
60 | int BN_is_word(BIGNUM *a, BN_ULONG w); | ||
61 | int BN_is_odd(BIGNUM *a); | ||
62 | |||
63 | int BN_zero(BIGNUM *a); | ||
64 | int BN_one(BIGNUM *a); | ||
65 | const BIGNUM *BN_value_one(void); | ||
66 | int BN_set_word(BIGNUM *a, unsigned long w); | ||
67 | unsigned long BN_get_word(BIGNUM *a); | ||
68 | |||
69 | int BN_rand(BIGNUM *rnd, int bits, int top, int bottom); | ||
70 | int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom); | ||
71 | int BN_rand_range(BIGNUM *rnd, BIGNUM *range); | ||
72 | int BN_pseudo_rand_range(BIGNUM *rnd, BIGNUM *range); | ||
73 | |||
74 | BIGNUM *BN_generate_prime(BIGNUM *ret, int bits,int safe, BIGNUM *add, | ||
75 | BIGNUM *rem, void (*callback)(int, int, void *), void *cb_arg); | ||
76 | int BN_is_prime(const BIGNUM *p, int nchecks, | ||
77 | void (*callback)(int, int, void *), BN_CTX *ctx, void *cb_arg); | ||
78 | |||
79 | int BN_set_bit(BIGNUM *a, int n); | ||
80 | int BN_clear_bit(BIGNUM *a, int n); | ||
81 | int BN_is_bit_set(const BIGNUM *a, int n); | ||
82 | int BN_mask_bits(BIGNUM *a, int n); | ||
83 | int BN_lshift(BIGNUM *r, const BIGNUM *a, int n); | ||
84 | int BN_lshift1(BIGNUM *r, BIGNUM *a); | ||
85 | int BN_rshift(BIGNUM *r, BIGNUM *a, int n); | ||
86 | int BN_rshift1(BIGNUM *r, BIGNUM *a); | ||
87 | |||
88 | int BN_bn2bin(const BIGNUM *a, unsigned char *to); | ||
89 | BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret); | ||
90 | char *BN_bn2hex(const BIGNUM *a); | ||
91 | char *BN_bn2dec(const BIGNUM *a); | ||
92 | int BN_hex2bn(BIGNUM **a, const char *str); | ||
93 | int BN_dec2bn(BIGNUM **a, const char *str); | ||
94 | int BN_print(BIO *fp, const BIGNUM *a); | ||
95 | int BN_print_fp(FILE *fp, const BIGNUM *a); | ||
96 | int BN_bn2mpi(const BIGNUM *a, unsigned char *to); | ||
97 | BIGNUM *BN_mpi2bn(unsigned char *s, int len, BIGNUM *ret); | ||
98 | |||
99 | BIGNUM *BN_mod_inverse(BIGNUM *r, BIGNUM *a, const BIGNUM *n, | ||
100 | BN_CTX *ctx); | ||
101 | |||
102 | BN_RECP_CTX *BN_RECP_CTX_new(void); | ||
103 | void BN_RECP_CTX_init(BN_RECP_CTX *recp); | ||
104 | void BN_RECP_CTX_free(BN_RECP_CTX *recp); | ||
105 | int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *m, BN_CTX *ctx); | ||
106 | int BN_mod_mul_reciprocal(BIGNUM *r, BIGNUM *a, BIGNUM *b, | ||
107 | BN_RECP_CTX *recp, BN_CTX *ctx); | ||
108 | |||
109 | BN_MONT_CTX *BN_MONT_CTX_new(void); | ||
110 | void BN_MONT_CTX_init(BN_MONT_CTX *ctx); | ||
111 | void BN_MONT_CTX_free(BN_MONT_CTX *mont); | ||
112 | int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *m, BN_CTX *ctx); | ||
113 | BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from); | ||
114 | int BN_mod_mul_montgomery(BIGNUM *r, BIGNUM *a, BIGNUM *b, | ||
115 | BN_MONT_CTX *mont, BN_CTX *ctx); | ||
116 | int BN_from_montgomery(BIGNUM *r, BIGNUM *a, BN_MONT_CTX *mont, | ||
117 | BN_CTX *ctx); | ||
118 | int BN_to_montgomery(BIGNUM *r, BIGNUM *a, BN_MONT_CTX *mont, | ||
119 | BN_CTX *ctx); | ||
120 | |||
121 | |||
122 | =head1 DESCRIPTION | ||
123 | |||
124 | This library performs arithmetic operations on integers of arbitrary | ||
125 | size. It was written for use in public key cryptography, such as RSA | ||
126 | and Diffie-Hellman. | ||
127 | |||
128 | It uses dynamic memory allocation for storing its data structures. | ||
129 | That means that there is no limit on the size of the numbers | ||
130 | manipulated by these functions, but return values must always be | ||
131 | checked in case a memory allocation error has occurred. | ||
132 | |||
133 | The basic object in this library is a B<BIGNUM>. It is used to hold a | ||
134 | single large integer. This type should be considered opaque and fields | ||
135 | should not be modified or accessed directly. | ||
136 | |||
137 | The creation of B<BIGNUM> objects is described in L<BN_new(3)|BN_new(3)>; | ||
138 | L<BN_add(3)|BN_add(3)> describes most of the arithmetic operations. | ||
139 | Comparison is described in L<BN_cmp(3)|BN_cmp(3)>; L<BN_zero(3)|BN_zero(3)> | ||
140 | describes certain assignments, L<BN_rand(3)|BN_rand(3)> the generation of | ||
141 | random numbers, L<BN_generate_prime(3)|BN_generate_prime(3)> deals with prime | ||
142 | numbers and L<BN_set_bit(3)|BN_set_bit(3)> with bit operations. The conversion | ||
143 | of B<BIGNUM>s to external formats is described in L<BN_bn2bin(3)|BN_bn2bin(3)>. | ||
144 | |||
145 | =head1 SEE ALSO | ||
146 | |||
147 | L<bn_internal(3)|bn_internal(3)>, | ||
148 | L<dh(3)|dh(3)>, L<err(3)|err(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, | ||
149 | L<BN_new(3)|BN_new(3)>, L<BN_CTX_new(3)|BN_CTX_new(3)>, | ||
150 | L<BN_copy(3)|BN_copy(3)>, L<BN_swap(3)|BN_swap(3)>, L<BN_num_bytes(3)|BN_num_bytes(3)>, | ||
151 | L<BN_add(3)|BN_add(3)>, L<BN_add_word(3)|BN_add_word(3)>, | ||
152 | L<BN_cmp(3)|BN_cmp(3)>, L<BN_zero(3)|BN_zero(3)>, L<BN_rand(3)|BN_rand(3)>, | ||
153 | L<BN_generate_prime(3)|BN_generate_prime(3)>, L<BN_set_bit(3)|BN_set_bit(3)>, | ||
154 | L<BN_bn2bin(3)|BN_bn2bin(3)>, L<BN_mod_inverse(3)|BN_mod_inverse(3)>, | ||
155 | L<BN_mod_mul_reciprocal(3)|BN_mod_mul_reciprocal(3)>, | ||
156 | L<BN_mod_mul_montgomery(3)|BN_mod_mul_montgomery(3)> | ||
157 | |||
158 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_ASN1_OBJECT.pod b/src/lib/libcrypto/doc/d2i_ASN1_OBJECT.pod deleted file mode 100644 index 45bb18492c..0000000000 --- a/src/lib/libcrypto/doc/d2i_ASN1_OBJECT.pod +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | d2i_ASN1_OBJECT, i2d_ASN1_OBJECT - ASN1 OBJECT IDENTIFIER functions | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/objects.h> | ||
10 | |||
11 | ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp, long length); | ||
12 | int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp); | ||
13 | |||
14 | =head1 DESCRIPTION | ||
15 | |||
16 | These functions decode and encode an ASN1 OBJECT IDENTIFIER. | ||
17 | |||
18 | Othewise these behave in a similar way to d2i_X509() and i2d_X509() | ||
19 | described in the L<d2i_X509(3)|d2i_X509(3)> manual page. | ||
20 | |||
21 | =head1 SEE ALSO | ||
22 | |||
23 | L<d2i_X509(3)|d2i_X509(3)> | ||
24 | |||
25 | =head1 HISTORY | ||
26 | |||
27 | TBA | ||
28 | |||
29 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_DHparams.pod b/src/lib/libcrypto/doc/d2i_DHparams.pod deleted file mode 100644 index 1e98aebeca..0000000000 --- a/src/lib/libcrypto/doc/d2i_DHparams.pod +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | d2i_DHparams, i2d_DHparams - PKCS#3 DH parameter functions. | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/dh.h> | ||
10 | |||
11 | DH *d2i_DHparams(DH **a, unsigned char **pp, long length); | ||
12 | int i2d_DHparams(DH *a, unsigned char **pp); | ||
13 | |||
14 | =head1 DESCRIPTION | ||
15 | |||
16 | These functions decode and encode PKCS#3 DH parameters using the | ||
17 | DHparameter structure described in PKCS#3. | ||
18 | |||
19 | Othewise these behave in a similar way to d2i_X509() and i2d_X509() | ||
20 | described in the L<d2i_X509(3)|d2i_X509(3)> manual page. | ||
21 | |||
22 | =head1 SEE ALSO | ||
23 | |||
24 | L<d2i_X509(3)|d2i_X509(3)> | ||
25 | |||
26 | =head1 HISTORY | ||
27 | |||
28 | TBA | ||
29 | |||
30 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_DSAPublicKey.pod b/src/lib/libcrypto/doc/d2i_DSAPublicKey.pod deleted file mode 100644 index 22c1b50f22..0000000000 --- a/src/lib/libcrypto/doc/d2i_DSAPublicKey.pod +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | d2i_DSAPublicKey, i2d_DSAPublicKey, d2i_DSAPrivateKey, i2d_DSAPrivateKey, | ||
6 | d2i_DSA_PUBKEY, i2d_DSA_PUBKEY, d2i_DSA_SIG, i2d_DSA_SIG - DSA key encoding | ||
7 | and parsing functions. | ||
8 | |||
9 | =head1 SYNOPSIS | ||
10 | |||
11 | #include <openssl/dsa.h> | ||
12 | #include <openssl/x509.h> | ||
13 | |||
14 | DSA * d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length); | ||
15 | |||
16 | int i2d_DSAPublicKey(const DSA *a, unsigned char **pp); | ||
17 | |||
18 | DSA * d2i_DSA_PUBKEY(DSA **a, const unsigned char **pp, long length); | ||
19 | |||
20 | int i2d_DSA_PUBKEY(const DSA *a, unsigned char **pp); | ||
21 | |||
22 | DSA * d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length); | ||
23 | |||
24 | int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp); | ||
25 | |||
26 | DSA * d2i_DSAparams(DSA **a, const unsigned char **pp, long length); | ||
27 | |||
28 | int i2d_DSAparams(const DSA *a, unsigned char **pp); | ||
29 | |||
30 | DSA * d2i_DSA_SIG(DSA_SIG **a, const unsigned char **pp, long length); | ||
31 | |||
32 | int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp); | ||
33 | |||
34 | =head1 DESCRIPTION | ||
35 | |||
36 | d2i_DSAPublicKey() and i2d_DSAPublicKey() decode and encode the DSA public key | ||
37 | components structure. | ||
38 | |||
39 | d2i_DSA_PUBKEY() and i2d_DSA_PUBKEY() decode and encode an DSA public key using | ||
40 | a SubjectPublicKeyInfo (certificate public key) structure. | ||
41 | |||
42 | d2i_DSAPrivateKey(), i2d_DSAPrivateKey() decode and encode the DSA private key | ||
43 | components. | ||
44 | |||
45 | d2i_DSAparams(), i2d_DSAparams() decode and encode the DSA parameters using | ||
46 | a B<Dss-Parms> structure as defined in RFC2459. | ||
47 | |||
48 | d2i_DSA_SIG(), i2d_DSA_SIG() decode and encode a DSA signature using a | ||
49 | B<Dss-Sig-Value> structure as defined in RFC2459. | ||
50 | |||
51 | The usage of all of these functions is similar to the d2i_X509() and | ||
52 | i2d_X509() described in the L<d2i_X509(3)|d2i_X509(3)> manual page. | ||
53 | |||
54 | =head1 NOTES | ||
55 | |||
56 | The B<DSA> structure passed to the private key encoding functions should have | ||
57 | all the private key components present. | ||
58 | |||
59 | The data encoded by the private key functions is unencrypted and therefore | ||
60 | offers no private key security. | ||
61 | |||
62 | The B<DSA_PUBKEY> functions should be used in preference to the B<DSAPublicKey> | ||
63 | functions when encoding public keys because they use a standard format. | ||
64 | |||
65 | The B<DSAPublicKey> functions use an non standard format the actual data encoded | ||
66 | depends on the value of the B<write_params> field of the B<a> key parameter. | ||
67 | If B<write_params> is zero then only the B<pub_key> field is encoded as an | ||
68 | B<INTEGER>. If B<write_params> is 1 then a B<SEQUENCE> consisting of the | ||
69 | B<p>, B<q>, B<g> and B<pub_key> respectively fields are encoded. | ||
70 | |||
71 | The B<DSAPrivateKey> functions also use a non standard structure consiting | ||
72 | consisting of a SEQUENCE containing the B<p>, B<q>, B<g> and B<pub_key> and | ||
73 | B<priv_key> fields respectively. | ||
74 | |||
75 | =head1 SEE ALSO | ||
76 | |||
77 | L<d2i_X509(3)|d2i_X509(3)> | ||
78 | |||
79 | =head1 HISTORY | ||
80 | |||
81 | TBA | ||
82 | |||
83 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_RSAPublicKey.pod b/src/lib/libcrypto/doc/d2i_RSAPublicKey.pod deleted file mode 100644 index 279b29c873..0000000000 --- a/src/lib/libcrypto/doc/d2i_RSAPublicKey.pod +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | d2i_RSAPublicKey, i2d_RSAPublicKey, d2i_RSAPrivateKey, i2d_RSAPrivateKey, | ||
6 | d2i_RSA_PUBKEY, i2d_RSA_PUBKEY, i2d_Netscape_RSA, | ||
7 | d2i_Netscape_RSA - RSA public and private key encoding functions. | ||
8 | |||
9 | =head1 SYNOPSIS | ||
10 | |||
11 | #include <openssl/rsa.h> | ||
12 | #include <openssl/x509.h> | ||
13 | |||
14 | RSA * d2i_RSAPublicKey(RSA **a, unsigned char **pp, long length); | ||
15 | |||
16 | int i2d_RSAPublicKey(RSA *a, unsigned char **pp); | ||
17 | |||
18 | RSA * d2i_RSA_PUBKEY(RSA **a, unsigned char **pp, long length); | ||
19 | |||
20 | int i2d_RSA_PUBKEY(RSA *a, unsigned char **pp); | ||
21 | |||
22 | RSA * d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length); | ||
23 | |||
24 | int i2d_RSAPrivateKey(RSA *a, unsigned char **pp); | ||
25 | |||
26 | int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)()); | ||
27 | |||
28 | RSA * d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)()); | ||
29 | |||
30 | =head1 DESCRIPTION | ||
31 | |||
32 | d2i_RSAPublicKey() and i2d_RSAPublicKey() decode and encode a PKCS#1 RSAPublicKey | ||
33 | structure. | ||
34 | |||
35 | d2i_RSA_PUBKEY() and i2d_RSA_PUBKEY() decode and encode an RSA public key using | ||
36 | a SubjectPublicKeyInfo (certificate public key) structure. | ||
37 | |||
38 | d2i_RSAPrivateKey(), i2d_RSAPrivateKey() decode and encode a PKCS#1 RSAPrivateKey | ||
39 | structure. | ||
40 | |||
41 | d2i_Netscape_RSA(), i2d_Netscape_RSA() decode and encode an RSA private key in | ||
42 | NET format. | ||
43 | |||
44 | The usage of all of these functions is similar to the d2i_X509() and | ||
45 | i2d_X509() described in the L<d2i_X509(3)|d2i_X509(3)> manual page. | ||
46 | |||
47 | =head1 NOTES | ||
48 | |||
49 | The B<RSA> structure passed to the private key encoding functions should have | ||
50 | all the PKCS#1 private key components present. | ||
51 | |||
52 | The data encoded by the private key functions is unencrypted and therefore | ||
53 | offers no private key security. | ||
54 | |||
55 | The NET format functions are present to provide compatibility with certain very | ||
56 | old software. This format has some severe security weaknesses and should be | ||
57 | avoided if possible. | ||
58 | |||
59 | =head1 SEE ALSO | ||
60 | |||
61 | L<d2i_X509(3)|d2i_X509(3)> | ||
62 | |||
63 | =head1 HISTORY | ||
64 | |||
65 | TBA | ||
66 | |||
67 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_X509.pod b/src/lib/libcrypto/doc/d2i_X509.pod deleted file mode 100644 index 5e3c3d0985..0000000000 --- a/src/lib/libcrypto/doc/d2i_X509.pod +++ /dev/null | |||
@@ -1,231 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | d2i_X509, i2d_X509, d2i_X509_bio, d2i_X509_fp, i2d_X509_bio, | ||
6 | i2d_X509_fp - X509 encode and decode functions | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/x509.h> | ||
11 | |||
12 | X509 *d2i_X509(X509 **px, unsigned char **in, int len); | ||
13 | int i2d_X509(X509 *x, unsigned char **out); | ||
14 | |||
15 | X509 *d2i_X509_bio(BIO *bp, X509 **x); | ||
16 | X509 *d2i_X509_fp(FILE *fp, X509 **x); | ||
17 | |||
18 | int i2d_X509_bio(X509 *x, BIO *bp); | ||
19 | int i2d_X509_fp(X509 *x, FILE *fp); | ||
20 | |||
21 | =head1 DESCRIPTION | ||
22 | |||
23 | The X509 encode and decode routines encode and parse an | ||
24 | B<X509> structure, which represents an X509 certificate. | ||
25 | |||
26 | d2i_X509() attempts to decode B<len> bytes at B<*out>. If | ||
27 | successful a pointer to the B<X509> structure is returned. If an error | ||
28 | occurred then B<NULL> is returned. If B<px> is not B<NULL> then the | ||
29 | returned structure is written to B<*px>. If B<*px> is not B<NULL> | ||
30 | then it is assumed that B<*px> contains a valid B<X509> | ||
31 | structure and an attempt is made to reuse it. If the call is | ||
32 | successful B<*out> is incremented to the byte following the | ||
33 | parsed data. | ||
34 | |||
35 | i2d_X509() encodes the structure pointed to by B<x> into DER format. | ||
36 | If B<out> is not B<NULL> is writes the DER encoded data to the buffer | ||
37 | at B<*out>, and increments it to point after the data just written. | ||
38 | If the return value is negative an error occurred, otherwise it | ||
39 | returns the length of the encoded data. | ||
40 | |||
41 | For OpenSSL 0.9.7 and later if B<*out> is B<NULL> memory will be | ||
42 | allocated for a buffer and the encoded data written to it. In this | ||
43 | case B<*out> is not incremented and it points to the start of the | ||
44 | data just written. | ||
45 | |||
46 | d2i_X509_bio() is similar to d2i_X509() except it attempts | ||
47 | to parse data from BIO B<bp>. | ||
48 | |||
49 | d2i_X509_fp() is similar to d2i_X509() except it attempts | ||
50 | to parse data from FILE pointer B<fp>. | ||
51 | |||
52 | i2d_X509_bio() is similar to i2d_X509() except it writes | ||
53 | the encoding of the structure B<x> to BIO B<bp> and it | ||
54 | returns 1 for success and 0 for failure. | ||
55 | |||
56 | i2d_X509_fp() is similar to i2d_X509() except it writes | ||
57 | the encoding of the structure B<x> to BIO B<bp> and it | ||
58 | returns 1 for success and 0 for failure. | ||
59 | |||
60 | =head1 NOTES | ||
61 | |||
62 | The letters B<i> and B<d> in for example B<i2d_X509> stand for | ||
63 | "internal" (that is an internal C structure) and "DER". So that | ||
64 | B<i2d_X509> converts from internal to DER. | ||
65 | |||
66 | The functions can also understand B<BER> forms. | ||
67 | |||
68 | The actual X509 structure passed to i2d_X509() must be a valid | ||
69 | populated B<X509> structure it can B<not> simply be fed with an | ||
70 | empty structure such as that returned by X509_new(). | ||
71 | |||
72 | The encoded data is in binary form and may contain embedded zeroes. | ||
73 | Therefore any FILE pointers or BIOs should be opened in binary mode. | ||
74 | Functions such as B<strlen()> will B<not> return the correct length | ||
75 | of the encoded structure. | ||
76 | |||
77 | The ways that B<*in> and B<*out> are incremented after the operation | ||
78 | can trap the unwary. See the B<WARNINGS> section for some common | ||
79 | errors. | ||
80 | |||
81 | The reason for the auto increment behaviour is to reflect a typical | ||
82 | usage of ASN1 functions: after one structure is encoded or decoded | ||
83 | another will processed after it. | ||
84 | |||
85 | =head1 EXAMPLES | ||
86 | |||
87 | Allocate and encode the DER encoding of an X509 structure: | ||
88 | |||
89 | int len; | ||
90 | unsigned char *buf, *p; | ||
91 | |||
92 | len = i2d_X509(x, NULL); | ||
93 | |||
94 | buf = OPENSSL_malloc(len); | ||
95 | |||
96 | if (buf == NULL) | ||
97 | /* error */ | ||
98 | |||
99 | p = buf; | ||
100 | |||
101 | i2d_X509(x, &p); | ||
102 | |||
103 | If you are using OpenSSL 0.9.7 or later then this can be | ||
104 | simplified to: | ||
105 | |||
106 | |||
107 | int len; | ||
108 | unsigned char *buf; | ||
109 | |||
110 | buf = NULL; | ||
111 | |||
112 | len = i2d_X509(x, &buf); | ||
113 | |||
114 | if (len < 0) | ||
115 | /* error */ | ||
116 | |||
117 | Attempt to decode a buffer: | ||
118 | |||
119 | X509 *x; | ||
120 | |||
121 | unsigned char *buf, *p; | ||
122 | |||
123 | int len; | ||
124 | |||
125 | /* Something to setup buf and len */ | ||
126 | |||
127 | p = buf; | ||
128 | |||
129 | x = d2i_X509(NULL, &p, len); | ||
130 | |||
131 | if (x == NULL) | ||
132 | /* Some error */ | ||
133 | |||
134 | Alternative technique: | ||
135 | |||
136 | X509 *x; | ||
137 | |||
138 | unsigned char *buf, *p; | ||
139 | |||
140 | int len; | ||
141 | |||
142 | /* Something to setup buf and len */ | ||
143 | |||
144 | p = buf; | ||
145 | |||
146 | x = NULL; | ||
147 | |||
148 | if(!d2i_X509(&x, &p, len)) | ||
149 | /* Some error */ | ||
150 | |||
151 | |||
152 | =head1 WARNINGS | ||
153 | |||
154 | The use of temporary variable is mandatory. A common | ||
155 | mistake is to attempt to use a buffer directly as follows: | ||
156 | |||
157 | int len; | ||
158 | unsigned char *buf; | ||
159 | |||
160 | len = i2d_X509(x, NULL); | ||
161 | |||
162 | buf = OPENSSL_malloc(len); | ||
163 | |||
164 | if (buf == NULL) | ||
165 | /* error */ | ||
166 | |||
167 | i2d_X509(x, &buf); | ||
168 | |||
169 | /* Other stuff ... */ | ||
170 | |||
171 | OPENSSL_free(buf); | ||
172 | |||
173 | This code will result in B<buf> apparently containing garbage because | ||
174 | it was incremented after the call to point after the data just written. | ||
175 | Also B<buf> will no longer contain the pointer allocated by B<OPENSSL_malloc()> | ||
176 | and the subsequent call to B<OPENSSL_free()> may well crash. | ||
177 | |||
178 | The auto allocation feature (setting buf to NULL) only works on OpenSSL | ||
179 | 0.9.7 and later. Attempts to use it on earlier versions will typically | ||
180 | cause a segmentation violation. | ||
181 | |||
182 | Another trap to avoid is misuse of the B<xp> argument to B<d2i_X509()>: | ||
183 | |||
184 | X509 *x; | ||
185 | |||
186 | if (!d2i_X509(&x, &p, len)) | ||
187 | /* Some error */ | ||
188 | |||
189 | This will probably crash somewhere in B<d2i_X509()>. The reason for this | ||
190 | is that the variable B<x> is uninitialized and an attempt will be made to | ||
191 | interpret its (invalid) value as an B<X509> structure, typically causing | ||
192 | a segmentation violation. If B<x> is set to NULL first then this will not | ||
193 | happen. | ||
194 | |||
195 | =head1 BUGS | ||
196 | |||
197 | In some versions of OpenSSL the "reuse" behaviour of d2i_X509() when | ||
198 | B<*px> is valid is broken and some parts of the reused structure may | ||
199 | persist if they are not present in the new one. As a result the use | ||
200 | of this "reuse" behaviour is strongly discouraged. | ||
201 | |||
202 | i2d_X509() will not return an error in many versions of OpenSSL, | ||
203 | if mandatory fields are not initialized due to a programming error | ||
204 | then the encoded structure may contain invalid data or omit the | ||
205 | fields entirely and will not be parsed by d2i_X509(). This may be | ||
206 | fixed in future so code should not assume that i2d_X509() will | ||
207 | always succeed. | ||
208 | |||
209 | =head1 RETURN VALUES | ||
210 | |||
211 | d2i_X509(), d2i_X509_bio() and d2i_X509_fp() return a valid B<X509> structure | ||
212 | or B<NULL> if an error occurs. The error code that can be obtained by | ||
213 | L<ERR_get_error(3)|ERR_get_error(3)>. | ||
214 | |||
215 | i2d_X509(), i2d_X509_bio() and i2d_X509_fp() return a the number of bytes | ||
216 | successfully encoded or a negative value if an error occurs. The error code | ||
217 | can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
218 | |||
219 | i2d_X509_bio() and i2d_X509_fp() returns 1 for success and 0 if an error | ||
220 | occurs The error code can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
221 | |||
222 | =head1 SEE ALSO | ||
223 | |||
224 | L<ERR_get_error(3)|ERR_get_error(3)> | ||
225 | |||
226 | =head1 HISTORY | ||
227 | |||
228 | d2i_X509, i2d_X509, d2i_X509_bio, d2i_X509_fp, i2d_X509_bio and i2d_X509_fp | ||
229 | are available in all versions of SSLeay and OpenSSL. | ||
230 | |||
231 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_X509_ALGOR.pod b/src/lib/libcrypto/doc/d2i_X509_ALGOR.pod deleted file mode 100644 index 9e5cd92ca7..0000000000 --- a/src/lib/libcrypto/doc/d2i_X509_ALGOR.pod +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | d2i_X509_ALGOR, i2d_X509_ALGOR - AlgorithmIdentifier functions. | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/x509.h> | ||
10 | |||
11 | X509_ALGOR *d2i_X509_ALGOR(X509_ALGOR **a, unsigned char **pp, long length); | ||
12 | int i2d_X509_ALGOR(X509_ALGOR *a, unsigned char **pp); | ||
13 | |||
14 | =head1 DESCRIPTION | ||
15 | |||
16 | These functions decode and encode an B<X509_ALGOR> structure which is | ||
17 | equivalent to the B<AlgorithmIdentifier> structure. | ||
18 | |||
19 | Othewise these behave in a similar way to d2i_X509() and i2d_X509() | ||
20 | described in the L<d2i_X509(3)|d2i_X509(3)> manual page. | ||
21 | |||
22 | =head1 SEE ALSO | ||
23 | |||
24 | L<d2i_X509(3)|d2i_X509(3)> | ||
25 | |||
26 | =head1 HISTORY | ||
27 | |||
28 | TBA | ||
29 | |||
30 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_X509_CRL.pod b/src/lib/libcrypto/doc/d2i_X509_CRL.pod deleted file mode 100644 index 06c5b23c09..0000000000 --- a/src/lib/libcrypto/doc/d2i_X509_CRL.pod +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | d2i_X509_CRL, i2d_X509_CRL, d2i_X509_CRL_bio, d2i_509_CRL_fp, | ||
6 | i2d_X509_CRL_bio, i2d_X509_CRL_fp - PKCS#10 certificate request functions. | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/x509.h> | ||
11 | |||
12 | X509_CRL *d2i_X509_CRL(X509_CRL **a, unsigned char **pp, long length); | ||
13 | int i2d_X509_CRL(X509_CRL *a, unsigned char **pp); | ||
14 | |||
15 | X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **x); | ||
16 | X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **x); | ||
17 | |||
18 | int i2d_X509_CRL_bio(X509_CRL *x, BIO *bp); | ||
19 | int i2d_X509_CRL_fp(X509_CRL *x, FILE *fp); | ||
20 | |||
21 | =head1 DESCRIPTION | ||
22 | |||
23 | These functions decode and encode an X509 CRL (certificate revocation | ||
24 | list). | ||
25 | |||
26 | Othewise the functions behave in a similar way to d2i_X509() and i2d_X509() | ||
27 | described in the L<d2i_X509(3)|d2i_X509(3)> manual page. | ||
28 | |||
29 | =head1 SEE ALSO | ||
30 | |||
31 | L<d2i_X509(3)|d2i_X509(3)> | ||
32 | |||
33 | =head1 HISTORY | ||
34 | |||
35 | TBA | ||
36 | |||
37 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_X509_NAME.pod b/src/lib/libcrypto/doc/d2i_X509_NAME.pod deleted file mode 100644 index 343ffe1519..0000000000 --- a/src/lib/libcrypto/doc/d2i_X509_NAME.pod +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | d2i_X509_NAME, i2d_X509_NAME - X509_NAME encoding functions | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/x509.h> | ||
10 | |||
11 | X509_NAME *d2i_X509_NAME(X509_NAME **a, unsigned char **pp, long length); | ||
12 | int i2d_X509_NAME(X509_NAME *a, unsigned char **pp); | ||
13 | |||
14 | =head1 DESCRIPTION | ||
15 | |||
16 | These functions decode and encode an B<X509_NAME> structure which is the | ||
17 | the same as the B<Name> type defined in RFC2459 (and elsewhere) and used | ||
18 | for example in certificate subject and issuer names. | ||
19 | |||
20 | Othewise the functions behave in a similar way to d2i_X509() and i2d_X509() | ||
21 | described in the L<d2i_X509(3)|d2i_X509(3)> manual page. | ||
22 | |||
23 | =head1 SEE ALSO | ||
24 | |||
25 | L<d2i_X509(3)|d2i_X509(3)> | ||
26 | |||
27 | =head1 HISTORY | ||
28 | |||
29 | TBA | ||
30 | |||
31 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_X509_REQ.pod b/src/lib/libcrypto/doc/d2i_X509_REQ.pod deleted file mode 100644 index be4ad68257..0000000000 --- a/src/lib/libcrypto/doc/d2i_X509_REQ.pod +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | d2i_X509_REQ, i2d_X509_REQ, d2i_X509_REQ_bio, d2i_X509_REQ_fp, | ||
6 | i2d_X509_REQ_bio, i2d_X509_REQ_fp - PKCS#10 certificate request functions. | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/x509.h> | ||
11 | |||
12 | X509_REQ *d2i_X509_REQ(X509_REQ **a, unsigned char **pp, long length); | ||
13 | int i2d_X509_REQ(X509_REQ *a, unsigned char **pp); | ||
14 | |||
15 | X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **x); | ||
16 | X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **x); | ||
17 | |||
18 | int i2d_X509_REQ_bio(X509_REQ *x, BIO *bp); | ||
19 | int i2d_X509_REQ_fp(X509_REQ *x, FILE *fp); | ||
20 | |||
21 | =head1 DESCRIPTION | ||
22 | |||
23 | These functions decode and encode a PKCS#10 certificate request. | ||
24 | |||
25 | Othewise these behave in a similar way to d2i_X509() and i2d_X509() | ||
26 | described in the L<d2i_X509(3)|d2i_X509(3)> manual page. | ||
27 | |||
28 | =head1 SEE ALSO | ||
29 | |||
30 | L<d2i_X509(3)|d2i_X509(3)> | ||
31 | |||
32 | =head1 HISTORY | ||
33 | |||
34 | TBA | ||
35 | |||
36 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_X509_SIG.pod b/src/lib/libcrypto/doc/d2i_X509_SIG.pod deleted file mode 100644 index e48fd79a51..0000000000 --- a/src/lib/libcrypto/doc/d2i_X509_SIG.pod +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | d2i_X509_SIG, i2d_X509_SIG - DigestInfo functions. | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/x509.h> | ||
10 | |||
11 | X509_SIG *d2i_X509_SIG(X509_SIG **a, unsigned char **pp, long length); | ||
12 | int i2d_X509_SIG(X509_SIG *a, unsigned char **pp); | ||
13 | |||
14 | =head1 DESCRIPTION | ||
15 | |||
16 | These functions decode and encode an X509_SIG structure which is | ||
17 | equivalent to the B<DigestInfo> structure defined in PKCS#1 and PKCS#7. | ||
18 | |||
19 | Othewise these behave in a similar way to d2i_X509() and i2d_X509() | ||
20 | described in the L<d2i_X509(3)|d2i_X509(3)> manual page. | ||
21 | |||
22 | =head1 SEE ALSO | ||
23 | |||
24 | L<d2i_X509(3)|d2i_X509(3)> | ||
25 | |||
26 | =head1 HISTORY | ||
27 | |||
28 | TBA | ||
29 | |||
30 | =cut | ||
diff --git a/src/lib/libcrypto/doc/dh.pod b/src/lib/libcrypto/doc/dh.pod deleted file mode 100644 index c3ccd06207..0000000000 --- a/src/lib/libcrypto/doc/dh.pod +++ /dev/null | |||
@@ -1,78 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | dh - Diffie-Hellman key agreement | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/dh.h> | ||
10 | #include <openssl/engine.h> | ||
11 | |||
12 | DH * DH_new(void); | ||
13 | void DH_free(DH *dh); | ||
14 | |||
15 | int DH_size(const DH *dh); | ||
16 | |||
17 | DH * DH_generate_parameters(int prime_len, int generator, | ||
18 | void (*callback)(int, int, void *), void *cb_arg); | ||
19 | int DH_check(const DH *dh, int *codes); | ||
20 | |||
21 | int DH_generate_key(DH *dh); | ||
22 | int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh); | ||
23 | |||
24 | void DH_set_default_method(const DH_METHOD *meth); | ||
25 | const DH_METHOD *DH_get_default_method(void); | ||
26 | int DH_set_method(DH *dh, const DH_METHOD *meth); | ||
27 | DH *DH_new_method(ENGINE *engine); | ||
28 | const DH_METHOD *DH_OpenSSL(void); | ||
29 | |||
30 | int DH_get_ex_new_index(long argl, char *argp, int (*new_func)(), | ||
31 | int (*dup_func)(), void (*free_func)()); | ||
32 | int DH_set_ex_data(DH *d, int idx, char *arg); | ||
33 | char *DH_get_ex_data(DH *d, int idx); | ||
34 | |||
35 | DH * d2i_DHparams(DH **a, unsigned char **pp, long length); | ||
36 | int i2d_DHparams(const DH *a, unsigned char **pp); | ||
37 | |||
38 | int DHparams_print_fp(FILE *fp, const DH *x); | ||
39 | int DHparams_print(BIO *bp, const DH *x); | ||
40 | |||
41 | =head1 DESCRIPTION | ||
42 | |||
43 | These functions implement the Diffie-Hellman key agreement protocol. | ||
44 | The generation of shared DH parameters is described in | ||
45 | L<DH_generate_parameters(3)|DH_generate_parameters(3)>; L<DH_generate_key(3)|DH_generate_key(3)> describes how | ||
46 | to perform a key agreement. | ||
47 | |||
48 | The B<DH> structure consists of several BIGNUM components. | ||
49 | |||
50 | struct | ||
51 | { | ||
52 | BIGNUM *p; // prime number (shared) | ||
53 | BIGNUM *g; // generator of Z_p (shared) | ||
54 | BIGNUM *priv_key; // private DH value x | ||
55 | BIGNUM *pub_key; // public DH value g^x | ||
56 | // ... | ||
57 | }; | ||
58 | DH | ||
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 | |||
68 | =head1 SEE ALSO | ||
69 | |||
70 | L<dhparam(1)|dhparam(1)>, L<bn(3)|bn(3)>, L<dsa(3)|dsa(3)>, L<err(3)|err(3)>, | ||
71 | L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, L<engine(3)|engine(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)>, | ||
74 | L<DH_generate_parameters(3)|DH_generate_parameters(3)>, | ||
75 | L<DH_compute_key(3)|DH_compute_key(3)>, L<d2i_DHparams(3)|d2i_DHparams(3)>, | ||
76 | L<RSA_print(3)|RSA_print(3)> | ||
77 | |||
78 | =cut | ||
diff --git a/src/lib/libcrypto/doc/dsa.pod b/src/lib/libcrypto/doc/dsa.pod deleted file mode 100644 index ae2e5d81f9..0000000000 --- a/src/lib/libcrypto/doc/dsa.pod +++ /dev/null | |||
@@ -1,113 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | dsa - Digital Signature Algorithm | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/dsa.h> | ||
10 | #include <openssl/engine.h> | ||
11 | |||
12 | DSA * DSA_new(void); | ||
13 | void DSA_free(DSA *dsa); | ||
14 | |||
15 | int DSA_size(const DSA *dsa); | ||
16 | |||
17 | DSA * DSA_generate_parameters(int bits, unsigned char *seed, | ||
18 | int seed_len, int *counter_ret, unsigned long *h_ret, | ||
19 | void (*callback)(int, int, void *), void *cb_arg); | ||
20 | |||
21 | DH * DSA_dup_DH(const DSA *r); | ||
22 | |||
23 | int DSA_generate_key(DSA *dsa); | ||
24 | |||
25 | int DSA_sign(int dummy, const unsigned char *dgst, int len, | ||
26 | unsigned char *sigret, unsigned int *siglen, DSA *dsa); | ||
27 | int DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp, | ||
28 | BIGNUM **rp); | ||
29 | int DSA_verify(int dummy, const unsigned char *dgst, int len, | ||
30 | const unsigned char *sigbuf, int siglen, DSA *dsa); | ||
31 | |||
32 | void DSA_set_default_method(const DSA_METHOD *meth); | ||
33 | const DSA_METHOD *DSA_get_default_method(void); | ||
34 | int DSA_set_method(DSA *dsa, const DSA_METHOD *meth); | ||
35 | DSA *DSA_new_method(ENGINE *engine); | ||
36 | const DSA_METHOD *DSA_OpenSSL(void); | ||
37 | |||
38 | int DSA_get_ex_new_index(long argl, char *argp, int (*new_func)(), | ||
39 | int (*dup_func)(), void (*free_func)()); | ||
40 | int DSA_set_ex_data(DSA *d, int idx, char *arg); | ||
41 | char *DSA_get_ex_data(DSA *d, int idx); | ||
42 | |||
43 | DSA_SIG *DSA_SIG_new(void); | ||
44 | void DSA_SIG_free(DSA_SIG *a); | ||
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); | ||
47 | |||
48 | DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa); | ||
49 | int DSA_do_verify(const unsigned char *dgst, int dgst_len, | ||
50 | DSA_SIG *sig, DSA *dsa); | ||
51 | |||
52 | DSA * d2i_DSAPublicKey(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); | ||
55 | int i2d_DSAPublicKey(const DSA *a, unsigned char **pp); | ||
56 | int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp); | ||
57 | int i2d_DSAparams(const DSA *a,unsigned char **pp); | ||
58 | |||
59 | int DSAparams_print(BIO *bp, const DSA *x); | ||
60 | int DSAparams_print_fp(FILE *fp, const DSA *x); | ||
61 | int DSA_print(BIO *bp, const DSA *x, int off); | ||
62 | int DSA_print_fp(FILE *bp, const DSA *x, int off); | ||
63 | |||
64 | =head1 DESCRIPTION | ||
65 | |||
66 | These functions implement the Digital Signature Algorithm (DSA). The | ||
67 | generation of shared DSA parameters is described in | ||
68 | L<DSA_generate_parameters(3)|DSA_generate_parameters(3)>; | ||
69 | L<DSA_generate_key(3)|DSA_generate_key(3)> describes how to | ||
70 | generate a signature key. Signature generation and verification are | ||
71 | described in L<DSA_sign(3)|DSA_sign(3)>. | ||
72 | |||
73 | The B<DSA> structure consists of several BIGNUM components. | ||
74 | |||
75 | struct | ||
76 | { | ||
77 | BIGNUM *p; // prime number (public) | ||
78 | BIGNUM *q; // 160-bit subprime, q | p-1 (public) | ||
79 | BIGNUM *g; // generator of subgroup (public) | ||
80 | BIGNUM *priv_key; // private key x | ||
81 | BIGNUM *pub_key; // public key y = g^x | ||
82 | // ... | ||
83 | } | ||
84 | DSA; | ||
85 | |||
86 | In public keys, B<priv_key> is NULL. | ||
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 | |||
96 | =head1 CONFORMING TO | ||
97 | |||
98 | US Federal Information Processing Standard FIPS 186 (Digital Signature | ||
99 | Standard, DSS), ANSI X9.30 | ||
100 | |||
101 | =head1 SEE ALSO | ||
102 | |||
103 | L<bn(3)|bn(3)>, L<dh(3)|dh(3)>, L<err(3)|err(3)>, L<rand(3)|rand(3)>, | ||
104 | L<rsa(3)|rsa(3)>, L<SHA1(3)|SHA1(3)>, L<DSA_new(3)|DSA_new(3)>, | ||
105 | L<DSA_size(3)|DSA_size(3)>, | ||
106 | L<DSA_generate_parameters(3)|DSA_generate_parameters(3)>, | ||
107 | L<DSA_dup_DH(3)|DSA_dup_DH(3)>, | ||
108 | L<DSA_generate_key(3)|DSA_generate_key(3)>, | ||
109 | L<DSA_sign(3)|DSA_sign(3)>, L<DSA_set_method(3)|DSA_set_method(3)>, | ||
110 | L<DSA_get_ex_new_index(3)|DSA_get_ex_new_index(3)>, | ||
111 | L<RSA_print(3)|RSA_print(3)> | ||
112 | |||
113 | =cut | ||
diff --git a/src/lib/libcrypto/doc/engine.pod b/src/lib/libcrypto/doc/engine.pod deleted file mode 100644 index c77dad5562..0000000000 --- a/src/lib/libcrypto/doc/engine.pod +++ /dev/null | |||
@@ -1,621 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | engine - ENGINE cryptographic module support | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/engine.h> | ||
10 | |||
11 | ENGINE *ENGINE_get_first(void); | ||
12 | ENGINE *ENGINE_get_last(void); | ||
13 | ENGINE *ENGINE_get_next(ENGINE *e); | ||
14 | ENGINE *ENGINE_get_prev(ENGINE *e); | ||
15 | |||
16 | int ENGINE_add(ENGINE *e); | ||
17 | int ENGINE_remove(ENGINE *e); | ||
18 | |||
19 | ENGINE *ENGINE_by_id(const char *id); | ||
20 | |||
21 | int ENGINE_init(ENGINE *e); | ||
22 | int ENGINE_finish(ENGINE *e); | ||
23 | |||
24 | void ENGINE_load_openssl(void); | ||
25 | void ENGINE_load_dynamic(void); | ||
26 | void ENGINE_load_cswift(void); | ||
27 | void ENGINE_load_chil(void); | ||
28 | void ENGINE_load_atalla(void); | ||
29 | void ENGINE_load_nuron(void); | ||
30 | void ENGINE_load_ubsec(void); | ||
31 | void ENGINE_load_aep(void); | ||
32 | void ENGINE_load_sureware(void); | ||
33 | void ENGINE_load_4758cca(void); | ||
34 | void ENGINE_load_openbsd_dev_crypto(void); | ||
35 | void ENGINE_load_builtin_engines(void); | ||
36 | |||
37 | void ENGINE_cleanup(void); | ||
38 | |||
39 | ENGINE *ENGINE_get_default_RSA(void); | ||
40 | ENGINE *ENGINE_get_default_DSA(void); | ||
41 | ENGINE *ENGINE_get_default_DH(void); | ||
42 | ENGINE *ENGINE_get_default_RAND(void); | ||
43 | ENGINE *ENGINE_get_cipher_engine(int nid); | ||
44 | ENGINE *ENGINE_get_digest_engine(int nid); | ||
45 | |||
46 | int ENGINE_set_default_RSA(ENGINE *e); | ||
47 | int ENGINE_set_default_DSA(ENGINE *e); | ||
48 | int ENGINE_set_default_DH(ENGINE *e); | ||
49 | int ENGINE_set_default_RAND(ENGINE *e); | ||
50 | int ENGINE_set_default_ciphers(ENGINE *e); | ||
51 | int ENGINE_set_default_digests(ENGINE *e); | ||
52 | int ENGINE_set_default_string(ENGINE *e, const char *list); | ||
53 | |||
54 | int ENGINE_set_default(ENGINE *e, unsigned int flags); | ||
55 | |||
56 | unsigned int ENGINE_get_table_flags(void); | ||
57 | void ENGINE_set_table_flags(unsigned int flags); | ||
58 | |||
59 | int ENGINE_register_RSA(ENGINE *e); | ||
60 | void ENGINE_unregister_RSA(ENGINE *e); | ||
61 | void ENGINE_register_all_RSA(void); | ||
62 | int ENGINE_register_DSA(ENGINE *e); | ||
63 | void ENGINE_unregister_DSA(ENGINE *e); | ||
64 | void ENGINE_register_all_DSA(void); | ||
65 | int ENGINE_register_DH(ENGINE *e); | ||
66 | void ENGINE_unregister_DH(ENGINE *e); | ||
67 | void ENGINE_register_all_DH(void); | ||
68 | int ENGINE_register_RAND(ENGINE *e); | ||
69 | void ENGINE_unregister_RAND(ENGINE *e); | ||
70 | void ENGINE_register_all_RAND(void); | ||
71 | int ENGINE_register_ciphers(ENGINE *e); | ||
72 | void ENGINE_unregister_ciphers(ENGINE *e); | ||
73 | void ENGINE_register_all_ciphers(void); | ||
74 | int ENGINE_register_digests(ENGINE *e); | ||
75 | void ENGINE_unregister_digests(ENGINE *e); | ||
76 | void ENGINE_register_all_digests(void); | ||
77 | int ENGINE_register_complete(ENGINE *e); | ||
78 | int ENGINE_register_all_complete(void); | ||
79 | |||
80 | int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)()); | ||
81 | int ENGINE_cmd_is_executable(ENGINE *e, int cmd); | ||
82 | int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name, | ||
83 | long i, void *p, void (*f)(), int cmd_optional); | ||
84 | int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg, | ||
85 | int cmd_optional); | ||
86 | |||
87 | int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg); | ||
88 | void *ENGINE_get_ex_data(const ENGINE *e, int idx); | ||
89 | |||
90 | int ENGINE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | ||
91 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); | ||
92 | |||
93 | ENGINE *ENGINE_new(void); | ||
94 | int ENGINE_free(ENGINE *e); | ||
95 | |||
96 | int ENGINE_set_id(ENGINE *e, const char *id); | ||
97 | int ENGINE_set_name(ENGINE *e, const char *name); | ||
98 | int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth); | ||
99 | int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth); | ||
100 | int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth); | ||
101 | int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth); | ||
102 | int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f); | ||
103 | int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f); | ||
104 | int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f); | ||
105 | int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f); | ||
106 | int ENGINE_set_load_privkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f); | ||
107 | int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f); | ||
108 | int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f); | ||
109 | int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f); | ||
110 | int ENGINE_set_flags(ENGINE *e, int flags); | ||
111 | int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns); | ||
112 | |||
113 | const char *ENGINE_get_id(const ENGINE *e); | ||
114 | const char *ENGINE_get_name(const ENGINE *e); | ||
115 | const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e); | ||
116 | const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e); | ||
117 | const DH_METHOD *ENGINE_get_DH(const ENGINE *e); | ||
118 | const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e); | ||
119 | ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e); | ||
120 | ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e); | ||
121 | ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e); | ||
122 | ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e); | ||
123 | ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e); | ||
124 | ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e); | ||
125 | ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e); | ||
126 | ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e); | ||
127 | const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid); | ||
128 | const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid); | ||
129 | int ENGINE_get_flags(const ENGINE *e); | ||
130 | const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e); | ||
131 | |||
132 | EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id, | ||
133 | UI_METHOD *ui_method, void *callback_data); | ||
134 | EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id, | ||
135 | UI_METHOD *ui_method, void *callback_data); | ||
136 | |||
137 | void ENGINE_add_conf_module(void); | ||
138 | |||
139 | =head1 DESCRIPTION | ||
140 | |||
141 | These functions create, manipulate, and use cryptographic modules in the | ||
142 | form of B<ENGINE> objects. These objects act as containers for | ||
143 | implementations of cryptographic algorithms, and support a | ||
144 | reference-counted mechanism to allow them to be dynamically loaded in and | ||
145 | out of the running application. | ||
146 | |||
147 | The cryptographic functionality that can be provided by an B<ENGINE> | ||
148 | implementation includes the following abstractions; | ||
149 | |||
150 | RSA_METHOD - for providing alternative RSA implementations | ||
151 | DSA_METHOD, DH_METHOD, RAND_METHOD - alternative DSA, DH, and RAND | ||
152 | EVP_CIPHER - potentially multiple cipher algorithms (indexed by 'nid') | ||
153 | EVP_DIGEST - potentially multiple hash algorithms (indexed by 'nid') | ||
154 | key-loading - loading public and/or private EVP_PKEY keys | ||
155 | |||
156 | =head2 Reference counting and handles | ||
157 | |||
158 | Due to the modular nature of the ENGINE API, pointers to ENGINEs need to be | ||
159 | treated as handles - ie. not only as pointers, but also as references to | ||
160 | the underlying ENGINE object. Ie. you should obtain a new reference when | ||
161 | making copies of an ENGINE pointer if the copies will be used (and | ||
162 | released) independantly. | ||
163 | |||
164 | ENGINE objects have two levels of reference-counting to match the way in | ||
165 | which the objects are used. At the most basic level, each ENGINE pointer is | ||
166 | inherently a B<structural> reference - you need a structural reference | ||
167 | simply to refer to the pointer value at all, as this kind of reference is | ||
168 | your guarantee that the structure can not be deallocated until you release | ||
169 | your reference. | ||
170 | |||
171 | However, a structural reference provides no guarantee that the ENGINE has | ||
172 | been initiliased to be usable to perform any of its cryptographic | ||
173 | implementations - and indeed it's quite possible that most ENGINEs will not | ||
174 | initialised at all on standard setups, as ENGINEs are typically used to | ||
175 | support specialised hardware. To use an ENGINE's functionality, you need a | ||
176 | B<functional> reference. This kind of reference can be considered a | ||
177 | specialised form of structural reference, because each functional reference | ||
178 | implicitly contains a structural reference as well - however to avoid | ||
179 | difficult-to-find programming bugs, it is recommended to treat the two | ||
180 | kinds of reference independantly. If you have a functional reference to an | ||
181 | ENGINE, you have a guarantee that the ENGINE has been initialised ready to | ||
182 | perform cryptographic operations and will not be uninitialised or cleaned | ||
183 | up until after you have released your reference. | ||
184 | |||
185 | We will discuss the two kinds of reference separately, including how to | ||
186 | tell which one you are dealing with at any given point in time (after all | ||
187 | they are both simply (ENGINE *) pointers, the difference is in the way they | ||
188 | are used). | ||
189 | |||
190 | I<Structural references> | ||
191 | |||
192 | This basic type of reference is typically used for creating new ENGINEs | ||
193 | dynamically, iterating across OpenSSL's internal linked-list of loaded | ||
194 | ENGINEs, reading information about an ENGINE, etc. Essentially a structural | ||
195 | reference is sufficient if you only need to query or manipulate the data of | ||
196 | an ENGINE implementation rather than use its functionality. | ||
197 | |||
198 | The ENGINE_new() function returns a structural reference to a new (empty) | ||
199 | ENGINE object. Other than that, structural references come from return | ||
200 | values to various ENGINE API functions such as; ENGINE_by_id(), | ||
201 | ENGINE_get_first(), ENGINE_get_last(), ENGINE_get_next(), | ||
202 | ENGINE_get_prev(). All structural references should be released by a | ||
203 | corresponding to call to the ENGINE_free() function - the ENGINE object | ||
204 | itself will only actually be cleaned up and deallocated when the last | ||
205 | structural reference is released. | ||
206 | |||
207 | It should also be noted that many ENGINE API function calls that accept a | ||
208 | structural reference will internally obtain another reference - typically | ||
209 | this happens whenever the supplied ENGINE will be needed by OpenSSL after | ||
210 | the function has returned. Eg. the function to add a new ENGINE to | ||
211 | OpenSSL's internal list is ENGINE_add() - if this function returns success, | ||
212 | then OpenSSL will have stored a new structural reference internally so the | ||
213 | caller is still responsible for freeing their own reference with | ||
214 | ENGINE_free() when they are finished with it. In a similar way, some | ||
215 | functions will automatically release the structural reference passed to it | ||
216 | if part of the function's job is to do so. Eg. the ENGINE_get_next() and | ||
217 | ENGINE_get_prev() functions are used for iterating across the internal | ||
218 | ENGINE list - they will return a new structural reference to the next (or | ||
219 | previous) ENGINE in the list or NULL if at the end (or beginning) of the | ||
220 | list, but in either case the structural reference passed to the function is | ||
221 | released on behalf of the caller. | ||
222 | |||
223 | To clarify a particular function's handling of references, one should | ||
224 | always consult that function's documentation "man" page, or failing that | ||
225 | the openssl/engine.h header file includes some hints. | ||
226 | |||
227 | I<Functional references> | ||
228 | |||
229 | As mentioned, functional references exist when the cryptographic | ||
230 | functionality of an ENGINE is required to be available. A functional | ||
231 | reference can be obtained in one of two ways; from an existing structural | ||
232 | reference to the required ENGINE, or by asking OpenSSL for the default | ||
233 | operational ENGINE for a given cryptographic purpose. | ||
234 | |||
235 | To obtain a functional reference from an existing structural reference, | ||
236 | call the ENGINE_init() function. This returns zero if the ENGINE was not | ||
237 | already operational and couldn't be successfully initialised (eg. lack of | ||
238 | system drivers, no special hardware attached, etc), otherwise it will | ||
239 | return non-zero to indicate that the ENGINE is now operational and will | ||
240 | have allocated a new B<functional> reference to the ENGINE. In this case, | ||
241 | the supplied ENGINE pointer is, from the point of the view of the caller, | ||
242 | both a structural reference and a functional reference - so if the caller | ||
243 | intends to use it as a functional reference it should free the structural | ||
244 | reference with ENGINE_free() first. If the caller wishes to use it only as | ||
245 | a structural reference (eg. if the ENGINE_init() call was simply to test if | ||
246 | the ENGINE seems available/online), then it should free the functional | ||
247 | reference; all functional references are released by the ENGINE_finish() | ||
248 | function. | ||
249 | |||
250 | The second way to get a functional reference is by asking OpenSSL for a | ||
251 | default implementation for a given task, eg. by ENGINE_get_default_RSA(), | ||
252 | ENGINE_get_default_cipher_engine(), etc. These are discussed in the next | ||
253 | section, though they are not usually required by application programmers as | ||
254 | they are used automatically when creating and using the relevant | ||
255 | algorithm-specific types in OpenSSL, such as RSA, DSA, EVP_CIPHER_CTX, etc. | ||
256 | |||
257 | =head2 Default implementations | ||
258 | |||
259 | For each supported abstraction, the ENGINE code maintains an internal table | ||
260 | of state to control which implementations are available for a given | ||
261 | abstraction and which should be used by default. These implementations are | ||
262 | registered in the tables separated-out by an 'nid' index, because | ||
263 | abstractions like EVP_CIPHER and EVP_DIGEST support many distinct | ||
264 | algorithms and modes - ENGINEs will support different numbers and | ||
265 | combinations of these. In the case of other abstractions like RSA, DSA, | ||
266 | etc, there is only one "algorithm" so all implementations implicitly | ||
267 | register using the same 'nid' index. ENGINEs can be B<registered> into | ||
268 | these tables to make themselves available for use automatically by the | ||
269 | various abstractions, eg. RSA. For illustrative purposes, we continue with | ||
270 | the RSA example, though all comments apply similarly to the other | ||
271 | abstractions (they each get their own table and linkage to the | ||
272 | corresponding section of openssl code). | ||
273 | |||
274 | When a new RSA key is being created, ie. in RSA_new_method(), a | ||
275 | "get_default" call will be made to the ENGINE subsystem to process the RSA | ||
276 | state table and return a functional reference to an initialised ENGINE | ||
277 | whose RSA_METHOD should be used. If no ENGINE should (or can) be used, it | ||
278 | will return NULL and the RSA key will operate with a NULL ENGINE handle by | ||
279 | using the conventional RSA implementation in OpenSSL (and will from then on | ||
280 | behave the way it used to before the ENGINE API existed - for details see | ||
281 | L<RSA_new_method(3)|RSA_new_method(3)>). | ||
282 | |||
283 | Each state table has a flag to note whether it has processed this | ||
284 | "get_default" query since the table was last modified, because to process | ||
285 | this question it must iterate across all the registered ENGINEs in the | ||
286 | table trying to initialise each of them in turn, in case one of them is | ||
287 | operational. If it returns a functional reference to an ENGINE, it will | ||
288 | also cache another reference to speed up processing future queries (without | ||
289 | needing to iterate across the table). Likewise, it will cache a NULL | ||
290 | response if no ENGINE was available so that future queries won't repeat the | ||
291 | same iteration unless the state table changes. This behaviour can also be | ||
292 | changed; if the ENGINE_TABLE_FLAG_NOINIT flag is set (using | ||
293 | ENGINE_set_table_flags()), no attempted initialisations will take place, | ||
294 | instead the only way for the state table to return a non-NULL ENGINE to the | ||
295 | "get_default" query will be if one is expressly set in the table. Eg. | ||
296 | ENGINE_set_default_RSA() does the same job as ENGINE_register_RSA() except | ||
297 | that it also sets the state table's cached response for the "get_default" | ||
298 | query. | ||
299 | |||
300 | In the case of abstractions like EVP_CIPHER, where implementations are | ||
301 | indexed by 'nid', these flags and cached-responses are distinct for each | ||
302 | 'nid' value. | ||
303 | |||
304 | It is worth illustrating the difference between "registration" of ENGINEs | ||
305 | into these per-algorithm state tables and using the alternative | ||
306 | "set_default" functions. The latter handles both "registration" and also | ||
307 | setting the cached "default" ENGINE in each relevant state table - so | ||
308 | registered ENGINEs will only have a chance to be initialised for use as a | ||
309 | default if a default ENGINE wasn't already set for the same state table. | ||
310 | Eg. if ENGINE X supports cipher nids {A,B} and RSA, ENGINE Y supports | ||
311 | ciphers {A} and DSA, and the following code is executed; | ||
312 | |||
313 | ENGINE_register_complete(X); | ||
314 | ENGINE_set_default(Y, ENGINE_METHOD_ALL); | ||
315 | e1 = ENGINE_get_default_RSA(); | ||
316 | e2 = ENGINE_get_cipher_engine(A); | ||
317 | e3 = ENGINE_get_cipher_engine(B); | ||
318 | e4 = ENGINE_get_default_DSA(); | ||
319 | e5 = ENGINE_get_cipher_engine(C); | ||
320 | |||
321 | The results would be as follows; | ||
322 | |||
323 | assert(e1 == X); | ||
324 | assert(e2 == Y); | ||
325 | assert(e3 == X); | ||
326 | assert(e4 == Y); | ||
327 | assert(e5 == NULL); | ||
328 | |||
329 | =head2 Application requirements | ||
330 | |||
331 | This section will explain the basic things an application programmer should | ||
332 | support to make the most useful elements of the ENGINE functionality | ||
333 | available to the user. The first thing to consider is whether the | ||
334 | programmer wishes to make alternative ENGINE modules available to the | ||
335 | application and user. OpenSSL maintains an internal linked list of | ||
336 | "visible" ENGINEs from which it has to operate - at start-up, this list is | ||
337 | empty and in fact if an application does not call any ENGINE API calls and | ||
338 | it uses static linking against openssl, then the resulting application | ||
339 | binary will not contain any alternative ENGINE code at all. So the first | ||
340 | consideration is whether any/all available ENGINE implementations should be | ||
341 | made visible to OpenSSL - this is controlled by calling the various "load" | ||
342 | functions, eg. | ||
343 | |||
344 | /* Make the "dynamic" ENGINE available */ | ||
345 | void ENGINE_load_dynamic(void); | ||
346 | /* Make the CryptoSwift hardware acceleration support available */ | ||
347 | void ENGINE_load_cswift(void); | ||
348 | /* Make support for nCipher's "CHIL" hardware available */ | ||
349 | void ENGINE_load_chil(void); | ||
350 | ... | ||
351 | /* Make ALL ENGINE implementations bundled with OpenSSL available */ | ||
352 | void ENGINE_load_builtin_engines(void); | ||
353 | |||
354 | Having called any of these functions, ENGINE objects would have been | ||
355 | dynamically allocated and populated with these implementations and linked | ||
356 | into OpenSSL's internal linked list. At this point it is important to | ||
357 | mention an important API function; | ||
358 | |||
359 | void ENGINE_cleanup(void); | ||
360 | |||
361 | If no ENGINE API functions are called at all in an application, then there | ||
362 | are no inherent memory leaks to worry about from the ENGINE functionality, | ||
363 | however if any ENGINEs are "load"ed, even if they are never registered or | ||
364 | used, it is necessary to use the ENGINE_cleanup() function to | ||
365 | correspondingly cleanup before program exit, if the caller wishes to avoid | ||
366 | memory leaks. This mechanism uses an internal callback registration table | ||
367 | so that any ENGINE API functionality that knows it requires cleanup can | ||
368 | register its cleanup details to be called during ENGINE_cleanup(). This | ||
369 | approach allows ENGINE_cleanup() to clean up after any ENGINE functionality | ||
370 | at all that your program uses, yet doesn't automatically create linker | ||
371 | dependencies to all possible ENGINE functionality - only the cleanup | ||
372 | callbacks required by the functionality you do use will be required by the | ||
373 | linker. | ||
374 | |||
375 | The fact that ENGINEs are made visible to OpenSSL (and thus are linked into | ||
376 | the program and loaded into memory at run-time) does not mean they are | ||
377 | "registered" or called into use by OpenSSL automatically - that behaviour | ||
378 | is something for the application to have control over. Some applications | ||
379 | will want to allow the user to specify exactly which ENGINE they want used | ||
380 | if any is to be used at all. Others may prefer to load all support and have | ||
381 | OpenSSL automatically use at run-time any ENGINE that is able to | ||
382 | successfully initialise - ie. to assume that this corresponds to | ||
383 | acceleration hardware attached to the machine or some such thing. There are | ||
384 | probably numerous other ways in which applications may prefer to handle | ||
385 | things, so we will simply illustrate the consequences as they apply to a | ||
386 | couple of simple cases and leave developers to consider these and the | ||
387 | source code to openssl's builtin utilities as guides. | ||
388 | |||
389 | I<Using a specific ENGINE implementation> | ||
390 | |||
391 | Here we'll assume an application has been configured by its user or admin | ||
392 | to want to use the "ACME" ENGINE if it is available in the version of | ||
393 | OpenSSL the application was compiled with. If it is available, it should be | ||
394 | used by default for all RSA, DSA, and symmetric cipher operation, otherwise | ||
395 | OpenSSL should use its builtin software as per usual. The following code | ||
396 | illustrates how to approach this; | ||
397 | |||
398 | ENGINE *e; | ||
399 | const char *engine_id = "ACME"; | ||
400 | ENGINE_load_builtin_engines(); | ||
401 | e = ENGINE_by_id(engine_id); | ||
402 | if(!e) | ||
403 | /* the engine isn't available */ | ||
404 | return; | ||
405 | if(!ENGINE_init(e)) { | ||
406 | /* the engine couldn't initialise, release 'e' */ | ||
407 | ENGINE_free(e); | ||
408 | return; | ||
409 | } | ||
410 | if(!ENGINE_set_default_RSA(e)) | ||
411 | /* This should only happen when 'e' can't initialise, but the previous | ||
412 | * statement suggests it did. */ | ||
413 | abort(); | ||
414 | ENGINE_set_default_DSA(e); | ||
415 | ENGINE_set_default_ciphers(e); | ||
416 | /* Release the functional reference from ENGINE_init() */ | ||
417 | ENGINE_finish(e); | ||
418 | /* Release the structural reference from ENGINE_by_id() */ | ||
419 | ENGINE_free(e); | ||
420 | |||
421 | I<Automatically using builtin ENGINE implementations> | ||
422 | |||
423 | Here we'll assume we want to load and register all ENGINE implementations | ||
424 | bundled with OpenSSL, such that for any cryptographic algorithm required by | ||
425 | OpenSSL - if there is an ENGINE that implements it and can be initialise, | ||
426 | it should be used. The following code illustrates how this can work; | ||
427 | |||
428 | /* Load all bundled ENGINEs into memory and make them visible */ | ||
429 | ENGINE_load_builtin_engines(); | ||
430 | /* Register all of them for every algorithm they collectively implement */ | ||
431 | ENGINE_register_all_complete(); | ||
432 | |||
433 | That's all that's required. Eg. the next time OpenSSL tries to set up an | ||
434 | RSA key, any bundled ENGINEs that implement RSA_METHOD will be passed to | ||
435 | ENGINE_init() and if any of those succeed, that ENGINE will be set as the | ||
436 | default for use with RSA from then on. | ||
437 | |||
438 | =head2 Advanced configuration support | ||
439 | |||
440 | There is a mechanism supported by the ENGINE framework that allows each | ||
441 | ENGINE implementation to define an arbitrary set of configuration | ||
442 | "commands" and expose them to OpenSSL and any applications based on | ||
443 | OpenSSL. This mechanism is entirely based on the use of name-value pairs | ||
444 | and and assumes ASCII input (no unicode or UTF for now!), so it is ideal if | ||
445 | applications want to provide a transparent way for users to provide | ||
446 | arbitrary configuration "directives" directly to such ENGINEs. It is also | ||
447 | possible for the application to dynamically interrogate the loaded ENGINE | ||
448 | implementations for the names, descriptions, and input flags of their | ||
449 | available "control commands", providing a more flexible configuration | ||
450 | scheme. However, if the user is expected to know which ENGINE device he/she | ||
451 | is using (in the case of specialised hardware, this goes without saying) | ||
452 | then applications may not need to concern themselves with discovering the | ||
453 | supported control commands and simply prefer to allow settings to passed | ||
454 | into ENGINEs exactly as they are provided by the user. | ||
455 | |||
456 | Before illustrating how control commands work, it is worth mentioning what | ||
457 | they are typically used for. Broadly speaking there are two uses for | ||
458 | control commands; the first is to provide the necessary details to the | ||
459 | implementation (which may know nothing at all specific to the host system) | ||
460 | so that it can be initialised for use. This could include the path to any | ||
461 | driver or config files it needs to load, required network addresses, | ||
462 | smart-card identifiers, passwords to initialise password-protected devices, | ||
463 | logging information, etc etc. This class of commands typically needs to be | ||
464 | passed to an ENGINE B<before> attempting to initialise it, ie. before | ||
465 | calling ENGINE_init(). The other class of commands consist of settings or | ||
466 | operations that tweak certain behaviour or cause certain operations to take | ||
467 | place, and these commands may work either before or after ENGINE_init(), or | ||
468 | in same cases both. ENGINE implementations should provide indications of | ||
469 | this in the descriptions attached to builtin control commands and/or in | ||
470 | external product documentation. | ||
471 | |||
472 | I<Issuing control commands to an ENGINE> | ||
473 | |||
474 | Let's illustrate by example; a function for which the caller supplies the | ||
475 | name of the ENGINE it wishes to use, a table of string-pairs for use before | ||
476 | initialisation, and another table for use after initialisation. Note that | ||
477 | the string-pairs used for control commands consist of a command "name" | ||
478 | followed by the command "parameter" - the parameter could be NULL in some | ||
479 | cases but the name can not. This function should initialise the ENGINE | ||
480 | (issuing the "pre" commands beforehand and the "post" commands afterwards) | ||
481 | and set it as the default for everything except RAND and then return a | ||
482 | boolean success or failure. | ||
483 | |||
484 | int generic_load_engine_fn(const char *engine_id, | ||
485 | const char **pre_cmds, int pre_num, | ||
486 | const char **post_cmds, int post_num) | ||
487 | { | ||
488 | ENGINE *e = ENGINE_by_id(engine_id); | ||
489 | if(!e) return 0; | ||
490 | while(pre_num--) { | ||
491 | if(!ENGINE_ctrl_cmd_string(e, pre_cmds[0], pre_cmds[1], 0)) { | ||
492 | fprintf(stderr, "Failed command (%s - %s:%s)\n", engine_id, | ||
493 | pre_cmds[0], pre_cmds[1] ? pre_cmds[1] : "(NULL)"); | ||
494 | ENGINE_free(e); | ||
495 | return 0; | ||
496 | } | ||
497 | pre_cmds += 2; | ||
498 | } | ||
499 | if(!ENGINE_init(e)) { | ||
500 | fprintf(stderr, "Failed initialisation\n"); | ||
501 | ENGINE_free(e); | ||
502 | return 0; | ||
503 | } | ||
504 | /* ENGINE_init() returned a functional reference, so free the structural | ||
505 | * reference from ENGINE_by_id(). */ | ||
506 | ENGINE_free(e); | ||
507 | while(post_num--) { | ||
508 | if(!ENGINE_ctrl_cmd_string(e, post_cmds[0], post_cmds[1], 0)) { | ||
509 | fprintf(stderr, "Failed command (%s - %s:%s)\n", engine_id, | ||
510 | post_cmds[0], post_cmds[1] ? post_cmds[1] : "(NULL)"); | ||
511 | ENGINE_finish(e); | ||
512 | return 0; | ||
513 | } | ||
514 | post_cmds += 2; | ||
515 | } | ||
516 | ENGINE_set_default(e, ENGINE_METHOD_ALL & ~ENGINE_METHOD_RAND); | ||
517 | /* Success */ | ||
518 | return 1; | ||
519 | } | ||
520 | |||
521 | Note that ENGINE_ctrl_cmd_string() accepts a boolean argument that can | ||
522 | relax the semantics of the function - if set non-zero it will only return | ||
523 | failure if the ENGINE supported the given command name but failed while | ||
524 | executing it, if the ENGINE doesn't support the command name it will simply | ||
525 | return success without doing anything. In this case we assume the user is | ||
526 | only supplying commands specific to the given ENGINE so we set this to | ||
527 | FALSE. | ||
528 | |||
529 | I<Discovering supported control commands> | ||
530 | |||
531 | It is possible to discover at run-time the names, numerical-ids, descriptions | ||
532 | and input parameters of the control commands supported from a structural | ||
533 | reference to any ENGINE. It is first important to note that some control | ||
534 | commands are defined by OpenSSL itself and it will intercept and handle these | ||
535 | control commands on behalf of the ENGINE, ie. the ENGINE's ctrl() handler is not | ||
536 | used for the control command. openssl/engine.h defines a symbol, | ||
537 | ENGINE_CMD_BASE, that all control commands implemented by ENGINEs from. Any | ||
538 | command value lower than this symbol is considered a "generic" command is | ||
539 | handled directly by the OpenSSL core routines. | ||
540 | |||
541 | It is using these "core" control commands that one can discover the the control | ||
542 | commands implemented by a given ENGINE, specifically the commands; | ||
543 | |||
544 | #define ENGINE_HAS_CTRL_FUNCTION 10 | ||
545 | #define ENGINE_CTRL_GET_FIRST_CMD_TYPE 11 | ||
546 | #define ENGINE_CTRL_GET_NEXT_CMD_TYPE 12 | ||
547 | #define ENGINE_CTRL_GET_CMD_FROM_NAME 13 | ||
548 | #define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD 14 | ||
549 | #define ENGINE_CTRL_GET_NAME_FROM_CMD 15 | ||
550 | #define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD 16 | ||
551 | #define ENGINE_CTRL_GET_DESC_FROM_CMD 17 | ||
552 | #define ENGINE_CTRL_GET_CMD_FLAGS 18 | ||
553 | |||
554 | Whilst these commands are automatically processed by the OpenSSL framework code, | ||
555 | they use various properties exposed by each ENGINE by which to process these | ||
556 | queries. An ENGINE has 3 properties it exposes that can affect this behaviour; | ||
557 | it can supply a ctrl() handler, it can specify ENGINE_FLAGS_MANUAL_CMD_CTRL in | ||
558 | the ENGINE's flags, and it can expose an array of control command descriptions. | ||
559 | If an ENGINE specifies the ENGINE_FLAGS_MANUAL_CMD_CTRL flag, then it will | ||
560 | simply pass all these "core" control commands directly to the ENGINE's ctrl() | ||
561 | handler (and thus, it must have supplied one), so it is up to the ENGINE to | ||
562 | reply to these "discovery" commands itself. If that flag is not set, then the | ||
563 | OpenSSL framework code will work with the following rules; | ||
564 | |||
565 | if no ctrl() handler supplied; | ||
566 | ENGINE_HAS_CTRL_FUNCTION returns FALSE (zero), | ||
567 | all other commands fail. | ||
568 | if a ctrl() handler was supplied but no array of control commands; | ||
569 | ENGINE_HAS_CTRL_FUNCTION returns TRUE, | ||
570 | all other commands fail. | ||
571 | if a ctrl() handler and array of control commands was supplied; | ||
572 | ENGINE_HAS_CTRL_FUNCTION returns TRUE, | ||
573 | all other commands proceed processing ... | ||
574 | |||
575 | If the ENGINE's array of control commands is empty then all other commands will | ||
576 | fail, otherwise; ENGINE_CTRL_GET_FIRST_CMD_TYPE returns the identifier of | ||
577 | the first command supported by the ENGINE, ENGINE_GET_NEXT_CMD_TYPE takes the | ||
578 | identifier of a command supported by the ENGINE and returns the next command | ||
579 | identifier or fails if there are no more, ENGINE_CMD_FROM_NAME takes a string | ||
580 | name for a command and returns the corresponding identifier or fails if no such | ||
581 | command name exists, and the remaining commands take a command identifier and | ||
582 | return properties of the corresponding commands. All except | ||
583 | ENGINE_CTRL_GET_FLAGS return the string length of a command name or description, | ||
584 | or populate a supplied character buffer with a copy of the command name or | ||
585 | description. ENGINE_CTRL_GET_FLAGS returns a bitwise-OR'd mask of the following | ||
586 | possible values; | ||
587 | |||
588 | #define ENGINE_CMD_FLAG_NUMERIC (unsigned int)0x0001 | ||
589 | #define ENGINE_CMD_FLAG_STRING (unsigned int)0x0002 | ||
590 | #define ENGINE_CMD_FLAG_NO_INPUT (unsigned int)0x0004 | ||
591 | #define ENGINE_CMD_FLAG_INTERNAL (unsigned int)0x0008 | ||
592 | |||
593 | If the ENGINE_CMD_FLAG_INTERNAL flag is set, then any other flags are purely | ||
594 | informational to the caller - this flag will prevent the command being usable | ||
595 | for any higher-level ENGINE functions such as ENGINE_ctrl_cmd_string(). | ||
596 | "INTERNAL" commands are not intended to be exposed to text-based configuration | ||
597 | by applications, administrations, users, etc. These can support arbitrary | ||
598 | operations via ENGINE_ctrl(), including passing to and/or from the control | ||
599 | commands data of any arbitrary type. These commands are supported in the | ||
600 | discovery mechanisms simply to allow applications determinie if an ENGINE | ||
601 | supports certain specific commands it might want to use (eg. application "foo" | ||
602 | might query various ENGINEs to see if they implement "FOO_GET_VENDOR_LOGO_GIF" - | ||
603 | and ENGINE could therefore decide whether or not to support this "foo"-specific | ||
604 | extension). | ||
605 | |||
606 | =head2 Future developments | ||
607 | |||
608 | The ENGINE API and internal architecture is currently being reviewed. Slated for | ||
609 | possible release in 0.9.8 is support for transparent loading of "dynamic" | ||
610 | ENGINEs (built as self-contained shared-libraries). This would allow ENGINE | ||
611 | implementations to be provided independantly of OpenSSL libraries and/or | ||
612 | OpenSSL-based applications, and would also remove any requirement for | ||
613 | applications to explicitly use the "dynamic" ENGINE to bind to shared-library | ||
614 | implementations. | ||
615 | |||
616 | =head1 SEE ALSO | ||
617 | |||
618 | L<rsa(3)|rsa(3)>, L<dsa(3)|dsa(3)>, L<dh(3)|dh(3)>, L<rand(3)|rand(3)>, | ||
619 | L<RSA_new_method(3)|RSA_new_method(3)> | ||
620 | |||
621 | =cut | ||
diff --git a/src/lib/libcrypto/doc/evp.pod b/src/lib/libcrypto/doc/evp.pod deleted file mode 100644 index b3ca14314f..0000000000 --- a/src/lib/libcrypto/doc/evp.pod +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | evp - high-level cryptographic functions | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/evp.h> | ||
10 | |||
11 | =head1 DESCRIPTION | ||
12 | |||
13 | The EVP library provides a high-level interface to cryptographic | ||
14 | functions. | ||
15 | |||
16 | B<EVP_Seal>I<...> and B<EVP_Open>I<...> provide public key encryption | ||
17 | and decryption to implement digital "envelopes". | ||
18 | |||
19 | The B<EVP_Sign>I<...> and B<EVP_Verify>I<...> functions implement | ||
20 | digital signatures. | ||
21 | |||
22 | Symmetric encryption is available with the B<EVP_Encrypt>I<...> | ||
23 | functions. The B<EVP_Digest>I<...> functions provide message digests. | ||
24 | |||
25 | Algorithms are loaded with OpenSSL_add_all_algorithms(3). | ||
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 | |||
34 | =head1 SEE ALSO | ||
35 | |||
36 | L<EVP_DigestInit(3)|EVP_DigestInit(3)>, | ||
37 | L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>, | ||
38 | L<EVP_OpenInit(3)|EVP_OpenInit(3)>, | ||
39 | L<EVP_SealInit(3)|EVP_SealInit(3)>, | ||
40 | L<EVP_SignInit(3)|EVP_SignInit(3)>, | ||
41 | L<EVP_VerifyInit(3)|EVP_VerifyInit(3)>, | ||
42 | L<OpenSSL_add_all_algorithms(3)|OpenSSL_add_all_algorithms(3)>, | ||
43 | L<engine(3)|engine(3)> | ||
44 | |||
45 | =cut | ||
diff --git a/src/lib/libcrypto/doc/lh_stats.pod b/src/lib/libcrypto/doc/lh_stats.pod deleted file mode 100644 index 3eeaa72e52..0000000000 --- a/src/lib/libcrypto/doc/lh_stats.pod +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | lh_stats, lh_node_stats, lh_node_usage_stats, lh_stats_bio, | ||
6 | lh_node_stats_bio, lh_node_usage_stats_bio - LHASH statistics | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/lhash.h> | ||
11 | |||
12 | void lh_stats(LHASH *table, FILE *out); | ||
13 | void lh_node_stats(LHASH *table, FILE *out); | ||
14 | void lh_node_usage_stats(LHASH *table, FILE *out); | ||
15 | |||
16 | void lh_stats_bio(LHASH *table, BIO *out); | ||
17 | void lh_node_stats_bio(LHASH *table, BIO *out); | ||
18 | void lh_node_usage_stats_bio(LHASH *table, BIO *out); | ||
19 | |||
20 | =head1 DESCRIPTION | ||
21 | |||
22 | The B<LHASH> structure records statistics about most aspects of | ||
23 | accessing the hash table. This is mostly a legacy of Eric Young | ||
24 | writing this library for the reasons of implementing what looked like | ||
25 | a nice algorithm rather than for a particular software product. | ||
26 | |||
27 | lh_stats() prints out statistics on the size of the hash table, how | ||
28 | many entries are in it, and the number and result of calls to the | ||
29 | routines in this library. | ||
30 | |||
31 | lh_node_stats() prints the number of entries for each 'bucket' in the | ||
32 | hash table. | ||
33 | |||
34 | lh_node_usage_stats() prints out a short summary of the state of the | ||
35 | hash table. It prints the 'load' and the 'actual load'. The load is | ||
36 | the average number of data items per 'bucket' in the hash table. The | ||
37 | 'actual load' is the average number of items per 'bucket', but only | ||
38 | for buckets which contain entries. So the 'actual load' is the | ||
39 | average number of searches that will need to find an item in the hash | ||
40 | table, while the 'load' is the average number that will be done to | ||
41 | record a miss. | ||
42 | |||
43 | lh_stats_bio(), lh_node_stats_bio() and lh_node_usage_stats_bio() | ||
44 | are the same as the above, except that the output goes to a B<BIO>. | ||
45 | |||
46 | =head1 RETURN VALUES | ||
47 | |||
48 | These functions do not return values. | ||
49 | |||
50 | =head1 SEE ALSO | ||
51 | |||
52 | L<bio(3)|bio(3)>, L<lhash(3)|lhash(3)> | ||
53 | |||
54 | =head1 HISTORY | ||
55 | |||
56 | These functions are available in all versions of SSLeay and OpenSSL. | ||
57 | |||
58 | This manpage is derived from the SSLeay documentation. | ||
59 | |||
60 | =cut | ||
diff --git a/src/lib/libcrypto/doc/rsa.pod b/src/lib/libcrypto/doc/rsa.pod deleted file mode 100644 index 45ac53ffc1..0000000000 --- a/src/lib/libcrypto/doc/rsa.pod +++ /dev/null | |||
@@ -1,123 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | rsa - RSA public key cryptosystem | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/rsa.h> | ||
10 | #include <openssl/engine.h> | ||
11 | |||
12 | RSA * RSA_new(void); | ||
13 | void RSA_free(RSA *rsa); | ||
14 | |||
15 | int RSA_public_encrypt(int flen, unsigned char *from, | ||
16 | unsigned char *to, RSA *rsa, int padding); | ||
17 | int RSA_private_decrypt(int flen, unsigned char *from, | ||
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); | ||
23 | |||
24 | int RSA_sign(int type, unsigned char *m, unsigned int m_len, | ||
25 | unsigned char *sigret, unsigned int *siglen, RSA *rsa); | ||
26 | int RSA_verify(int type, unsigned char *m, unsigned int m_len, | ||
27 | unsigned char *sigbuf, unsigned int siglen, RSA *rsa); | ||
28 | |||
29 | int RSA_size(const RSA *rsa); | ||
30 | |||
31 | RSA *RSA_generate_key(int num, unsigned long e, | ||
32 | void (*callback)(int,int,void *), void *cb_arg); | ||
33 | |||
34 | int RSA_check_key(RSA *rsa); | ||
35 | |||
36 | int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); | ||
37 | void RSA_blinding_off(RSA *rsa); | ||
38 | |||
39 | void RSA_set_default_method(const RSA_METHOD *meth); | ||
40 | const RSA_METHOD *RSA_get_default_method(void); | ||
41 | int RSA_set_method(RSA *rsa, const RSA_METHOD *meth); | ||
42 | const RSA_METHOD *RSA_get_method(const RSA *rsa); | ||
43 | RSA_METHOD *RSA_PKCS1_SSLeay(void); | ||
44 | RSA_METHOD *RSA_null_method(void); | ||
45 | int RSA_flags(const RSA *rsa); | ||
46 | RSA *RSA_new_method(ENGINE *engine); | ||
47 | |||
48 | int RSA_print(BIO *bp, RSA *x, int offset); | ||
49 | int RSA_print_fp(FILE *fp, RSA *x, int offset); | ||
50 | |||
51 | int RSA_get_ex_new_index(long argl, char *argp, int (*new_func)(), | ||
52 | int (*dup_func)(), void (*free_func)()); | ||
53 | int RSA_set_ex_data(RSA *r,int idx,char *arg); | ||
54 | char *RSA_get_ex_data(RSA *r, int idx); | ||
55 | |||
56 | int RSA_sign_ASN1_OCTET_STRING(int dummy, unsigned char *m, | ||
57 | unsigned int m_len, unsigned char *sigret, unsigned int *siglen, | ||
58 | RSA *rsa); | ||
59 | int RSA_verify_ASN1_OCTET_STRING(int dummy, unsigned char *m, | ||
60 | unsigned int m_len, unsigned char *sigbuf, unsigned int siglen, | ||
61 | RSA *rsa); | ||
62 | |||
63 | =head1 DESCRIPTION | ||
64 | |||
65 | These functions implement RSA public key encryption and signatures | ||
66 | as defined in PKCS #1 v2.0 [RFC 2437]. | ||
67 | |||
68 | The B<RSA> structure consists of several BIGNUM components. It can | ||
69 | contain public as well as private RSA keys: | ||
70 | |||
71 | struct | ||
72 | { | ||
73 | BIGNUM *n; // public modulus | ||
74 | BIGNUM *e; // public exponent | ||
75 | BIGNUM *d; // private exponent | ||
76 | BIGNUM *p; // secret prime factor | ||
77 | BIGNUM *q; // secret prime factor | ||
78 | BIGNUM *dmp1; // d mod (p-1) | ||
79 | BIGNUM *dmq1; // d mod (q-1) | ||
80 | BIGNUM *iqmp; // q^-1 mod p | ||
81 | // ... | ||
82 | }; | ||
83 | RSA | ||
84 | |||
85 | In public keys, the private exponent and the related secret values are | ||
86 | B<NULL>. | ||
87 | |||
88 | B<p>, B<q>, B<dmp1>, B<dmq1> and B<iqmp> may be B<NULL> in private | ||
89 | keys, but the RSA operations are much faster when these values are | ||
90 | available. | ||
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 | |||
100 | =head1 CONFORMING TO | ||
101 | |||
102 | SSL, PKCS #1 v2.0 | ||
103 | |||
104 | =head1 PATENTS | ||
105 | |||
106 | RSA was covered by a US patent which expired in September 2000. | ||
107 | |||
108 | =head1 SEE ALSO | ||
109 | |||
110 | L<rsa(1)|rsa(1)>, L<bn(3)|bn(3)>, L<dsa(3)|dsa(3)>, L<dh(3)|dh(3)>, | ||
111 | L<rand(3)|rand(3)>, L<engine(3)|engine(3)>, L<RSA_new(3)|RSA_new(3)>, | ||
112 | L<RSA_public_encrypt(3)|RSA_public_encrypt(3)>, | ||
113 | L<RSA_sign(3)|RSA_sign(3)>, L<RSA_size(3)|RSA_size(3)>, | ||
114 | L<RSA_generate_key(3)|RSA_generate_key(3)>, | ||
115 | L<RSA_check_key(3)|RSA_check_key(3)>, | ||
116 | L<RSA_blinding_on(3)|RSA_blinding_on(3)>, | ||
117 | L<RSA_set_method(3)|RSA_set_method(3)>, L<RSA_print(3)|RSA_print(3)>, | ||
118 | L<RSA_get_ex_new_index(3)|RSA_get_ex_new_index(3)>, | ||
119 | L<RSA_private_encrypt(3)|RSA_private_encrypt(3)>, | ||
120 | L<RSA_sign_ASN1_OCTET_STRING(3)|RSA_sign_ASN1_OCTET_STRING(3)>, | ||
121 | L<RSA_padding_add_PKCS1_type_1(3)|RSA_padding_add_PKCS1_type_1(3)> | ||
122 | |||
123 | =cut | ||