diff options
Diffstat (limited to 'src/lib/libcrypto/doc')
59 files changed, 0 insertions, 4182 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 4a2d653758..0000000000 --- a/src/lib/libcrypto/doc/DH_generate_parameters.pod +++ /dev/null | |||
@@ -1,72 +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)>, L<DH_free(3)|DH_free(3)> | ||
63 | |||
64 | =head1 HISTORY | ||
65 | |||
66 | DH_check() is available in all versions of SSLeay and OpenSSL. | ||
67 | The B<cb_arg> argument to DH_generate_parameters() was added in SSLeay 0.9.0. | ||
68 | |||
69 | In versions before OpenSSL 0.9.5, DH_CHECK_P_NOT_STRONG_PRIME is used | ||
70 | instead of DH_CHECK_P_NOT_SAFE_PRIME. | ||
71 | |||
72 | =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 82e2548bcd..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()|RSA_get_ex_new_index()>, 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 62088eea1b..0000000000 --- a/src/lib/libcrypto/doc/DH_set_method.pod +++ /dev/null | |||
@@ -1,111 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DH_set_default_openssl_method, DH_get_default_openssl_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_openssl_method(DH_METHOD *meth); | ||
14 | |||
15 | DH_METHOD *DH_get_default_openssl_method(void); | ||
16 | |||
17 | int DH_set_method(DH *dh, ENGINE *engine); | ||
18 | |||
19 | DH *DH_new_method(ENGINE *engine); | ||
20 | |||
21 | 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. | ||
28 | |||
29 | Initially, the default is to use the OpenSSL internal implementation. | ||
30 | DH_OpenSSL() returns a pointer to that method. | ||
31 | |||
32 | DH_set_default_openssl_method() makes B<meth> the default method for all DH | ||
33 | structures created later. B<NB:> This is true only whilst the default engine | ||
34 | for Diffie-Hellman operations remains as "openssl". ENGINEs provide an | ||
35 | encapsulation for implementations of one or more algorithms, and all the DH | ||
36 | functions mentioned here operate within the scope of the default | ||
37 | "openssl" engine. | ||
38 | |||
39 | DH_get_default_openssl_method() returns a pointer to the current default | ||
40 | method for the "openssl" engine. | ||
41 | |||
42 | DH_set_method() selects B<engine> as the engine that will be responsible for | ||
43 | all operations using the structure B<dh>. If this function completes successfully, | ||
44 | then the B<dh> structure will have its own functional reference of B<engine>, so | ||
45 | the caller should remember to free their own reference to B<engine> when they are | ||
46 | finished with it. NB: An ENGINE's DH_METHOD can be retrieved (or set) by | ||
47 | ENGINE_get_DH() or ENGINE_set_DH(). | ||
48 | |||
49 | DH_new_method() allocates and initializes a DH structure so that | ||
50 | B<engine> will be used for the DH operations. If B<engine> is NULL, | ||
51 | the default engine for Diffie-Hellman opertaions is used. | ||
52 | |||
53 | =head1 THE DH_METHOD STRUCTURE | ||
54 | |||
55 | typedef struct dh_meth_st | ||
56 | { | ||
57 | /* name of the implementation */ | ||
58 | const char *name; | ||
59 | |||
60 | /* generate private and public DH values for key agreement */ | ||
61 | int (*generate_key)(DH *dh); | ||
62 | |||
63 | /* compute shared secret */ | ||
64 | int (*compute_key)(unsigned char *key, BIGNUM *pub_key, DH *dh); | ||
65 | |||
66 | /* compute r = a ^ p mod m (May be NULL for some implementations) */ | ||
67 | int (*bn_mod_exp)(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p, | ||
68 | const BIGNUM *m, BN_CTX *ctx, | ||
69 | BN_MONT_CTX *m_ctx); | ||
70 | |||
71 | /* called at DH_new */ | ||
72 | int (*init)(DH *dh); | ||
73 | |||
74 | /* called at DH_free */ | ||
75 | int (*finish)(DH *dh); | ||
76 | |||
77 | int flags; | ||
78 | |||
79 | char *app_data; /* ?? */ | ||
80 | |||
81 | } DH_METHOD; | ||
82 | |||
83 | =head1 RETURN VALUES | ||
84 | |||
85 | DH_OpenSSL() and DH_get_default_method() return pointers to the respective | ||
86 | DH_METHODs. | ||
87 | |||
88 | DH_set_default_openssl_method() returns no value. | ||
89 | |||
90 | DH_set_method() returns non-zero if the ENGINE associated with B<dh> | ||
91 | was successfully changed to B<engine>. | ||
92 | |||
93 | DH_new_method() returns NULL and sets an error code that can be | ||
94 | obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. | ||
95 | Otherwise it returns a pointer to the newly allocated structure. | ||
96 | |||
97 | =head1 SEE ALSO | ||
98 | |||
99 | L<dh(3)|dh(3)>, L<DH_new(3)|DH_new(3)> | ||
100 | |||
101 | =head1 HISTORY | ||
102 | |||
103 | DH_set_default_method(), DH_get_default_method(), DH_set_method(), | ||
104 | DH_new_method() and DH_OpenSSL() were added in OpenSSL 0.9.4. | ||
105 | |||
106 | DH_set_default_openssl_method() and DH_get_default_openssl_method() | ||
107 | replaced DH_set_default_method() and DH_get_default_method() respectively, | ||
108 | and DH_set_method() and DH_new_method() were altered to use B<ENGINE>s | ||
109 | rather than B<DH_METHOD>s during development of OpenSSL 0.9.6. | ||
110 | |||
111 | =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 45df4c0661..0000000000 --- a/src/lib/libcrypto/doc/DSA_SIG_new.pod +++ /dev/null | |||
@@ -1,39 +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)>, L<DSA_do_sign(3)|DSA_do_sign(3)> | ||
34 | |||
35 | =head1 HISTORY | ||
36 | |||
37 | DSA_SIG_new() and DSA_SIG_free() were added in OpenSSL 0.9.3. | ||
38 | |||
39 | =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 695f99a13b..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(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 9906a2d7e0..0000000000 --- a/src/lib/libcrypto/doc/DSA_generate_key.pod +++ /dev/null | |||
@@ -1,33 +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)>, L<DSA_generate_parameters(3)|DSA_generate_parameters(3)> | ||
28 | |||
29 | =head1 HISTORY | ||
30 | |||
31 | DSA_generate_key() is available since SSLeay 0.8. | ||
32 | |||
33 | =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 301af912dd..0000000000 --- a/src/lib/libcrypto/doc/DSA_new.pod +++ /dev/null | |||
@@ -1,41 +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. | ||
18 | |||
19 | DSA_free() frees the B<DSA> 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, DSA_new() returns B<NULL> and sets an error | ||
25 | 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_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_generate_parameters(3)|DSA_generate_parameters(3)>, | ||
35 | L<DSA_generate_key(3)|DSA_generate_key(3)> | ||
36 | |||
37 | =head1 HISTORY | ||
38 | |||
39 | DSA_new() and DSA_free() are available in all versions of SSLeay and OpenSSL. | ||
40 | |||
41 | =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 c56dfd0f47..0000000000 --- a/src/lib/libcrypto/doc/DSA_set_method.pod +++ /dev/null | |||
@@ -1,118 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | DSA_set_default_openssl_method, DSA_get_default_openssl_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_openssl_method(DSA_METHOD *meth); | ||
14 | |||
15 | DSA_METHOD *DSA_get_default_openssl_method(void); | ||
16 | |||
17 | int DSA_set_method(DSA *dsa, ENGINE *engine); | ||
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. | ||
28 | |||
29 | Initially, the default is to use the OpenSSL internal implementation. | ||
30 | DSA_OpenSSL() returns a pointer to that method. | ||
31 | |||
32 | DSA_set_default_openssl_method() makes B<meth> the default method for | ||
33 | all DSA structures created later. B<NB:> This is true only whilst the | ||
34 | default engine for DSA operations remains as "openssl". ENGINEs | ||
35 | provide an encapsulation for implementations of one or more algorithms at a | ||
36 | time, and all the DSA functions mentioned here operate within the scope | ||
37 | of the default "openssl" engine. | ||
38 | |||
39 | DSA_get_default_openssl_method() returns a pointer to the current default | ||
40 | method for the "openssl" engine. | ||
41 | |||
42 | DSA_set_method() selects B<engine> for all operations using the structure B<dsa>. | ||
43 | |||
44 | DSA_new_method() allocates and initializes a DSA structure so that | ||
45 | B<engine> will be used for the DSA operations. If B<engine> is NULL, | ||
46 | the default engine for DSA operations is used. | ||
47 | |||
48 | =head1 THE DSA_METHOD STRUCTURE | ||
49 | |||
50 | struct | ||
51 | { | ||
52 | /* name of the implementation */ | ||
53 | const char *name; | ||
54 | |||
55 | /* sign */ | ||
56 | DSA_SIG *(*dsa_do_sign)(const unsigned char *dgst, int dlen, | ||
57 | DSA *dsa); | ||
58 | |||
59 | /* pre-compute k^-1 and r */ | ||
60 | int (*dsa_sign_setup)(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, | ||
61 | BIGNUM **rp); | ||
62 | |||
63 | /* verify */ | ||
64 | int (*dsa_do_verify)(const unsigned char *dgst, int dgst_len, | ||
65 | DSA_SIG *sig, DSA *dsa); | ||
66 | |||
67 | /* compute rr = a1^p1 * a2^p2 mod m (May be NULL for some | ||
68 | implementations) */ | ||
69 | int (*dsa_mod_exp)(DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, | ||
70 | BIGNUM *a2, BIGNUM *p2, BIGNUM *m, | ||
71 | BN_CTX *ctx, BN_MONT_CTX *in_mont); | ||
72 | |||
73 | /* compute r = a ^ p mod m (May be NULL for some implementations) */ | ||
74 | int (*bn_mod_exp)(DSA *dsa, BIGNUM *r, BIGNUM *a, | ||
75 | const BIGNUM *p, const BIGNUM *m, | ||
76 | BN_CTX *ctx, BN_MONT_CTX *m_ctx); | ||
77 | |||
78 | /* called at DSA_new */ | ||
79 | int (*init)(DSA *DSA); | ||
80 | |||
81 | /* called at DSA_free */ | ||
82 | int (*finish)(DSA *DSA); | ||
83 | |||
84 | int flags; | ||
85 | |||
86 | char *app_data; /* ?? */ | ||
87 | |||
88 | } DSA_METHOD; | ||
89 | |||
90 | =head1 RETURN VALUES | ||
91 | |||
92 | DSA_OpenSSL() and DSA_get_default_openssl_method() return pointers to the | ||
93 | respective DSA_METHODs. | ||
94 | |||
95 | DSA_set_default_openssl_method() returns no value. | ||
96 | |||
97 | DSA_set_method() returns non-zero if the ENGINE associated with B<dsa> | ||
98 | was successfully changed to B<engine>. | ||
99 | |||
100 | DSA_new_method() returns NULL and sets an error code that can be | ||
101 | obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation | ||
102 | fails. Otherwise it returns a pointer to the newly allocated structure. | ||
103 | |||
104 | =head1 SEE ALSO | ||
105 | |||
106 | L<dsa(3)|dsa(3)>, L<DSA_new(3)|DSA_new(3)> | ||
107 | |||
108 | =head1 HISTORY | ||
109 | |||
110 | DSA_set_default_method(), DSA_get_default_method(), DSA_set_method(), | ||
111 | DSA_new_method() and DSA_OpenSSL() were added in OpenSSL 0.9.4. | ||
112 | |||
113 | DSA_set_default_openssl_method() and DSA_get_default_openssl_method() | ||
114 | replaced DSA_set_default_method() and DSA_get_default_method() respectively, | ||
115 | and DSA_set_method() and DSA_new_method() were altered to use B<ENGINE>s | ||
116 | rather than B<DSA_METHOD>s during development of OpenSSL 0.9.6. | ||
117 | |||
118 | =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 23b6320a4d..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(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 e01beb817a..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 | char *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 3551bacb8d..0000000000 --- a/src/lib/libcrypto/doc/ERR_get_error.pod +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | ERR_get_error, ERR_peek_error, ERR_get_error_line, ERR_peek_error_line, | ||
6 | ERR_get_error_line_data, ERR_peek_error_line_data - obtain error code and data | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/err.h> | ||
11 | |||
12 | unsigned long ERR_get_error(void); | ||
13 | unsigned long ERR_peek_error(void); | ||
14 | |||
15 | unsigned long ERR_get_error_line(const char **file, int *line); | ||
16 | unsigned long ERR_peek_error_line(const char **file, int *line); | ||
17 | |||
18 | unsigned long ERR_get_error_line_data(const char **file, int *line, | ||
19 | const char **data, int *flags); | ||
20 | unsigned long ERR_peek_error_line_data(const char **file, int *line, | ||
21 | const char **data, int *flags); | ||
22 | |||
23 | =head1 DESCRIPTION | ||
24 | |||
25 | ERR_get_error() returns the last error code from the thread's error | ||
26 | queue and removes the entry. This function can be called repeatedly | ||
27 | until there are no more error codes to return. | ||
28 | |||
29 | ERR_peek_error() returns the last error code from the thread's | ||
30 | error queue without modifying it. | ||
31 | |||
32 | See L<ERR_GET_LIB(3)|ERR_GET_LIB(3)> for obtaining information about | ||
33 | location and reason of the error, and | ||
34 | L<ERR_error_string(3)|ERR_error_string(3)> for human-readable error | ||
35 | messages. | ||
36 | |||
37 | ERR_get_error_line() and ERR_peek_error_line() are the same as the | ||
38 | above, but they additionally store the file name and line number where | ||
39 | the error occurred in *B<file> and *B<line>, unless these are B<NULL>. | ||
40 | |||
41 | ERR_get_error_line_data() and ERR_peek_error_line_data() store | ||
42 | additional data and flags associated with the error code in *B<data> | ||
43 | and *B<flags>, unless these are B<NULL>. *B<data> contains a string | ||
44 | if *B<flags>&B<ERR_TXT_STRING>. If it has been allocated by OPENSSL_malloc(), | ||
45 | *B<flags>&B<ERR_TXT_MALLOCED> is true. | ||
46 | |||
47 | =head1 RETURN VALUES | ||
48 | |||
49 | The error code, or 0 if there is no error in the queue. | ||
50 | |||
51 | =head1 SEE ALSO | ||
52 | |||
53 | L<err(3)|err(3)>, L<ERR_error_string(3)|ERR_error_string(3)>, | ||
54 | L<ERR_GET_LIB(3)|ERR_GET_LIB(3)> | ||
55 | |||
56 | =head1 HISTORY | ||
57 | |||
58 | ERR_get_error(), ERR_peek_error(), ERR_get_error_line() and | ||
59 | ERR_peek_error_line() are available in all versions of SSLeay and | ||
60 | OpenSSL. ERR_get_error_line_data() and ERR_peek_error_line_data() | ||
61 | were added in SSLeay 0.9.0. | ||
62 | |||
63 | =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_DigestInit.pod b/src/lib/libcrypto/doc/EVP_DigestInit.pod deleted file mode 100644 index fefc858f7e..0000000000 --- a/src/lib/libcrypto/doc/EVP_DigestInit.pod +++ /dev/null | |||
@@ -1,202 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | EVP_DigestInit, EVP_DigestUpdate, EVP_DigestFinal, EVP_MAX_MD_SIZE, | ||
6 | EVP_MD_CTX_copy, EVP_MD_type, EVP_MD_pkey_type, EVP_MD_size, EVP_MD_block_size, | ||
7 | EVP_MD_CTX_md, EVP_MD_CTX_size, EVP_MD_CTX_block_size, EVP_MD_CTX_type, | ||
8 | EVP_md_null, EVP_md2, EVP_md5, EVP_sha, EVP_sha1, EVP_dss, EVP_dss1, EVP_mdc2, | ||
9 | EVP_ripemd160, EVP_get_digestbyname, EVP_get_digestbynid, EVP_get_digestbyobj - | ||
10 | EVP digest routines | ||
11 | |||
12 | =head1 SYNOPSIS | ||
13 | |||
14 | #include <openssl/evp.h> | ||
15 | |||
16 | void EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); | ||
17 | void EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt); | ||
18 | void EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, | ||
19 | unsigned int *s); | ||
20 | |||
21 | #define EVP_MAX_MD_SIZE (16+20) /* The SSLv3 md5+sha1 type */ | ||
22 | |||
23 | int EVP_MD_CTX_copy(EVP_MD_CTX *out,EVP_MD_CTX *in); | ||
24 | |||
25 | #define EVP_MD_type(e) ((e)->type) | ||
26 | #define EVP_MD_pkey_type(e) ((e)->pkey_type) | ||
27 | #define EVP_MD_size(e) ((e)->md_size) | ||
28 | #define EVP_MD_block_size(e) ((e)->block_size) | ||
29 | |||
30 | #define EVP_MD_CTX_md(e) (e)->digest) | ||
31 | #define EVP_MD_CTX_size(e) EVP_MD_size((e)->digest) | ||
32 | #define EVP_MD_CTX_block_size(e) EVP_MD_block_size((e)->digest) | ||
33 | #define EVP_MD_CTX_type(e) EVP_MD_type((e)->digest) | ||
34 | |||
35 | EVP_MD *EVP_md_null(void); | ||
36 | EVP_MD *EVP_md2(void); | ||
37 | EVP_MD *EVP_md5(void); | ||
38 | EVP_MD *EVP_sha(void); | ||
39 | EVP_MD *EVP_sha1(void); | ||
40 | EVP_MD *EVP_dss(void); | ||
41 | EVP_MD *EVP_dss1(void); | ||
42 | EVP_MD *EVP_mdc2(void); | ||
43 | EVP_MD *EVP_ripemd160(void); | ||
44 | |||
45 | const EVP_MD *EVP_get_digestbyname(const char *name); | ||
46 | #define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a)) | ||
47 | #define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a)) | ||
48 | |||
49 | =head1 DESCRIPTION | ||
50 | |||
51 | The EVP digest routines are a high level interface to message digests. | ||
52 | |||
53 | EVP_DigestInit() initializes a digest context B<ctx> to use a digest | ||
54 | B<type>: this will typically be supplied by a function such as | ||
55 | EVP_sha1(). | ||
56 | |||
57 | EVP_DigestUpdate() hashes B<cnt> bytes of data at B<d> into the | ||
58 | digest context B<ctx>. This function can be called several times on the | ||
59 | same B<ctx> to hash additional data. | ||
60 | |||
61 | EVP_DigestFinal() retrieves the digest value from B<ctx> and places | ||
62 | it in B<md>. If the B<s> parameter is not NULL then the number of | ||
63 | bytes of data written (i.e. the length of the digest) will be written | ||
64 | to the integer at B<s>, at most B<EVP_MAX_MD_SIZE> bytes will be written. | ||
65 | After calling EVP_DigestFinal() no additional calls to EVP_DigestUpdate() | ||
66 | can be made, but EVP_DigestInit() can be called to initialize a new | ||
67 | digest operation. | ||
68 | |||
69 | EVP_MD_CTX_copy() can be used to copy the message digest state from | ||
70 | B<in> to B<out>. This is useful if large amounts of data are to be | ||
71 | hashed which only differ in the last few bytes. | ||
72 | |||
73 | EVP_MD_size() and EVP_MD_CTX_size() return the size of the message digest | ||
74 | when passed an B<EVP_MD> or an B<EVP_MD_CTX> structure, i.e. the size of the | ||
75 | hash. | ||
76 | |||
77 | EVP_MD_block_size() and EVP_MD_CTX_block_size() return the block size of the | ||
78 | message digest when passed an B<EVP_MD> or an B<EVP_MD_CTX> structure. | ||
79 | |||
80 | EVP_MD_type() and EVP_MD_CTX_type() return the NID of the OBJECT IDENTIFIER | ||
81 | representing the given message digest when passed an B<EVP_MD> structure. | ||
82 | For example EVP_MD_type(EVP_sha1()) returns B<NID_sha1>. This function is | ||
83 | normally used when setting ASN1 OIDs. | ||
84 | |||
85 | EVP_MD_CTX_md() returns the B<EVP_MD> structure corresponding to the passed | ||
86 | B<EVP_MD_CTX>. | ||
87 | |||
88 | EVP_MD_pkey_type() returns the NID of the public key signing algorithm associated | ||
89 | with this digest. For example EVP_sha1() is associated with RSA so this will | ||
90 | return B<NID_sha1WithRSAEncryption>. This "link" between digests and signature | ||
91 | algorithms may not be retained in future versions of OpenSSL. | ||
92 | |||
93 | EVP_md2(), EVP_md5(), EVP_sha(), EVP_sha1(), EVP_mdc2() and EVP_ripemd160() | ||
94 | return B<EVP_MD> structures for the MD2, MD5, SHA, SHA1, MDC2 and RIPEMD160 digest | ||
95 | algorithms respectively. The associated signature algorithm is RSA in each case. | ||
96 | |||
97 | EVP_dss() and EVP_dss1() return B<EVP_MD> structures for SHA and SHA1 digest | ||
98 | algorithms but using DSS (DSA) for the signature algorithm. | ||
99 | |||
100 | EVP_md_null() is a "null" message digest that does nothing: i.e. the hash it | ||
101 | returns is of zero length. | ||
102 | |||
103 | EVP_get_digestbyname(), EVP_get_digestbynid() and EVP_get_digestbyobj() | ||
104 | return an B<EVP_MD> structure when passed a digest name, a digest NID or | ||
105 | an ASN1_OBJECT structure respectively. The digest table must be initialized | ||
106 | using, for example, OpenSSL_add_all_digests() for these functions to work. | ||
107 | |||
108 | =head1 RETURN VALUES | ||
109 | |||
110 | EVP_DigestInit(), EVP_DigestUpdate() and EVP_DigestFinal() do not return values. | ||
111 | |||
112 | EVP_MD_CTX_copy() returns 1 if successful or 0 for failure. | ||
113 | |||
114 | EVP_MD_type(), EVP_MD_pkey_type() and EVP_MD_type() return the NID of the | ||
115 | corresponding OBJECT IDENTIFIER or NID_undef if none exists. | ||
116 | |||
117 | EVP_MD_size(), EVP_MD_block_size(), EVP_MD_CTX_size(e), EVP_MD_size(), | ||
118 | EVP_MD_CTX_block_size() and EVP_MD_block_size() return the digest or block | ||
119 | size in bytes. | ||
120 | |||
121 | EVP_md_null(), EVP_md2(), EVP_md5(), EVP_sha(), EVP_sha1(), EVP_dss(), | ||
122 | EVP_dss1(), EVP_mdc2() and EVP_ripemd160() return pointers to the | ||
123 | corresponding EVP_MD structures. | ||
124 | |||
125 | EVP_get_digestbyname(), EVP_get_digestbynid() and EVP_get_digestbyobj() | ||
126 | return either an B<EVP_MD> structure or NULL if an error occurs. | ||
127 | |||
128 | =head1 NOTES | ||
129 | |||
130 | The B<EVP> interface to message digests should almost always be used in | ||
131 | preference to the low level interfaces. This is because the code then becomes | ||
132 | transparent to the digest used and much more flexible. | ||
133 | |||
134 | SHA1 is the digest of choice for new applications. The other digest algorithms | ||
135 | are still in common use. | ||
136 | |||
137 | =head1 EXAMPLE | ||
138 | |||
139 | This example digests the data "Test Message\n" and "Hello World\n", using the | ||
140 | digest name passed on the command line. | ||
141 | |||
142 | #include <stdio.h> | ||
143 | #include <openssl/evp.h> | ||
144 | |||
145 | main(int argc, char *argv[]) | ||
146 | { | ||
147 | EVP_MD_CTX mdctx; | ||
148 | const EVP_MD *md; | ||
149 | char mess1[] = "Test Message\n"; | ||
150 | char mess2[] = "Hello World\n"; | ||
151 | unsigned char md_value[EVP_MAX_MD_SIZE]; | ||
152 | int md_len, i; | ||
153 | |||
154 | OpenSSL_add_all_digests(); | ||
155 | |||
156 | if(!argv[1]) { | ||
157 | printf("Usage: mdtest digestname\n"); | ||
158 | exit(1); | ||
159 | } | ||
160 | |||
161 | md = EVP_get_digestbyname(argv[1]); | ||
162 | |||
163 | if(!md) { | ||
164 | printf("Unknown message digest %s\n", argv[1]); | ||
165 | exit(1); | ||
166 | } | ||
167 | |||
168 | EVP_DigestInit(&mdctx, md); | ||
169 | EVP_DigestUpdate(&mdctx, mess1, strlen(mess1)); | ||
170 | EVP_DigestUpdate(&mdctx, mess2, strlen(mess2)); | ||
171 | EVP_DigestFinal(&mdctx, md_value, &md_len); | ||
172 | |||
173 | printf("Digest is: "); | ||
174 | for(i = 0; i < md_len; i++) printf("%02x", md_value[i]); | ||
175 | printf("\n"); | ||
176 | } | ||
177 | |||
178 | =head1 BUGS | ||
179 | |||
180 | Several of the functions do not return values: maybe they should. Although the | ||
181 | internal digest operations will never fail some future hardware based operations | ||
182 | might. | ||
183 | |||
184 | The link between digests and signing algorithms results in a situation where | ||
185 | EVP_sha1() must be used with RSA and EVP_dss1() must be used with DSS | ||
186 | even though they are identical digests. | ||
187 | |||
188 | The size of an B<EVP_MD_CTX> structure is determined at compile time: this results | ||
189 | in code that must be recompiled if the size of B<EVP_MD_CTX> increases. | ||
190 | |||
191 | =head1 SEE ALSO | ||
192 | |||
193 | L<evp(3)|evp(3)>, L<HMAC(3)|HMAC(3)>, L<MD2(3)|MD2(3)>, | ||
194 | L<MD5(3)|MD5(3)>, L<MDC2(3)|MDC2(3)>, L<RIPEMD160(3)|RIPEMD160(3)>, | ||
195 | L<SHA1(3)|SHA1(3)> | ||
196 | |||
197 | =head1 HISTORY | ||
198 | |||
199 | EVP_DigestInit(), EVP_DigestUpdate() and EVP_DigestFinal() are | ||
200 | available in all versions of SSLeay and OpenSSL. | ||
201 | |||
202 | =cut | ||
diff --git a/src/lib/libcrypto/doc/EVP_EncryptInit.pod b/src/lib/libcrypto/doc/EVP_EncryptInit.pod deleted file mode 100644 index 9afe2396e2..0000000000 --- a/src/lib/libcrypto/doc/EVP_EncryptInit.pod +++ /dev/null | |||
@@ -1,359 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | EVP_EncryptInit, EVP_EncryptUpdate, EVP_EncryptFinal, EVP_DecryptInit, | ||
6 | EVP_DecryptUpdate, EVP_DecryptFinal, EVP_CipherInit, EVP_CipherUpdate, | ||
7 | EVP_CipherFinal, EVP_CIPHER_CTX_set_key_length, EVP_CIPHER_CTX_ctrl, | ||
8 | EVP_CIPHER_CTX_cleanup, EVP_get_cipherbyname, EVP_get_cipherbynid, | ||
9 | EVP_get_cipherbyobj, EVP_CIPHER_nid, EVP_CIPHER_block_size, | ||
10 | EVP_CIPHER_key_length, EVP_CIPHER_iv_length, EVP_CIPHER_flags, | ||
11 | EVP_CIPHER_mode, EVP_CIPHER_type, EVP_CIPHER_CTX_cipher, EVP_CIPHER_CTX_nid, | ||
12 | EVP_CIPHER_CTX_block_size, EVP_CIPHER_CTX_key_length, EVP_CIPHER_CTX_iv_length, | ||
13 | EVP_CIPHER_CTX_get_app_data, EVP_CIPHER_CTX_set_app_data, EVP_CIPHER_CTX_type, | ||
14 | EVP_CIPHER_CTX_flags, EVP_CIPHER_CTX_mode, EVP_CIPHER_param_to_asn1, | ||
15 | EVP_CIPHER_asn1_to_param - EVP cipher routines | ||
16 | |||
17 | =head1 SYNOPSIS | ||
18 | |||
19 | #include <openssl/evp.h> | ||
20 | |||
21 | int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, | ||
22 | unsigned char *key, unsigned char *iv); | ||
23 | int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
24 | int *outl, unsigned char *in, int inl); | ||
25 | int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
26 | int *outl); | ||
27 | |||
28 | int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, | ||
29 | unsigned char *key, unsigned char *iv); | ||
30 | int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
31 | int *outl, unsigned char *in, int inl); | ||
32 | int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, | ||
33 | int *outl); | ||
34 | |||
35 | int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, | ||
36 | unsigned char *key, unsigned char *iv, int enc); | ||
37 | int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
38 | int *outl, unsigned char *in, int inl); | ||
39 | int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, | ||
40 | int *outl); | ||
41 | |||
42 | int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen); | ||
43 | int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr); | ||
44 | int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); | ||
45 | |||
46 | const EVP_CIPHER *EVP_get_cipherbyname(const char *name); | ||
47 | #define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a)) | ||
48 | #define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)) | ||
49 | |||
50 | #define EVP_CIPHER_nid(e) ((e)->nid) | ||
51 | #define EVP_CIPHER_block_size(e) ((e)->block_size) | ||
52 | #define EVP_CIPHER_key_length(e) ((e)->key_len) | ||
53 | #define EVP_CIPHER_iv_length(e) ((e)->iv_len) | ||
54 | #define EVP_CIPHER_flags(e) ((e)->flags) | ||
55 | #define EVP_CIPHER_mode(e) ((e)->flags) & EVP_CIPH_MODE) | ||
56 | int EVP_CIPHER_type(const EVP_CIPHER *ctx); | ||
57 | |||
58 | #define EVP_CIPHER_CTX_cipher(e) ((e)->cipher) | ||
59 | #define EVP_CIPHER_CTX_nid(e) ((e)->cipher->nid) | ||
60 | #define EVP_CIPHER_CTX_block_size(e) ((e)->cipher->block_size) | ||
61 | #define EVP_CIPHER_CTX_key_length(e) ((e)->key_len) | ||
62 | #define EVP_CIPHER_CTX_iv_length(e) ((e)->cipher->iv_len) | ||
63 | #define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data) | ||
64 | #define EVP_CIPHER_CTX_set_app_data(e,d) ((e)->app_data=(char *)(d)) | ||
65 | #define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) | ||
66 | #define EVP_CIPHER_CTX_flags(e) ((e)->cipher->flags) | ||
67 | #define EVP_CIPHER_CTX_mode(e) ((e)->cipher->flags & EVP_CIPH_MODE) | ||
68 | |||
69 | int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type); | ||
70 | int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); | ||
71 | |||
72 | =head1 DESCRIPTION | ||
73 | |||
74 | The EVP cipher routines are a high level interface to certain | ||
75 | symmetric ciphers. | ||
76 | |||
77 | EVP_EncryptInit() initializes a cipher context B<ctx> for encryption | ||
78 | with cipher B<type>. B<type> is normally supplied by a function such | ||
79 | as EVP_des_cbc() . B<key> is the symmetric key to use and B<iv> is the | ||
80 | IV to use (if necessary), the actual number of bytes used for the | ||
81 | key and IV depends on the cipher. It is possible to set all parameters | ||
82 | to NULL except B<type> in an initial call and supply the remaining | ||
83 | parameters in subsequent calls, all of which have B<type> set to NULL. | ||
84 | This is done when the default cipher parameters are not appropriate. | ||
85 | |||
86 | EVP_EncryptUpdate() encrypts B<inl> bytes from the buffer B<in> and | ||
87 | writes the encrypted version to B<out>. This function can be called | ||
88 | multiple times to encrypt successive blocks of data. The amount | ||
89 | of data written depends on the block alignment of the encrypted data: | ||
90 | as a result the amount of data written may be anything from zero bytes | ||
91 | to (inl + cipher_block_size - 1) so B<outl> should contain sufficient | ||
92 | room. The actual number of bytes written is placed in B<outl>. | ||
93 | |||
94 | EVP_EncryptFinal() encrypts the "final" data, that is any data that | ||
95 | remains in a partial block. It uses L<standard block padding|/NOTES> (aka PKCS | ||
96 | padding). The encrypted final data is written to B<out> which should | ||
97 | have sufficient space for one cipher block. The number of bytes written | ||
98 | is placed in B<outl>. After this function is called the encryption operation | ||
99 | is finished and no further calls to EVP_EncryptUpdate() should be made. | ||
100 | |||
101 | EVP_DecryptInit(), EVP_DecryptUpdate() and EVP_DecryptFinal() are the | ||
102 | corresponding decryption operations. EVP_DecryptFinal() will return an | ||
103 | error code if the final block is not correctly formatted. The parameters | ||
104 | and restrictions are identical to the encryption operations except that | ||
105 | the decrypted data buffer B<out> passed to EVP_DecryptUpdate() should | ||
106 | have sufficient room for (B<inl> + cipher_block_size) bytes unless the | ||
107 | cipher block size is 1 in which case B<inl> bytes is sufficient. | ||
108 | |||
109 | EVP_CipherInit(), EVP_CipherUpdate() and EVP_CipherFinal() are functions | ||
110 | that can be used for decryption or encryption. The operation performed | ||
111 | depends on the value of the B<enc> parameter. It should be set to 1 for | ||
112 | encryption, 0 for decryption and -1 to leave the value unchanged (the | ||
113 | actual value of 'enc' being supplied in a previous call). | ||
114 | |||
115 | EVP_CIPHER_CTX_cleanup() clears all information from a cipher context. | ||
116 | It should be called after all operations using a cipher are complete | ||
117 | so sensitive information does not remain in memory. | ||
118 | |||
119 | EVP_get_cipherbyname(), EVP_get_cipherbynid() and EVP_get_cipherbyobj() | ||
120 | return an EVP_CIPHER structure when passed a cipher name, a NID or an | ||
121 | ASN1_OBJECT structure. | ||
122 | |||
123 | EVP_CIPHER_nid() and EVP_CIPHER_CTX_nid() return the NID of a cipher when | ||
124 | passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX> structure. The actual NID | ||
125 | value is an internal value which may not have a corresponding OBJECT | ||
126 | IDENTIFIER. | ||
127 | |||
128 | EVP_CIPHER_key_length() and EVP_CIPHER_CTX_key_length() return the key | ||
129 | length of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX> | ||
130 | structure. The constant B<EVP_MAX_KEY_LENGTH> is the maximum key length | ||
131 | for all ciphers. Note: although EVP_CIPHER_key_length() is fixed for a | ||
132 | given cipher, the value of EVP_CIPHER_CTX_key_length() may be different | ||
133 | for variable key length ciphers. | ||
134 | |||
135 | EVP_CIPHER_CTX_set_key_length() sets the key length of the cipher ctx. | ||
136 | If the cipher is a fixed length cipher then attempting to set the key | ||
137 | length to any value other than the fixed value is an error. | ||
138 | |||
139 | EVP_CIPHER_iv_length() and EVP_CIPHER_CTX_iv_length() return the IV | ||
140 | length of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX>. | ||
141 | It will return zero if the cipher does not use an IV. The constant | ||
142 | B<EVP_MAX_IV_LENGTH> is the maximum IV length for all ciphers. | ||
143 | |||
144 | EVP_CIPHER_block_size() and EVP_CIPHER_CTX_block_size() return the block | ||
145 | size of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX> | ||
146 | structure. The constant B<EVP_MAX_IV_LENGTH> is also the maximum block | ||
147 | length for all ciphers. | ||
148 | |||
149 | EVP_CIPHER_type() and EVP_CIPHER_CTX_type() return the type of the passed | ||
150 | cipher or context. This "type" is the actual NID of the cipher OBJECT | ||
151 | IDENTIFIER as such it ignores the cipher parameters and 40 bit RC2 and | ||
152 | 128 bit RC2 have the same NID. If the cipher does not have an object | ||
153 | identifier or does not have ASN1 support this function will return | ||
154 | B<NID_undef>. | ||
155 | |||
156 | EVP_CIPHER_CTX_cipher() returns the B<EVP_CIPHER> structure when passed | ||
157 | an B<EVP_CIPHER_CTX> structure. | ||
158 | |||
159 | EVP_CIPHER_mode() and EVP_CIPHER_CTX_mode() return the block cipher mode: | ||
160 | EVP_CIPH_ECB_MODE, EVP_CIPH_CBC_MODE, EVP_CIPH_CFB_MODE or | ||
161 | EVP_CIPH_OFB_MODE. If the cipher is a stream cipher then | ||
162 | EVP_CIPH_STREAM_CIPHER is returned. | ||
163 | |||
164 | EVP_CIPHER_param_to_asn1() sets the AlgorithmIdentifier "parameter" based | ||
165 | on the passed cipher. This will typically include any parameters and an | ||
166 | IV. The cipher IV (if any) must be set when this call is made. This call | ||
167 | should be made before the cipher is actually "used" (before any | ||
168 | EVP_EncryptUpdate(), EVP_DecryptUpdate() calls for example). This function | ||
169 | may fail if the cipher does not have any ASN1 support. | ||
170 | |||
171 | EVP_CIPHER_asn1_to_param() sets the cipher parameters based on an ASN1 | ||
172 | AlgorithmIdentifier "parameter". The precise effect depends on the cipher | ||
173 | In the case of RC2, for example, it will set the IV and effective key length. | ||
174 | This function should be called after the base cipher type is set but before | ||
175 | the key is set. For example EVP_CipherInit() will be called with the IV and | ||
176 | key set to NULL, EVP_CIPHER_asn1_to_param() will be called and finally | ||
177 | EVP_CipherInit() again with all parameters except the key set to NULL. It is | ||
178 | possible for this function to fail if the cipher does not have any ASN1 support | ||
179 | or the parameters cannot be set (for example the RC2 effective key length | ||
180 | is not supported. | ||
181 | |||
182 | EVP_CIPHER_CTX_ctrl() allows various cipher specific parameters to be determined | ||
183 | and set. Currently only the RC2 effective key length and the number of rounds of | ||
184 | RC5 can be set. | ||
185 | |||
186 | =head1 RETURN VALUES | ||
187 | |||
188 | EVP_EncryptInit(), EVP_EncryptUpdate() and EVP_EncryptFinal() return 1 for success | ||
189 | and 0 for failure. | ||
190 | |||
191 | EVP_DecryptInit() and EVP_DecryptUpdate() return 1 for success and 0 for failure. | ||
192 | EVP_DecryptFinal() returns 0 if the decrypt failed or 1 for success. | ||
193 | |||
194 | EVP_CipherInit() and EVP_CipherUpdate() return 1 for success and 0 for failure. | ||
195 | EVP_CipherFinal() returns 1 for a decryption failure or 1 for success. | ||
196 | |||
197 | EVP_CIPHER_CTX_cleanup() returns 1 for success and 0 for failure. | ||
198 | |||
199 | EVP_get_cipherbyname(), EVP_get_cipherbynid() and EVP_get_cipherbyobj() | ||
200 | return an B<EVP_CIPHER> structure or NULL on error. | ||
201 | |||
202 | EVP_CIPHER_nid() and EVP_CIPHER_CTX_nid() return a NID. | ||
203 | |||
204 | EVP_CIPHER_block_size() and EVP_CIPHER_CTX_block_size() return the block | ||
205 | size. | ||
206 | |||
207 | EVP_CIPHER_key_length() and EVP_CIPHER_CTX_key_length() return the key | ||
208 | length. | ||
209 | |||
210 | EVP_CIPHER_iv_length() and EVP_CIPHER_CTX_iv_length() return the IV | ||
211 | length or zero if the cipher does not use an IV. | ||
212 | |||
213 | EVP_CIPHER_type() and EVP_CIPHER_CTX_type() return the NID of the cipher's | ||
214 | OBJECT IDENTIFIER or NID_undef if it has no defined OBJECT IDENTIFIER. | ||
215 | |||
216 | EVP_CIPHER_CTX_cipher() returns an B<EVP_CIPHER> structure. | ||
217 | |||
218 | EVP_CIPHER_param_to_asn1() and EVP_CIPHER_asn1_to_param() return 1 for | ||
219 | success or zero for failure. | ||
220 | |||
221 | =head1 CIPHER LISTING | ||
222 | |||
223 | All algorithms have a fixed key length unless otherwise stated. | ||
224 | |||
225 | =over 4 | ||
226 | |||
227 | =item EVP_enc_null() | ||
228 | |||
229 | Null cipher: does nothing. | ||
230 | |||
231 | =item EVP_des_cbc(void), EVP_des_ecb(void), EVP_des_cfb(void), EVP_des_ofb(void) | ||
232 | |||
233 | DES in CBC, ECB, CFB and OFB modes respectively. | ||
234 | |||
235 | =item EVP_des_ede_cbc(void), EVP_des_ede(), EVP_des_ede_ofb(void), EVP_des_ede_cfb(void) | ||
236 | |||
237 | Two key triple DES in CBC, ECB, CFB and OFB modes respectively. | ||
238 | |||
239 | =item EVP_des_ede3_cbc(void), EVP_des_ede3(), EVP_des_ede3_ofb(void), EVP_des_ede3_cfb(void) | ||
240 | |||
241 | Three key triple DES in CBC, ECB, CFB and OFB modes respectively. | ||
242 | |||
243 | =item EVP_desx_cbc(void) | ||
244 | |||
245 | DESX algorithm in CBC mode. | ||
246 | |||
247 | =item EVP_rc4(void) | ||
248 | |||
249 | RC4 stream cipher. This is a variable key length cipher with default key length 128 bits. | ||
250 | |||
251 | =item EVP_rc4_40(void) | ||
252 | |||
253 | RC4 stream cipher with 40 bit key length. This is obsolete and new code should use EVP_rc4() | ||
254 | and the EVP_CIPHER_CTX_set_key_length() function. | ||
255 | |||
256 | =item EVP_idea_cbc() EVP_idea_ecb(void), EVP_idea_cfb(void), EVP_idea_ofb(void), EVP_idea_cbc(void) | ||
257 | |||
258 | IDEA encryption algorithm in CBC, ECB, CFB and OFB modes respectively. | ||
259 | |||
260 | =item EVP_rc2_cbc(void), EVP_rc2_ecb(void), EVP_rc2_cfb(void), EVP_rc2_ofb(void) | ||
261 | |||
262 | RC2 encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key | ||
263 | length cipher with an additional parameter called "effective key bits" or "effective key length". | ||
264 | By default both are set to 128 bits. | ||
265 | |||
266 | =item EVP_rc2_40_cbc(void), EVP_rc2_64_cbc(void) | ||
267 | |||
268 | RC2 algorithm in CBC mode with a default key length and effective key length of 40 and 64 bits. | ||
269 | These are obsolete and new code should use EVP_rc2_cbc(), EVP_CIPHER_CTX_set_key_length() and | ||
270 | EVP_CIPHER_CTX_ctrl() to set the key length and effective key length. | ||
271 | |||
272 | =item EVP_bf_cbc(void), EVP_bf_ecb(void), EVP_bf_cfb(void), EVP_bf_ofb(void); | ||
273 | |||
274 | Blowfish encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key | ||
275 | length cipher. | ||
276 | |||
277 | =item EVP_cast5_cbc(void), EVP_cast5_ecb(void), EVP_cast5_cfb(void), EVP_cast5_ofb(void) | ||
278 | |||
279 | CAST encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key | ||
280 | length cipher. | ||
281 | |||
282 | =item EVP_rc5_32_12_16_cbc(void), EVP_rc5_32_12_16_ecb(void), EVP_rc5_32_12_16_cfb(void), EVP_rc5_32_12_16_ofb(void) | ||
283 | |||
284 | RC5 encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key length | ||
285 | cipher with an additional "number of rounds" parameter. By default the key length is set to 128 | ||
286 | bits and 12 rounds. | ||
287 | |||
288 | =back | ||
289 | |||
290 | =head1 NOTES | ||
291 | |||
292 | Where possible the B<EVP> interface to symmetric ciphers should be used in | ||
293 | preference to the low level interfaces. This is because the code then becomes | ||
294 | transparent to the cipher used and much more flexible. | ||
295 | |||
296 | PKCS padding works by adding B<n> padding bytes of value B<n> to make the total | ||
297 | length of the encrypted data a multiple of the block size. Padding is always | ||
298 | added so if the data is already a multiple of the block size B<n> will equal | ||
299 | the block size. For example if the block size is 8 and 11 bytes are to be | ||
300 | encrypted then 5 padding bytes of value 5 will be added. | ||
301 | |||
302 | When decrypting the final block is checked to see if it has the correct form. | ||
303 | |||
304 | Although the decryption operation can produce an error, it is not a strong | ||
305 | test that the input data or key is correct. A random block has better than | ||
306 | 1 in 256 chance of being of the correct format and problems with the | ||
307 | input data earlier on will not produce a final decrypt error. | ||
308 | |||
309 | The functions EVP_EncryptInit(), EVP_EncryptUpdate(), EVP_EncryptFinal(), | ||
310 | EVP_DecryptInit(), EVP_DecryptUpdate(), EVP_CipherInit() and EVP_CipherUpdate() | ||
311 | and EVP_CIPHER_CTX_cleanup() did not return errors in OpenSSL version 0.9.5a or | ||
312 | earlier. Software only versions of encryption algorithms will never return | ||
313 | error codes for these functions, unless there is a programming error (for example | ||
314 | and attempt to set the key before the cipher is set in EVP_EncryptInit() ). | ||
315 | |||
316 | =head1 BUGS | ||
317 | |||
318 | For RC5 the number of rounds can currently only be set to 8, 12 or 16. This is | ||
319 | a limitation of the current RC5 code rather than the EVP interface. | ||
320 | |||
321 | It should be possible to disable PKCS padding: currently it isn't. | ||
322 | |||
323 | EVP_MAX_KEY_LENGTH and EVP_MAX_IV_LENGTH only refer to the internal ciphers with | ||
324 | default key lengths. If custom ciphers exceed these values the results are | ||
325 | unpredictable. This is because it has become standard practice to define a | ||
326 | generic key as a fixed unsigned char array containing EVP_MAX_KEY_LENGTH bytes. | ||
327 | |||
328 | The ASN1 code is incomplete (and sometimes inaccurate) it has only been tested | ||
329 | for certain common S/MIME ciphers (RC2, DES, triple DES) in CBC mode. | ||
330 | |||
331 | =head1 EXAMPLES | ||
332 | |||
333 | Get the number of rounds used in RC5: | ||
334 | |||
335 | int nrounds; | ||
336 | EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC5_ROUNDS, 0, &i); | ||
337 | |||
338 | Get the RC2 effective key length: | ||
339 | |||
340 | int key_bits; | ||
341 | EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC2_KEY_BITS, 0, &i); | ||
342 | |||
343 | Set the number of rounds used in RC5: | ||
344 | |||
345 | int nrounds; | ||
346 | EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC5_ROUNDS, i, NULL); | ||
347 | |||
348 | Set the number of rounds used in RC2: | ||
349 | |||
350 | int nrounds; | ||
351 | EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC2_KEY_BITS, i, NULL); | ||
352 | |||
353 | =head1 SEE ALSO | ||
354 | |||
355 | L<evp(3)|evp(3)> | ||
356 | |||
357 | =head1 HISTORY | ||
358 | |||
359 | =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_SealInit.pod b/src/lib/libcrypto/doc/EVP_SealInit.pod deleted file mode 100644 index 0451eb648a..0000000000 --- a/src/lib/libcrypto/doc/EVP_SealInit.pod +++ /dev/null | |||
@@ -1,76 +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, EVP_CIPHER *type, unsigned char **ek, | ||
12 | int *ekl, unsigned char *iv,EVP_PKEY **pubk, int npubk); | ||
13 | int EVP_SealUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
14 | int *outl, unsigned char *in, int inl); | ||
15 | int EVP_SealFinal(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 | encryption. They generate a random key and then "envelope" it by | ||
22 | using public key encryption. Data can then be encrypted using this | ||
23 | key. | ||
24 | |||
25 | EVP_SealInit() initializes a cipher context B<ctx> for encryption | ||
26 | with cipher B<type> using a random secret key and IV supplied in | ||
27 | the B<iv> parameter. B<type> is normally supplied by a function such | ||
28 | as EVP_des_cbc(). The secret key is encrypted using one or more public | ||
29 | keys, this allows the same encrypted data to be decrypted using any | ||
30 | of the corresponding private keys. B<ek> is an array of buffers where | ||
31 | the public key encrypted secret key will be written, each buffer must | ||
32 | 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 | EVP_SealUpdate() and EVP_SealFinal() have exactly the same properties | ||
38 | as the EVP_EncryptUpdate() and EVP_EncryptFinal() routines, as | ||
39 | documented on the L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> manual | ||
40 | page. | ||
41 | |||
42 | =head1 RETURN VALUES | ||
43 | |||
44 | EVP_SealInit() returns 0 on error or B<npubk> if successful. | ||
45 | |||
46 | EVP_SealUpdate() and EVP_SealFinal() return 1 for success and 0 for | ||
47 | failure. | ||
48 | |||
49 | =head1 NOTES | ||
50 | |||
51 | Because a random secret key is generated the random number generator | ||
52 | must be seeded before calling EVP_SealInit(). | ||
53 | |||
54 | The public key must be RSA because it is the only OpenSSL public key | ||
55 | algorithm that supports key transport. | ||
56 | |||
57 | Envelope encryption is the usual method of using public key encryption | ||
58 | on large amounts of data, this is because public key encryption is slow | ||
59 | but symmetric encryption is fast. So symmetric encryption is used for | ||
60 | bulk encryption and the small random symmetric key used is transferred | ||
61 | using public key encryption. | ||
62 | |||
63 | It is possible to call EVP_SealInit() twice in the same way as | ||
64 | EVP_EncryptInit(). The first call should have B<npubk> set to 0 | ||
65 | and (after setting any cipher parameters) it should be called again | ||
66 | with B<type> set to NULL. | ||
67 | |||
68 | =head1 SEE ALSO | ||
69 | |||
70 | L<evp(3)|evp(3)>, L<rand(3)|rand(3)>, | ||
71 | L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>, | ||
72 | L<EVP_OpenInit(3)|EVP_OpenInit(3)> | ||
73 | |||
74 | =head1 HISTORY | ||
75 | |||
76 | =cut | ||
diff --git a/src/lib/libcrypto/doc/EVP_SignInit.pod b/src/lib/libcrypto/doc/EVP_SignInit.pod deleted file mode 100644 index d5ce245ecd..0000000000 --- a/src/lib/libcrypto/doc/EVP_SignInit.pod +++ /dev/null | |||
@@ -1,85 +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 | void EVP_SignInit(EVP_MD_CTX *ctx, const EVP_MD *type); | ||
12 | void 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 | int EVP_PKEY_size(EVP_PKEY *pkey); | ||
16 | |||
17 | =head1 DESCRIPTION | ||
18 | |||
19 | The EVP signature routines are a high level interface to digital | ||
20 | signatures. | ||
21 | |||
22 | EVP_SignInit() initializes a signing context B<ctx> to using digest | ||
23 | B<type>: this will typically be supplied by a function such as | ||
24 | EVP_sha1(). | ||
25 | |||
26 | EVP_SignUpdate() hashes B<cnt> bytes of data at B<d> into the | ||
27 | signature context B<ctx>. This function can be called several times on the | ||
28 | same B<ctx> to include additional data. | ||
29 | |||
30 | EVP_SignFinal() signs the data in B<ctx> using the private key B<pkey> | ||
31 | and places the signature in B<sig>. If the B<s> parameter is not NULL | ||
32 | then the number of bytes of data written (i.e. the length of the signature) | ||
33 | will be written to the integer at B<s>, at most EVP_PKEY_size(pkey) bytes | ||
34 | will be written. After calling EVP_SignFinal() no additional calls to | ||
35 | EVP_SignUpdate() can be made, but EVP_SignInit() can be called to initialize | ||
36 | a new signature operation. | ||
37 | |||
38 | EVP_PKEY_size() returns the maximum size of a signature in bytes. The actual | ||
39 | signature returned by EVP_SignFinal() may be smaller. | ||
40 | |||
41 | =head1 RETURN VALUES | ||
42 | |||
43 | EVP_SignInit() and EVP_SignUpdate() do not return values. | ||
44 | |||
45 | EVP_SignFinal() returns 1 for success and 0 for failure. | ||
46 | |||
47 | EVP_PKEY_size() returns the maximum size of a signature in bytes. | ||
48 | |||
49 | The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
50 | |||
51 | =head1 NOTES | ||
52 | |||
53 | The B<EVP> interface to digital signatures should almost always be used in | ||
54 | preference to the low level interfaces. This is because the code then becomes | ||
55 | transparent to the algorithm used and much more flexible. | ||
56 | |||
57 | Due to the link between message digests and public key algorithms the correct | ||
58 | digest algorithm must be used with the correct public key type. A list of | ||
59 | algorithms and associated public key algorithms appears in | ||
60 | L<EVP_DigestInit(3)|EVP_DigestInit(3)>. | ||
61 | |||
62 | When signing with DSA private keys the random number generator must be seeded | ||
63 | or the operation will fail. The random number generator does not need to be | ||
64 | seeded for RSA signatures. | ||
65 | |||
66 | =head1 BUGS | ||
67 | |||
68 | Several of the functions do not return values: maybe they should. Although the | ||
69 | internal digest operations will never fail some future hardware based operations | ||
70 | might. | ||
71 | |||
72 | =head1 SEE ALSO | ||
73 | |||
74 | L<EVP_VerifyInit(3)|EVP_VerifyInit(3)>, | ||
75 | L<EVP_DigestInit(3)|EVP_DigestInit(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, | ||
76 | L<evp(3)|evp(3)>, L<HMAC(3)|HMAC(3)>, L<MD2(3)|MD2(3)>, | ||
77 | L<MD5(3)|MD5(3)>, L<MDC2(3)|MDC2(3)>, L<RIPEMD(3)|RIPEMD(3)>, | ||
78 | L<SHA1(3)|SHA1(3)>, L<digest(1)|digest(1)> | ||
79 | |||
80 | =head1 HISTORY | ||
81 | |||
82 | EVP_SignInit(), EVP_SignUpdate() and EVP_SignFinal() are | ||
83 | available in all versions of SSLeay and OpenSSL. | ||
84 | |||
85 | =cut | ||
diff --git a/src/lib/libcrypto/doc/EVP_VerifyInit.pod b/src/lib/libcrypto/doc/EVP_VerifyInit.pod deleted file mode 100644 index 736a0f4a82..0000000000 --- a/src/lib/libcrypto/doc/EVP_VerifyInit.pod +++ /dev/null | |||
@@ -1,72 +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 | void EVP_VerifyInit(EVP_MD_CTX *ctx, const EVP_MD *type); | ||
12 | void 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 | =head1 DESCRIPTION | ||
16 | |||
17 | The EVP signature verification routines are a high level interface to digital | ||
18 | signatures. | ||
19 | |||
20 | EVP_VerifyInit() initializes a verification context B<ctx> to using digest | ||
21 | B<type>: this will typically be supplied by a function such as EVP_sha1(). | ||
22 | |||
23 | EVP_VerifyUpdate() hashes B<cnt> bytes of data at B<d> into the | ||
24 | verification context B<ctx>. This function can be called several times on the | ||
25 | same B<ctx> to include additional data. | ||
26 | |||
27 | EVP_VerifyFinal() verifies the data in B<ctx> using the public key B<pkey> | ||
28 | and against the B<siglen> bytes at B<sigbuf>. After calling EVP_VerifyFinal() | ||
29 | no additional calls to EVP_VerifyUpdate() can be made, but EVP_VerifyInit() | ||
30 | can be called to initialize a new verification operation. | ||
31 | |||
32 | =head1 RETURN VALUES | ||
33 | |||
34 | EVP_VerifyInit() and EVP_VerifyUpdate() do not return values. | ||
35 | |||
36 | EVP_VerifyFinal() returns 1 for a correct signature, 0 for failure and -1 if some | ||
37 | other error occurred. | ||
38 | |||
39 | The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
40 | |||
41 | =head1 NOTES | ||
42 | |||
43 | The B<EVP> interface to digital signatures should almost always be used in | ||
44 | preference to the low level interfaces. This is because the code then becomes | ||
45 | transparent to the algorithm used and much more flexible. | ||
46 | |||
47 | Due to the link between message digests and public key algorithms the correct | ||
48 | digest algorithm must be used with the correct public key type. A list of | ||
49 | algorithms and associated public key algorithms appears in | ||
50 | L<EVP_DigestInit(3)|EVP_DigestInit(3)>. | ||
51 | |||
52 | =head1 BUGS | ||
53 | |||
54 | Several of the functions do not return values: maybe they should. Although the | ||
55 | internal digest operations will never fail some future hardware based operations | ||
56 | might. | ||
57 | |||
58 | =head1 SEE ALSO | ||
59 | |||
60 | L<evp(3)|evp(3)>, | ||
61 | L<EVP_SignInit(3)|EVP_SignInit(3)>, | ||
62 | L<EVP_DigestInit(3)|EVP_DigestInit(3)>, L<err(3)|err(3)>, | ||
63 | L<evp(3)|evp(3)>, L<hmac(3)|hmac(3)>, L<md2(3)|md2(3)>, | ||
64 | L<md5(3)|md5(3)>, L<mdc2(3)|mdc2(3)>, L<ripemd(3)|ripemd(3)>, | ||
65 | L<sha(3)|sha(3)>, L<digest(1)|digest(1)> | ||
66 | |||
67 | =head1 HISTORY | ||
68 | |||
69 | EVP_VerifyInit(), EVP_VerifyUpdate() and EVP_VerifyFinal() are | ||
70 | available in all versions of SSLeay and OpenSSL. | ||
71 | |||
72 | =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 68ea723259..0000000000 --- a/src/lib/libcrypto/doc/OPENSSL_VERSION_NUMBER.pod +++ /dev/null | |||
@@ -1,88 +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 | 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 | The text variant of the version number and the release date. For example, | ||
59 | "OpenSSL 0.9.5a 1 Apr 2000". | ||
60 | |||
61 | =item SSLEAY_CFLAGS | ||
62 | The flags given to the C compiler when compiling OpenSSL are returned in a | ||
63 | string. | ||
64 | |||
65 | =item SSLEAY_PLATFORM | ||
66 | The platform name used when OpenSSL was configured is returned. | ||
67 | |||
68 | =back | ||
69 | |||
70 | If the data request isn't available, a text saying that the information is | ||
71 | not available is returned. | ||
72 | |||
73 | For an unknown B<t>, the text "not available" is returned. | ||
74 | |||
75 | =head1 RETURN VALUE | ||
76 | |||
77 | The version number. | ||
78 | |||
79 | =head1 SEE ALSO | ||
80 | |||
81 | L<crypto(3)|crypto(3)> | ||
82 | |||
83 | =head1 HISTORY | ||
84 | |||
85 | SSLeay() and SSLEAY_VERSION_NUMBER are available in all versions of SSLeay and OpenSSL. | ||
86 | OPENSSL_VERSION_NUMBER is available in all versions of OpenSSL. | ||
87 | |||
88 | =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/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 b03748b918..0000000000 --- a/src/lib/libcrypto/doc/RAND_bytes.pod +++ /dev/null | |||
@@ -1,46 +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)>, L<RAND_add(3)|RAND_add(3)> | ||
39 | |||
40 | =head1 HISTORY | ||
41 | |||
42 | RAND_bytes() is available in all versions of SSLeay and OpenSSL. It | ||
43 | has a return value since OpenSSL 0.9.5. RAND_pseudo_bytes() was added | ||
44 | in OpenSSL 0.9.5. | ||
45 | |||
46 | =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 464eba416d..0000000000 --- a/src/lib/libcrypto/doc/RAND_set_rand_method.pod +++ /dev/null | |||
@@ -1,59 +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(RAND_METHOD *meth); | ||
12 | |||
13 | 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 | ||
20 | number generation. By modifying the method, alternative | ||
21 | implementations such as hardware RNGs may be used. Initially, the | ||
22 | default is to use the OpenSSL internal implementation. RAND_SSLeay() | ||
23 | returns a pointer to that method. | ||
24 | |||
25 | RAND_set_rand_method() sets the RAND method to B<meth>. | ||
26 | RAND_get_rand_method() returns a pointer to the current method. | ||
27 | |||
28 | =head1 THE RAND_METHOD STRUCTURE | ||
29 | |||
30 | typedef struct rand_meth_st | ||
31 | { | ||
32 | void (*seed)(const void *buf, int num); | ||
33 | int (*bytes)(unsigned char *buf, int num); | ||
34 | void (*cleanup)(void); | ||
35 | void (*add)(const void *buf, int num, int entropy); | ||
36 | int (*pseudorand)(unsigned char *buf, int num); | ||
37 | int (*status)(void); | ||
38 | } RAND_METHOD; | ||
39 | |||
40 | The components point to the implementation of RAND_seed(), | ||
41 | RAND_bytes(), RAND_cleanup(), RAND_add(), RAND_pseudo_rand() | ||
42 | and RAND_status(). | ||
43 | Each component may be NULL if the function is not implemented. | ||
44 | |||
45 | =head1 RETURN VALUES | ||
46 | |||
47 | RAND_set_rand_method() returns no value. RAND_get_rand_method() and | ||
48 | RAND_SSLeay() return pointers to the respective methods. | ||
49 | |||
50 | =head1 SEE ALSO | ||
51 | |||
52 | L<rand(3)|rand(3)> | ||
53 | |||
54 | =head1 HISTORY | ||
55 | |||
56 | RAND_set_rand_method(), RAND_get_rand_method() and RAND_SSLeay() are | ||
57 | available in all versions of OpenSSL. | ||
58 | |||
59 | =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 1db6d736ab..0000000000 --- a/src/lib/libcrypto/doc/RSA_check_key.pod +++ /dev/null | |||
@@ -1,39 +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 | The key's public components may not be B<NULL>. | ||
22 | |||
23 | =head1 RETURN VALUE | ||
24 | |||
25 | RSA_check_key() returns 1 if B<rsa> is a valid RSA key, and 0 otherwise. | ||
26 | -1 is returned if an error occurs while checking the key. | ||
27 | |||
28 | If the key is invalid or an error occurred, the reason code can be | ||
29 | obtained using L<ERR_get_error(3)|ERR_get_error(3)>. | ||
30 | |||
31 | =head1 SEE ALSO | ||
32 | |||
33 | L<rsa(3)|rsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)> | ||
34 | |||
35 | =head1 HISTORY | ||
36 | |||
37 | RSA_check() appeared in OpenSSL 0.9.4. | ||
38 | |||
39 | =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 0e0f0a764c..0000000000 --- a/src/lib/libcrypto/doc/RSA_generate_key.pod +++ /dev/null | |||
@@ -1,68 +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 or 65535. | ||
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)>, L<RSA_free(3)|RSA_free(3)> | ||
63 | |||
64 | =head1 HISTORY | ||
65 | |||
66 | The B<cb_arg> argument was added in SSLeay 0.9.0. | ||
67 | |||
68 | =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 299047f31f..0000000000 --- a/src/lib/libcrypto/doc/RSA_new.pod +++ /dev/null | |||
@@ -1,39 +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. | ||
18 | |||
19 | RSA_free() frees the B<RSA> structure and its components. The key is | ||
20 | erased before the memory is returned to the system. | ||
21 | |||
22 | =head1 RETURN VALUES | ||
23 | |||
24 | If the allocation fails, RSA_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 | RSA_free() returns no value. | ||
29 | |||
30 | =head1 SEE ALSO | ||
31 | |||
32 | L<ERR_get_error(3)|ERR_get_error(3)>, L<rsa(3)|rsa(3)>, | ||
33 | L<RSA_generate_key(3)|RSA_generate_key(3)> | ||
34 | |||
35 | =head1 HISTORY | ||
36 | |||
37 | RSA_new() and RSA_free() are available in all versions of SSLeay and OpenSSL. | ||
38 | |||
39 | =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 67876facc5..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, DHparams_print, DHparams_print_fp, DSA_print, | ||
6 | DSA_print_fp, DHparams_print, DHparams_print_fp - print cryptographic | ||
7 | 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_pf() 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 0d1b2bd541..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)>, L<RSA_sign(3)|RSA_sign(3)>, | ||
63 | 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 23861c0004..0000000000 --- a/src/lib/libcrypto/doc/RSA_public_encrypt.pod +++ /dev/null | |||
@@ -1,86 +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, and less than RSA_size(B<rsa>) - 41 for | ||
51 | RSA_PKCS1_OAEP_PADDING. The random number generator must be seeded | ||
52 | prior to calling RSA_public_encrypt(). | ||
53 | |||
54 | RSA_private_decrypt() decrypts the B<flen> bytes at B<from> using the | ||
55 | private key B<rsa> and stores the plaintext in B<to>. B<to> must point | ||
56 | to a memory section large enough to hold the decrypted data (which is | ||
57 | smaller than RSA_size(B<rsa>)). B<padding> is the padding mode that | ||
58 | was used to encrypt the data. | ||
59 | |||
60 | =head1 RETURN VALUES | ||
61 | |||
62 | RSA_public_encrypt() returns the size of the encrypted data (i.e., | ||
63 | RSA_size(B<rsa>)). RSA_private_decrypt() returns the size of the | ||
64 | recovered plaintext. | ||
65 | |||
66 | On error, -1 is returned; the error codes can be | ||
67 | obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
68 | |||
69 | =head1 CONFORMING TO | ||
70 | |||
71 | SSL, PKCS #1 v2.0 | ||
72 | |||
73 | =head1 SEE ALSO | ||
74 | |||
75 | L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, L<RSA_size(3)|RSA_size(3)> | ||
76 | |||
77 | =head1 NOTES | ||
78 | |||
79 | The L<RSA_PKCS1_RSAref(3)|RSA_PKCS1_RSAref(3)> method supports only the RSA_PKCS1_PADDING mode. | ||
80 | |||
81 | =head1 HISTORY | ||
82 | |||
83 | The B<padding> argument was added in SSLeay 0.8. RSA_NO_PADDING is | ||
84 | available since SSLeay 0.9.0, OAEP was added in OpenSSL 0.9.2b. | ||
85 | |||
86 | =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 b672712292..0000000000 --- a/src/lib/libcrypto/doc/RSA_set_method.pod +++ /dev/null | |||
@@ -1,168 +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_PKCS1_RSAref, | ||
7 | RSA_null_method, RSA_flags, RSA_new_method - select RSA method | ||
8 | |||
9 | =head1 SYNOPSIS | ||
10 | |||
11 | #include <openssl/rsa.h> | ||
12 | #include <openssl/engine.h> | ||
13 | |||
14 | void RSA_set_default_openssl_method(RSA_METHOD *meth); | ||
15 | |||
16 | RSA_METHOD *RSA_get_default_openssl_method(void); | ||
17 | |||
18 | RSA_METHOD *RSA_set_method(RSA *rsa, ENGINE *engine); | ||
19 | |||
20 | RSA_METHOD *RSA_get_method(RSA *rsa); | ||
21 | |||
22 | RSA_METHOD *RSA_PKCS1_SSLeay(void); | ||
23 | |||
24 | RSA_METHOD *RSA_PKCS1_RSAref(void); | ||
25 | |||
26 | RSA_METHOD *RSA_null_method(void); | ||
27 | |||
28 | int RSA_flags(RSA *rsa); | ||
29 | |||
30 | RSA *RSA_new_method(ENGINE *engine); | ||
31 | |||
32 | =head1 DESCRIPTION | ||
33 | |||
34 | An B<RSA_METHOD> specifies the functions that OpenSSL uses for RSA | ||
35 | operations. By modifying the method, alternative implementations | ||
36 | such as hardware accelerators may be used. | ||
37 | |||
38 | Initially, the default is to use the OpenSSL internal implementation, | ||
39 | unless OpenSSL was configured with the C<rsaref> or C<-DRSA_NULL> | ||
40 | options. RSA_PKCS1_SSLeay() returns a pointer to that method. | ||
41 | |||
42 | RSA_PKCS1_RSAref() returns a pointer to a method that uses the RSAref | ||
43 | library. This is the default method in the C<rsaref> configuration; | ||
44 | the function is not available in other configurations. | ||
45 | RSA_null_method() returns a pointer to a method that does not support | ||
46 | the RSA transformation. It is the default if OpenSSL is compiled with | ||
47 | C<-DRSA_NULL>. These methods may be useful in the USA because of a | ||
48 | patent on the RSA cryptosystem. | ||
49 | |||
50 | RSA_set_default_openssl_method() makes B<meth> the default method for all B<RSA> | ||
51 | structures created later. B<NB:> This is true only whilst the default engine | ||
52 | for RSA operations remains as "openssl". ENGINEs provide an | ||
53 | encapsulation for implementations of one or more algorithms at a time, and all | ||
54 | the RSA functions mentioned here operate within the scope of the default | ||
55 | "openssl" engine. | ||
56 | |||
57 | RSA_get_default_openssl_method() returns a pointer to the current default | ||
58 | method for the "openssl" engine. | ||
59 | |||
60 | RSA_set_method() selects B<engine> for all operations using the key | ||
61 | B<rsa>. | ||
62 | |||
63 | RSA_get_method() returns a pointer to the RSA_METHOD from the currently | ||
64 | selected ENGINE for B<rsa>. | ||
65 | |||
66 | RSA_flags() returns the B<flags> that are set for B<rsa>'s current method. | ||
67 | |||
68 | RSA_new_method() allocates and initializes an RSA structure so that | ||
69 | B<engine> will be used for the RSA operations. If B<engine> is NULL, | ||
70 | the default engine for RSA operations is used. | ||
71 | |||
72 | =head1 THE RSA_METHOD STRUCTURE | ||
73 | |||
74 | typedef struct rsa_meth_st | ||
75 | { | ||
76 | /* name of the implementation */ | ||
77 | const char *name; | ||
78 | |||
79 | /* encrypt */ | ||
80 | int (*rsa_pub_enc)(int flen, unsigned char *from, | ||
81 | unsigned char *to, RSA *rsa, int padding); | ||
82 | |||
83 | /* verify arbitrary data */ | ||
84 | int (*rsa_pub_dec)(int flen, unsigned char *from, | ||
85 | unsigned char *to, RSA *rsa, int padding); | ||
86 | |||
87 | /* sign arbitrary data */ | ||
88 | int (*rsa_priv_enc)(int flen, unsigned char *from, | ||
89 | unsigned char *to, RSA *rsa, int padding); | ||
90 | |||
91 | /* decrypt */ | ||
92 | int (*rsa_priv_dec)(int flen, unsigned char *from, | ||
93 | unsigned char *to, RSA *rsa, int padding); | ||
94 | |||
95 | /* compute r0 = r0 ^ I mod rsa->n (May be NULL for some | ||
96 | implementations) */ | ||
97 | int (*rsa_mod_exp)(BIGNUM *r0, BIGNUM *I, RSA *rsa); | ||
98 | |||
99 | /* compute r = a ^ p mod m (May be NULL for some implementations) */ | ||
100 | int (*bn_mod_exp)(BIGNUM *r, BIGNUM *a, const BIGNUM *p, | ||
101 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); | ||
102 | |||
103 | /* called at RSA_new */ | ||
104 | int (*init)(RSA *rsa); | ||
105 | |||
106 | /* called at RSA_free */ | ||
107 | int (*finish)(RSA *rsa); | ||
108 | |||
109 | /* RSA_FLAG_EXT_PKEY - rsa_mod_exp is called for private key | ||
110 | * operations, even if p,q,dmp1,dmq1,iqmp | ||
111 | * are NULL | ||
112 | * RSA_FLAG_SIGN_VER - enable rsa_sign and rsa_verify | ||
113 | * RSA_METHOD_FLAG_NO_CHECK - don't check pub/private match | ||
114 | */ | ||
115 | int flags; | ||
116 | |||
117 | char *app_data; /* ?? */ | ||
118 | |||
119 | /* sign. For backward compatibility, this is used only | ||
120 | * if (flags & RSA_FLAG_SIGN_VER) | ||
121 | */ | ||
122 | int (*rsa_sign)(int type, unsigned char *m, unsigned int m_len, | ||
123 | unsigned char *sigret, unsigned int *siglen, RSA *rsa); | ||
124 | |||
125 | /* verify. For backward compatibility, this is used only | ||
126 | * if (flags & RSA_FLAG_SIGN_VER) | ||
127 | */ | ||
128 | int (*rsa_verify)(int type, unsigned char *m, unsigned int m_len, | ||
129 | unsigned char *sigbuf, unsigned int siglen, RSA *rsa); | ||
130 | |||
131 | } RSA_METHOD; | ||
132 | |||
133 | =head1 RETURN VALUES | ||
134 | |||
135 | RSA_PKCS1_SSLeay(), RSA_PKCS1_RSAref(), RSA_PKCS1_null_method(), | ||
136 | RSA_get_default_openssl_method() and RSA_get_method() return pointers to | ||
137 | the respective RSA_METHODs. | ||
138 | |||
139 | RSA_set_default_openssl_method() returns no value. | ||
140 | |||
141 | RSA_set_method() selects B<engine> as the engine that will be responsible for | ||
142 | all operations using the structure B<rsa>. If this function completes successfully, | ||
143 | then the B<rsa> structure will have its own functional reference of B<engine>, so | ||
144 | the caller should remember to free their own reference to B<engine> when they are | ||
145 | finished with it. NB: An ENGINE's RSA_METHOD can be retrieved (or set) by | ||
146 | ENGINE_get_RSA() or ENGINE_set_RSA(). | ||
147 | |||
148 | RSA_new_method() returns NULL and sets an error code that can be | ||
149 | obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise | ||
150 | it returns a pointer to the newly allocated structure. | ||
151 | |||
152 | =head1 SEE ALSO | ||
153 | |||
154 | L<rsa(3)|rsa(3)>, L<RSA_new(3)|RSA_new(3)> | ||
155 | |||
156 | =head1 HISTORY | ||
157 | |||
158 | RSA_new_method() and RSA_set_default_method() appeared in SSLeay 0.8. | ||
159 | RSA_get_default_method(), RSA_set_method() and RSA_get_method() as | ||
160 | well as the rsa_sign and rsa_verify components of RSA_METHOD were | ||
161 | added in OpenSSL 0.9.4. | ||
162 | |||
163 | RSA_set_default_openssl_method() and RSA_get_default_openssl_method() | ||
164 | replaced RSA_set_default_method() and RSA_get_default_method() respectively, | ||
165 | and RSA_set_method() and RSA_new_method() were altered to use B<ENGINE>s | ||
166 | rather than B<DH_METHOD>s during development of OpenSSL 0.9.6. | ||
167 | |||
168 | =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 b8c7bbb7e3..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)>, L<rand(3)|rand(3)>, | ||
51 | 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 b36b4d58d5..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(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/bn.pod b/src/lib/libcrypto/doc/bn.pod deleted file mode 100644 index d183028d61..0000000000 --- a/src/lib/libcrypto/doc/bn.pod +++ /dev/null | |||
@@ -1,149 +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 | int BN_num_bytes(const BIGNUM *a); | ||
25 | int BN_num_bits(const BIGNUM *a); | ||
26 | int BN_num_bits_word(BN_ULONG w); | ||
27 | |||
28 | int BN_add(BIGNUM *r, BIGNUM *a, BIGNUM *b); | ||
29 | int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); | ||
30 | int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); | ||
31 | int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *a, const BIGNUM *d, | ||
32 | BN_CTX *ctx); | ||
33 | int BN_sqr(BIGNUM *r, BIGNUM *a, BN_CTX *ctx); | ||
34 | int BN_mod(BIGNUM *rem, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); | ||
35 | int BN_mod_mul(BIGNUM *ret, BIGNUM *a, BIGNUM *b, const BIGNUM *m, | ||
36 | BN_CTX *ctx); | ||
37 | int BN_exp(BIGNUM *r, BIGNUM *a, BIGNUM *p, BN_CTX *ctx); | ||
38 | int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, | ||
39 | const BIGNUM *m, BN_CTX *ctx); | ||
40 | int BN_gcd(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); | ||
41 | |||
42 | int BN_add_word(BIGNUM *a, BN_ULONG w); | ||
43 | int BN_sub_word(BIGNUM *a, BN_ULONG w); | ||
44 | int BN_mul_word(BIGNUM *a, BN_ULONG w); | ||
45 | BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w); | ||
46 | BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w); | ||
47 | |||
48 | int BN_cmp(BIGNUM *a, BIGNUM *b); | ||
49 | int BN_ucmp(BIGNUM *a, BIGNUM *b); | ||
50 | int BN_is_zero(BIGNUM *a); | ||
51 | int BN_is_one(BIGNUM *a); | ||
52 | int BN_is_word(BIGNUM *a, BN_ULONG w); | ||
53 | int BN_is_odd(BIGNUM *a); | ||
54 | |||
55 | int BN_zero(BIGNUM *a); | ||
56 | int BN_one(BIGNUM *a); | ||
57 | BIGNUM *BN_value_one(void); | ||
58 | int BN_set_word(BIGNUM *a, unsigned long w); | ||
59 | unsigned long BN_get_word(BIGNUM *a); | ||
60 | |||
61 | int BN_rand(BIGNUM *rnd, int bits, int top, int bottom); | ||
62 | int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom); | ||
63 | int BN_rand_range(BIGNUM *rnd, BIGNUM *range); | ||
64 | |||
65 | BIGNUM *BN_generate_prime(BIGNUM *ret, int bits,int safe, BIGNUM *add, | ||
66 | BIGNUM *rem, void (*callback)(int, int, void *), void *cb_arg); | ||
67 | int BN_is_prime(const BIGNUM *p, int nchecks, | ||
68 | void (*callback)(int, int, void *), BN_CTX *ctx, void *cb_arg); | ||
69 | |||
70 | int BN_set_bit(BIGNUM *a, int n); | ||
71 | int BN_clear_bit(BIGNUM *a, int n); | ||
72 | int BN_is_bit_set(const BIGNUM *a, int n); | ||
73 | int BN_mask_bits(BIGNUM *a, int n); | ||
74 | int BN_lshift(BIGNUM *r, const BIGNUM *a, int n); | ||
75 | int BN_lshift1(BIGNUM *r, BIGNUM *a); | ||
76 | int BN_rshift(BIGNUM *r, BIGNUM *a, int n); | ||
77 | int BN_rshift1(BIGNUM *r, BIGNUM *a); | ||
78 | |||
79 | int BN_bn2bin(const BIGNUM *a, unsigned char *to); | ||
80 | BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret); | ||
81 | char *BN_bn2hex(const BIGNUM *a); | ||
82 | char *BN_bn2dec(const BIGNUM *a); | ||
83 | int BN_hex2bn(BIGNUM **a, const char *str); | ||
84 | int BN_dec2bn(BIGNUM **a, const char *str); | ||
85 | int BN_print(BIO *fp, const BIGNUM *a); | ||
86 | int BN_print_fp(FILE *fp, const BIGNUM *a); | ||
87 | int BN_bn2mpi(const BIGNUM *a, unsigned char *to); | ||
88 | BIGNUM *BN_mpi2bn(unsigned char *s, int len, BIGNUM *ret); | ||
89 | |||
90 | BIGNUM *BN_mod_inverse(BIGNUM *r, BIGNUM *a, const BIGNUM *n, | ||
91 | BN_CTX *ctx); | ||
92 | |||
93 | BN_RECP_CTX *BN_RECP_CTX_new(void); | ||
94 | void BN_RECP_CTX_init(BN_RECP_CTX *recp); | ||
95 | void BN_RECP_CTX_free(BN_RECP_CTX *recp); | ||
96 | int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *m, BN_CTX *ctx); | ||
97 | int BN_mod_mul_reciprocal(BIGNUM *r, BIGNUM *a, BIGNUM *b, | ||
98 | BN_RECP_CTX *recp, BN_CTX *ctx); | ||
99 | |||
100 | BN_MONT_CTX *BN_MONT_CTX_new(void); | ||
101 | void BN_MONT_CTX_init(BN_MONT_CTX *ctx); | ||
102 | void BN_MONT_CTX_free(BN_MONT_CTX *mont); | ||
103 | int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *m, BN_CTX *ctx); | ||
104 | BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from); | ||
105 | int BN_mod_mul_montgomery(BIGNUM *r, BIGNUM *a, BIGNUM *b, | ||
106 | BN_MONT_CTX *mont, BN_CTX *ctx); | ||
107 | int BN_from_montgomery(BIGNUM *r, BIGNUM *a, BN_MONT_CTX *mont, | ||
108 | BN_CTX *ctx); | ||
109 | int BN_to_montgomery(BIGNUM *r, BIGNUM *a, BN_MONT_CTX *mont, | ||
110 | BN_CTX *ctx); | ||
111 | |||
112 | |||
113 | =head1 DESCRIPTION | ||
114 | |||
115 | This library performs arithmetic operations on integers of arbitrary | ||
116 | size. It was written for use in public key cryptography, such as RSA | ||
117 | and Diffie-Hellman. | ||
118 | |||
119 | It uses dynamic memory allocation for storing its data structures. | ||
120 | That means that there is no limit on the size of the numbers | ||
121 | manipulated by these functions, but return values must always be | ||
122 | checked in case a memory allocation error has occurred. | ||
123 | |||
124 | The basic object in this library is a B<BIGNUM>. It is used to hold a | ||
125 | single large integer. This type should be considered opaque and fields | ||
126 | should not be modified or accessed directly. | ||
127 | |||
128 | The creation of B<BIGNUM> objects is described in L<BN_new(3)|BN_new(3)>; | ||
129 | L<BN_add(3)|BN_add(3)> describes most of the arithmetic operations. | ||
130 | Comparison is described in L<BN_cmp(3)|BN_cmp(3)>; L<BN_zero(3)|BN_zero(3)> | ||
131 | describes certain assignments, L<BN_rand(3)|BN_rand(3)> the generation of | ||
132 | random numbers, L<BN_generate_prime(3)|BN_generate_prime(3)> deals with prime | ||
133 | numbers and L<BN_set_bit(3)|BN_set_bit(3)> with bit operations. The conversion | ||
134 | of B<BIGNUM>s to external formats is described in L<BN_bn2bin(3)|BN_bn2bin(3)>. | ||
135 | |||
136 | =head1 SEE ALSO | ||
137 | |||
138 | L<bn_internal(3)|bn_internal(3)>, | ||
139 | L<dh(3)|dh(3)>, L<err(3)|err(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, | ||
140 | L<BN_new(3)|BN_new(3)>, L<BN_CTX_new(3)|BN_CTX_new(3)>, | ||
141 | L<BN_copy(3)|BN_copy(3)>, L<BN_num_bytes(3)|BN_num_bytes(3)>, | ||
142 | L<BN_add(3)|BN_add(3)>, L<BN_add_word(3)|BN_add_word(3)>, | ||
143 | L<BN_cmp(3)|BN_cmp(3)>, L<BN_zero(3)|BN_zero(3)>, L<BN_rand(3)|BN_rand(3)>, | ||
144 | L<BN_generate_prime(3)|BN_generate_prime(3)>, L<BN_set_bit(3)|BN_set_bit(3)>, | ||
145 | L<BN_bn2bin(3)|BN_bn2bin(3)>, L<BN_mod_inverse(3)|BN_mod_inverse(3)>, | ||
146 | L<BN_mod_mul_reciprocal(3)|BN_mod_mul_reciprocal(3)>, | ||
147 | L<BN_mod_mul_montgomery(3)|BN_mod_mul_montgomery(3)> | ||
148 | |||
149 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_DHparams.pod b/src/lib/libcrypto/doc/d2i_DHparams.pod deleted file mode 100644 index a6d1743d39..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 - ... | ||
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 | ... | ||
17 | |||
18 | =head1 RETURN VALUES | ||
19 | |||
20 | ... | ||
21 | |||
22 | =head1 SEE ALSO | ||
23 | |||
24 | ... | ||
25 | |||
26 | =head1 HISTORY | ||
27 | |||
28 | ... | ||
29 | |||
30 | =cut | ||
diff --git a/src/lib/libcrypto/doc/d2i_RSAPublicKey.pod b/src/lib/libcrypto/doc/d2i_RSAPublicKey.pod deleted file mode 100644 index ff4d0d57db..0000000000 --- a/src/lib/libcrypto/doc/d2i_RSAPublicKey.pod +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | d2i_RSAPublicKey, i2d_RSAPublicKey, d2i_RSAPrivateKey, i2d_RSAPrivateKey, i2d_Netscape_RSA, d2i_Netscape_RSA - ... | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/rsa.h> | ||
10 | |||
11 | RSA * d2i_RSAPublicKey(RSA **a, unsigned char **pp, long length); | ||
12 | |||
13 | int i2d_RSAPublicKey(RSA *a, unsigned char **pp); | ||
14 | |||
15 | RSA * d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length); | ||
16 | |||
17 | int i2d_RSAPrivateKey(RSA *a, unsigned char **pp); | ||
18 | |||
19 | int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)()); | ||
20 | |||
21 | RSA * d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)()); | ||
22 | |||
23 | =head1 DESCRIPTION | ||
24 | |||
25 | ... | ||
26 | |||
27 | =head1 RETURN VALUES | ||
28 | |||
29 | ... | ||
30 | |||
31 | =head1 SEE ALSO | ||
32 | |||
33 | ... | ||
34 | |||
35 | =head1 HISTORY | ||
36 | |||
37 | ... | ||
38 | |||
39 | =cut | ||
diff --git a/src/lib/libcrypto/doc/dh.pod b/src/lib/libcrypto/doc/dh.pod deleted file mode 100644 index b4be4be405..0000000000 --- a/src/lib/libcrypto/doc/dh.pod +++ /dev/null | |||
@@ -1,69 +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(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(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_openssl_method(DH_METHOD *meth); | ||
25 | DH_METHOD *DH_get_default_openssl_method(void); | ||
26 | int DH_set_method(DH *dh, ENGINE *engine); | ||
27 | DH *DH_new_method(ENGINE *engine); | ||
28 | 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(DH *a, unsigned char **pp); | ||
37 | |||
38 | int DHparams_print_fp(FILE *fp, DH *x); | ||
39 | int DHparams_print(BIO *bp, 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 | =head1 SEE ALSO | ||
61 | |||
62 | L<dhparam(1)|dhparam(1)>, L<bn(3)|bn(3)>, L<dsa(3)|dsa(3)>, L<err(3)|err(3)>, | ||
63 | L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, L<DH_set_method(3)|DH_set_method(3)>, | ||
64 | L<DH_new(3)|DH_new(3)>, L<DH_get_ex_new_index(3)|DH_get_ex_new_index(3)>, | ||
65 | L<DH_generate_parameters(3)|DH_generate_parameters(3)>, | ||
66 | L<DH_compute_key(3)|DH_compute_key(3)>, L<d2i_DHparams(3)|d2i_DHparams(3)>, | ||
67 | L<RSA_print(3)|RSA_print(3)> | ||
68 | |||
69 | =cut | ||
diff --git a/src/lib/libcrypto/doc/dsa.pod b/src/lib/libcrypto/doc/dsa.pod deleted file mode 100644 index 573500204b..0000000000 --- a/src/lib/libcrypto/doc/dsa.pod +++ /dev/null | |||
@@ -1,105 +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(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(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 | unsigned char *sigbuf, int siglen, DSA *dsa); | ||
31 | |||
32 | void DSA_set_default_openssl_method(DSA_METHOD *meth); | ||
33 | DSA_METHOD *DSA_get_default_openssl_method(void); | ||
34 | int DSA_set_method(DSA *dsa, ENGINE *engine); | ||
35 | DSA *DSA_new_method(ENGINE *engine); | ||
36 | 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(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(DSA *a, unsigned char **pp); | ||
56 | int i2d_DSAPrivateKey(DSA *a, unsigned char **pp); | ||
57 | int i2d_DSAparams(DSA *a,unsigned char **pp); | ||
58 | |||
59 | int DSAparams_print(BIO *bp, DSA *x); | ||
60 | int DSAparams_print_fp(FILE *fp, DSA *x); | ||
61 | int DSA_print(BIO *bp, DSA *x, int off); | ||
62 | int DSA_print_fp(FILE *bp, 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 | =head1 CONFORMING TO | ||
89 | |||
90 | US Federal Information Processing Standard FIPS 186 (Digital Signature | ||
91 | Standard, DSS), ANSI X9.30 | ||
92 | |||
93 | =head1 SEE ALSO | ||
94 | |||
95 | L<bn(3)|bn(3)>, L<dh(3)|dh(3)>, L<err(3)|err(3)>, L<rand(3)|rand(3)>, | ||
96 | L<rsa(3)|rsa(3)>, L<SHA1(3)|SHA1(3)>, L<DSA_new(3)|DSA_new(3)>, | ||
97 | L<DSA_size(3)|DSA_size(3)>, | ||
98 | L<DSA_generate_parameters(3)|DSA_generate_parameters(3)>, | ||
99 | L<DSA_dup_DH(3)|DSA_dup_DH(3)>, | ||
100 | L<DSA_generate_key(3)|DSA_generate_key(3)>, | ||
101 | L<DSA_sign(3)|DSA_sign(3)>, L<DSA_set_method(3)|DSA_set_method(3)>, | ||
102 | L<DSA_get_ex_new_index(3)|DSA_get_ex_new_index(3)>, | ||
103 | L<RSA_print(3)|RSA_print(3)> | ||
104 | |||
105 | =cut | ||
diff --git a/src/lib/libcrypto/doc/evp.pod b/src/lib/libcrypto/doc/evp.pod deleted file mode 100644 index edf47dbde6..0000000000 --- a/src/lib/libcrypto/doc/evp.pod +++ /dev/null | |||
@@ -1,37 +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 | =head1 SEE ALSO | ||
28 | |||
29 | L<EVP_DigestInit(3)|EVP_DigestInit(3)>, | ||
30 | L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>, | ||
31 | L<EVP_OpenInit(3)|EVP_OpenInit(3)>, | ||
32 | L<EVP_SealInit(3)|EVP_SealInit(3)>, | ||
33 | L<EVP_SignInit(3)|EVP_SignInit(3)>, | ||
34 | L<EVP_VerifyInit(3)|EVP_VerifyInit(3)>, | ||
35 | L<OpenSSL_add_all_algorithms(3)|OpenSSL_add_all_algorithms(3)> | ||
36 | |||
37 | =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 ef0d4df205..0000000000 --- a/src/lib/libcrypto/doc/rsa.pod +++ /dev/null | |||
@@ -1,117 +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 | |||
20 | int RSA_sign(int type, unsigned char *m, unsigned int m_len, | ||
21 | unsigned char *sigret, unsigned int *siglen, RSA *rsa); | ||
22 | int RSA_verify(int type, unsigned char *m, unsigned int m_len, | ||
23 | unsigned char *sigbuf, unsigned int siglen, RSA *rsa); | ||
24 | |||
25 | int RSA_size(RSA *rsa); | ||
26 | |||
27 | RSA *RSA_generate_key(int num, unsigned long e, | ||
28 | void (*callback)(int,int,void *), void *cb_arg); | ||
29 | |||
30 | int RSA_check_key(RSA *rsa); | ||
31 | |||
32 | int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); | ||
33 | void RSA_blinding_off(RSA *rsa); | ||
34 | |||
35 | void RSA_set_default_openssl_method(RSA_METHOD *meth); | ||
36 | RSA_METHOD *RSA_get_default_openssl_method(void); | ||
37 | int RSA_set_method(RSA *rsa, ENGINE *engine); | ||
38 | RSA_METHOD *RSA_get_method(RSA *rsa); | ||
39 | RSA_METHOD *RSA_PKCS1_SSLeay(void); | ||
40 | RSA_METHOD *RSA_PKCS1_RSAref(void); | ||
41 | RSA_METHOD *RSA_null_method(void); | ||
42 | int RSA_flags(RSA *rsa); | ||
43 | RSA *RSA_new_method(ENGINE *engine); | ||
44 | |||
45 | int RSA_print(BIO *bp, RSA *x, int offset); | ||
46 | int RSA_print_fp(FILE *fp, RSA *x, int offset); | ||
47 | |||
48 | int RSA_get_ex_new_index(long argl, char *argp, int (*new_func)(), | ||
49 | int (*dup_func)(), void (*free_func)()); | ||
50 | int RSA_set_ex_data(RSA *r,int idx,char *arg); | ||
51 | char *RSA_get_ex_data(RSA *r, int idx); | ||
52 | |||
53 | int RSA_private_encrypt(int flen, unsigned char *from, | ||
54 | unsigned char *to, RSA *rsa,int padding); | ||
55 | int RSA_public_decrypt(int flen, unsigned char *from, | ||
56 | unsigned char *to, RSA *rsa,int padding); | ||
57 | |||
58 | int RSA_sign_ASN1_OCTET_STRING(int dummy, unsigned char *m, | ||
59 | unsigned int m_len, unsigned char *sigret, unsigned int *siglen, | ||
60 | RSA *rsa); | ||
61 | int RSA_verify_ASN1_OCTET_STRING(int dummy, unsigned char *m, | ||
62 | unsigned int m_len, unsigned char *sigbuf, unsigned int siglen, | ||
63 | RSA *rsa); | ||
64 | |||
65 | =head1 DESCRIPTION | ||
66 | |||
67 | These functions implement RSA public key encryption and signatures | ||
68 | as defined in PKCS #1 v2.0 [RFC 2437]. | ||
69 | |||
70 | The B<RSA> structure consists of several BIGNUM components. It can | ||
71 | contain public as well as private RSA keys: | ||
72 | |||
73 | struct | ||
74 | { | ||
75 | BIGNUM *n; // public modulus | ||
76 | BIGNUM *e; // public exponent | ||
77 | BIGNUM *d; // private exponent | ||
78 | BIGNUM *p; // secret prime factor | ||
79 | BIGNUM *q; // secret prime factor | ||
80 | BIGNUM *dmp1; // d mod (p-1) | ||
81 | BIGNUM *dmq1; // d mod (q-1) | ||
82 | BIGNUM *iqmp; // q^-1 mod p | ||
83 | // ... | ||
84 | }; | ||
85 | RSA | ||
86 | |||
87 | In public keys, the private exponent and the related secret values are | ||
88 | B<NULL>. | ||
89 | |||
90 | B<p>, B<q>, B<dmp1>, B<dmq1> and B<iqmp> may be B<NULL> in private | ||
91 | keys, but the RSA operations are much faster when these values are | ||
92 | available. | ||
93 | |||
94 | =head1 CONFORMING TO | ||
95 | |||
96 | SSL, PKCS #1 v2.0 | ||
97 | |||
98 | =head1 PATENTS | ||
99 | |||
100 | RSA was covered by a US patent which expired in September 2000. | ||
101 | |||
102 | =head1 SEE ALSO | ||
103 | |||
104 | L<rsa(1)|rsa(1)>, L<bn(3)|bn(3)>, L<dsa(3)|dsa(3)>, L<dh(3)|dh(3)>, | ||
105 | L<rand(3)|rand(3)>, L<RSA_new(3)|RSA_new(3)>, | ||
106 | L<RSA_public_encrypt(3)|RSA_public_encrypt(3)>, | ||
107 | L<RSA_sign(3)|RSA_sign(3)>, L<RSA_size(3)|RSA_size(3)>, | ||
108 | L<RSA_generate_key(3)|RSA_generate_key(3)>, | ||
109 | L<RSA_check_key(3)|RSA_check_key(3)>, | ||
110 | L<RSA_blinding_on(3)|RSA_blinding_on(3)>, | ||
111 | L<RSA_set_method(3)|RSA_set_method(3)>, L<RSA_print(3)|RSA_print(3)>, | ||
112 | L<RSA_get_ex_new_index(3)|RSA_get_ex_new_index(3)>, | ||
113 | L<RSA_private_encrypt(3)|RSA_private_encrypt(3)>, | ||
114 | L<RSA_sign_ASN_OCTET_STRING(3)|RSA_sign_ASN_OCTET_STRING(3)>, | ||
115 | L<RSA_padding_add_PKCS1_type_1(3)|RSA_padding_add_PKCS1_type_1(3)> | ||
116 | |||
117 | =cut | ||