Manual Pages for UNIX Darwin command on man DH_new_method
MyWebUniversity

Manual Pages for UNIX Darwin command on man DH_new_method

DHsetmethod(3) OpenSSL DHsetmethod(3)

NAME

DHsetdefaultmethod, DHgetdefaultmethod, DHsetmethod,

DHnewmethod, DHOpenSSL - select DH method

SYNOPSIS

#include

#include

void DHsetdefaultmethod(const DHMETHOD *meth); const DHMETHOD *DHgetdefaultmethod(void); int DHsetmethod(DH *dh, const DHMETHOD *meth); DH *DHnewmethod(ENGINE *engine); const DHMETHOD *DHOpenSSL(void);

DESCRIPTION

A DDHHMMEETTHHOODD specifies the functions that OpenSSL uses for Diffie-

Hellman operations. By modifying the method, alternative implementations such as hardware accelerators may be used. IMPORTANT:

See the NOTES section for important information about how these DH API

functions are affected by the use of EENNGGIINNEE API calls. Initially, the default DHMETHOD is the OpenSSL internal implementation, as returned by DHOpenSSL(). DHsetdefaultmethod() makes mmeetthh the default method for all DH structures created later. NNBB: This is true only whilst no ENGINE has been set as a default for DH, so this function is no longer recommended. DHgetdefaultmethod() returns a pointer to the current default DHMETHOD. However, the meaningfulness of this result is dependant on whether the ENGINE API is being used, so this function is no longer recommended. DHsetmethod() selects mmeetthh to perform all operations using the key ddhh. This will replace the DHMETHOD used by the DH key and if the previous method was supplied by an ENGINE, the handle to that ENGINE will be released during the change. It is possible to have DH keys that only work with certain DHMETHOD implementations (eg. from an ENGINE

module that supports embedded hardware-protected keys), and in such

cases attempting to change the DHMETHOD for the key can have unexpected results. DHnewmethod() allocates and initializes a DH structure so that eennggiinnee will be used for the DH operations. If eennggiinnee is NULL, the default ENGINE for DH operations is used, and if no default ENGINE is set, the DHMETHOD controlled by DHsetdefaultmethod() is used. TTHHEE DDHHMMEETTHHOODD SSTTRRUUCCTTUURREE typedef struct dhmethst { /* name of the implementation */ const char *name; /* generate private and public DH values for key agreement */ int (*generatekey)(DH *dh); /* compute shared secret */ int (*computekey)(unsigned char *key, BIGNUM *pubkey, DH *dh); /* compute r = a ^ p mod m (May be NULL for some implementations) */ int (*bnmodexp)(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BNCTX *ctx, BNMONTCTX *mctx); /* called at DHnew */ int (*init)(DH *dh); /* called at DHfree */ int (*finish)(DH *dh); int flags; char *appdata; /* ?? */ } DHMETHOD;

RETURN VALUES

DHOpenSSL() and DHgetdefaultmethod() return pointers to the respective DDHHMMEETTHHOODDs. DHsetdefaultmethod() returns no value.

DHsetmethod() returns non-zero if the provided mmeetthh was successfully

set as the method for ddhh (including unloading the ENGINE handle if the previous method was supplied by an ENGINE). DHnewmethod() returns NULL and sets an error code that can be obtained by ERRgeterror(3) if the allocation fails. Otherwise it returns a pointer to the newly allocated structure. NNOOTTEESS As of version 0.9.7, DHMETHOD implementations are grouped together with other algorithmic APIs (eg. RSAMETHOD, EVPCIPHER, etc) in EENNGGIINNEE modules. If a default ENGINE is specified for DH functionality using an ENGINE API function, that will override any DH defaults set using the DH API (ie. DHsetdefaultmethod()). For this reason, the ENGINE API is the recommended way to control default implementations for use in DH and other cryptographic algorithms.

SEE ALSO

dh(3), DHnew(3) HISTORY DHsetdefaultmethod(), DHgetdefaultmethod(), DHsetmethod(), DHnewmethod() and DHOpenSSL() were added in OpenSSL 0.9.4. DHsetdefaultopensslmethod() and DHgetdefaultopensslmethod() replaced DHsetdefaultmethod() and DHgetdefaultmethod() respectively, and DHsetmethod() and DHnewmethod() were altered to use EENNGGIINNEEs rather than DDHHMMEETTHHOODDs during development of the engine version of OpenSSL 0.9.6. For 0.9.7, the handling of defaults in the ENGINE API was restructured so that this change was reversed, and behaviour of the other functions resembled more closely the previous behaviour. The behaviour of defaults in the ENGINE API now transparently overrides the behaviour of defaults in the DH API without requiring changing these function prototypes.

0.9.7l 2002-10-28 DHsetmethod(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™