diff options
Diffstat (limited to 'src/lib/libcrypto/doc/DSA_set_method.pod')
| -rw-r--r-- | src/lib/libcrypto/doc/DSA_set_method.pod | 145 |
1 files changed, 0 insertions, 145 deletions
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 31f444d751..0000000000 --- a/src/lib/libcrypto/doc/DSA_set_method.pod +++ /dev/null | |||
| @@ -1,145 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | DSA_set_default_method, DSA_get_default_method, | ||
| 6 | DSA_set_method, DSA_new_method, DSA_OpenSSL, | ||
| 7 | DSA_set_default_openssl_method, DSA_get_default_openssl_method | ||
| 8 | - select DSA method | ||
| 9 | |||
| 10 | =head1 SYNOPSIS | ||
| 11 | |||
| 12 | #include <openssl/dsa.h> | ||
| 13 | #include <openssl/engine.h> | ||
| 14 | |||
| 15 | void DSA_set_default_method(const DSA_METHOD *meth); | ||
| 16 | |||
| 17 | const DSA_METHOD *DSA_get_default_method(void); | ||
| 18 | |||
| 19 | int DSA_set_method(DSA *dsa, const DSA_METHOD *meth); | ||
| 20 | |||
| 21 | DSA *DSA_new_method(ENGINE *engine); | ||
| 22 | |||
| 23 | DSA_METHOD *DSA_OpenSSL(void); | ||
| 24 | |||
| 25 | =head1 DESCRIPTION | ||
| 26 | |||
| 27 | A B<DSA_METHOD> specifies the functions that OpenSSL uses for DSA | ||
| 28 | operations. By modifying the method, alternative implementations | ||
| 29 | such as hardware accelerators may be used. IMPORTANT: See the NOTES section for | ||
| 30 | important information about how these DSA API functions are affected by the use | ||
| 31 | of B<ENGINE> API calls. | ||
| 32 | |||
| 33 | Initially, the default DSA_METHOD is the OpenSSL internal implementation, | ||
| 34 | as returned by DSA_OpenSSL(). | ||
| 35 | |||
| 36 | DSA_set_default_method() makes B<meth> the default method for all DSA | ||
| 37 | structures created later. B<NB>: This is true only whilst no ENGINE has | ||
| 38 | been set as a default for DSA, so this function is no longer recommended. | ||
| 39 | |||
| 40 | DSA_get_default_method() returns a pointer to the current default | ||
| 41 | DSA_METHOD. However, the meaningfulness of this result is dependent on | ||
| 42 | whether the ENGINE API is being used, so this function is no longer | ||
| 43 | recommended. | ||
| 44 | |||
| 45 | DSA_set_method() selects B<meth> to perform all operations using the key | ||
| 46 | B<rsa>. This will replace the DSA_METHOD used by the DSA key and if the | ||
| 47 | previous method was supplied by an ENGINE, the handle to that ENGINE will | ||
| 48 | be released during the change. It is possible to have DSA keys that only | ||
| 49 | work with certain DSA_METHOD implementations (eg. from an ENGINE module | ||
| 50 | that supports embedded hardware-protected keys), and in such cases | ||
| 51 | attempting to change the DSA_METHOD for the key can have unexpected | ||
| 52 | results. | ||
| 53 | |||
| 54 | DSA_new_method() allocates and initializes a DSA structure so that B<engine> | ||
| 55 | will be used for the DSA operations. If B<engine> is NULL, the default engine | ||
| 56 | for DSA operations is used, and if no default ENGINE is set, the DSA_METHOD | ||
| 57 | controlled by DSA_set_default_method() is used. | ||
| 58 | |||
| 59 | =head1 THE DSA_METHOD STRUCTURE | ||
| 60 | |||
| 61 | struct | ||
| 62 | { | ||
| 63 | /* name of the implementation */ | ||
| 64 | const char *name; | ||
| 65 | |||
| 66 | /* sign */ | ||
| 67 | DSA_SIG *(*dsa_do_sign)(const unsigned char *dgst, int dlen, | ||
| 68 | DSA *dsa); | ||
| 69 | |||
| 70 | /* pre-compute k^-1 and r */ | ||
| 71 | int (*dsa_sign_setup)(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, | ||
| 72 | BIGNUM **rp); | ||
| 73 | |||
| 74 | /* verify */ | ||
| 75 | int (*dsa_do_verify)(const unsigned char *dgst, int dgst_len, | ||
| 76 | DSA_SIG *sig, DSA *dsa); | ||
| 77 | |||
| 78 | /* compute rr = a1^p1 * a2^p2 mod m (May be NULL for some | ||
| 79 | implementations) */ | ||
| 80 | int (*dsa_mod_exp)(DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, | ||
| 81 | BIGNUM *a2, BIGNUM *p2, BIGNUM *m, | ||
| 82 | BN_CTX *ctx, BN_MONT_CTX *in_mont); | ||
| 83 | |||
| 84 | /* compute r = a ^ p mod m (May be NULL for some implementations) */ | ||
| 85 | int (*bn_mod_exp)(DSA *dsa, BIGNUM *r, BIGNUM *a, | ||
| 86 | const BIGNUM *p, const BIGNUM *m, | ||
| 87 | BN_CTX *ctx, BN_MONT_CTX *m_ctx); | ||
| 88 | |||
| 89 | /* called at DSA_new */ | ||
| 90 | int (*init)(DSA *DSA); | ||
| 91 | |||
| 92 | /* called at DSA_free */ | ||
| 93 | int (*finish)(DSA *DSA); | ||
| 94 | |||
| 95 | int flags; | ||
| 96 | |||
| 97 | char *app_data; /* ?? */ | ||
| 98 | |||
| 99 | } DSA_METHOD; | ||
| 100 | |||
| 101 | =head1 RETURN VALUES | ||
| 102 | |||
| 103 | DSA_OpenSSL() and DSA_get_default_method() return pointers to the respective | ||
| 104 | B<DSA_METHOD>s. | ||
| 105 | |||
| 106 | DSA_set_default_method() returns no value. | ||
| 107 | |||
| 108 | DSA_set_method() returns non-zero if the provided B<meth> was successfully set | ||
| 109 | as the method for B<dsa> (including unloading the ENGINE handle if the previous | ||
| 110 | method was supplied by an ENGINE). | ||
| 111 | |||
| 112 | DSA_new_method() returns NULL and sets an error code that can be | ||
| 113 | obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation | ||
| 114 | fails. Otherwise it returns a pointer to the newly allocated structure. | ||
| 115 | |||
| 116 | =head1 NOTES | ||
| 117 | |||
| 118 | As of version 0.9.7, DSA_METHOD implementations are grouped together with other | ||
| 119 | algorithmic APIs (eg. RSA_METHOD, EVP_CIPHER, etc) in B<ENGINE> modules. If a | ||
| 120 | default ENGINE is specified for DSA functionality using an ENGINE API function, | ||
| 121 | that will override any DSA defaults set using the DSA API (ie. | ||
| 122 | DSA_set_default_method()). For this reason, the ENGINE API is the recommended | ||
| 123 | way to control default implementations for use in DSA and other cryptographic | ||
| 124 | algorithms. | ||
| 125 | |||
| 126 | =head1 SEE ALSO | ||
| 127 | |||
| 128 | L<dsa(3)|dsa(3)>, L<DSA_new(3)|DSA_new(3)> | ||
| 129 | |||
| 130 | =head1 HISTORY | ||
| 131 | |||
| 132 | DSA_set_default_method(), DSA_get_default_method(), DSA_set_method(), | ||
| 133 | DSA_new_method() and DSA_OpenSSL() were added in OpenSSL 0.9.4. | ||
| 134 | |||
| 135 | DSA_set_default_openssl_method() and DSA_get_default_openssl_method() replaced | ||
| 136 | DSA_set_default_method() and DSA_get_default_method() respectively, and | ||
| 137 | DSA_set_method() and DSA_new_method() were altered to use B<ENGINE>s rather than | ||
| 138 | B<DSA_METHOD>s during development of the engine version of OpenSSL 0.9.6. For | ||
| 139 | 0.9.7, the handling of defaults in the ENGINE API was restructured so that this | ||
| 140 | change was reversed, and behaviour of the other functions resembled more closely | ||
| 141 | the previous behaviour. The behaviour of defaults in the ENGINE API now | ||
| 142 | transparently overrides the behaviour of defaults in the DSA API without | ||
| 143 | requiring changing these function prototypes. | ||
| 144 | |||
| 145 | =cut | ||
