wolfSSL SSL/TLS library, support up to TLS1.3

Dependents:   CyaSSL-Twitter-OAuth4Tw Example-client-tls-cert TwitterReader TweetTest ... more

Committer:
wolfSSL
Date:
Tue May 02 08:44:47 2017 +0000
Revision:
7:481bce714567
wolfSSL3.10.2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wolfSSL 7:481bce714567 1 /* dh.h for openSSL */
wolfSSL 7:481bce714567 2
wolfSSL 7:481bce714567 3
wolfSSL 7:481bce714567 4 #ifndef WOLFSSL_DH_H_
wolfSSL 7:481bce714567 5 #define WOLFSSL_DH_H_
wolfSSL 7:481bce714567 6
wolfSSL 7:481bce714567 7 #include <wolfssl/openssl/ssl.h>
wolfSSL 7:481bce714567 8 #include <wolfssl/openssl/bn.h>
wolfSSL 7:481bce714567 9
wolfSSL 7:481bce714567 10 #ifdef __cplusplus
wolfSSL 7:481bce714567 11 extern "C" {
wolfSSL 7:481bce714567 12 #endif
wolfSSL 7:481bce714567 13
wolfSSL 7:481bce714567 14 struct WOLFSSL_DH {
wolfSSL 7:481bce714567 15 WOLFSSL_BIGNUM* p;
wolfSSL 7:481bce714567 16 WOLFSSL_BIGNUM* g;
wolfSSL 7:481bce714567 17 WOLFSSL_BIGNUM* q;
wolfSSL 7:481bce714567 18 WOLFSSL_BIGNUM* pub_key; /* openssh deference g^x */
wolfSSL 7:481bce714567 19 WOLFSSL_BIGNUM* priv_key; /* openssh deference x */
wolfSSL 7:481bce714567 20 void* internal; /* our DH */
wolfSSL 7:481bce714567 21 char inSet; /* internal set from external ? */
wolfSSL 7:481bce714567 22 char exSet; /* external set from internal ? */
wolfSSL 7:481bce714567 23 /*added for lighttpd openssl compatibility, go back and add a getter in
wolfSSL 7:481bce714567 24 * lighttpd src code.
wolfSSL 7:481bce714567 25 */
wolfSSL 7:481bce714567 26 int length;
wolfSSL 7:481bce714567 27 };
wolfSSL 7:481bce714567 28
wolfSSL 7:481bce714567 29
wolfSSL 7:481bce714567 30 WOLFSSL_API WOLFSSL_DH* wolfSSL_DH_new(void);
wolfSSL 7:481bce714567 31 WOLFSSL_API void wolfSSL_DH_free(WOLFSSL_DH*);
wolfSSL 7:481bce714567 32
wolfSSL 7:481bce714567 33 WOLFSSL_API int wolfSSL_DH_size(WOLFSSL_DH*);
wolfSSL 7:481bce714567 34 WOLFSSL_API int wolfSSL_DH_generate_key(WOLFSSL_DH*);
wolfSSL 7:481bce714567 35 WOLFSSL_API int wolfSSL_DH_compute_key(unsigned char* key, WOLFSSL_BIGNUM* pub,
wolfSSL 7:481bce714567 36 WOLFSSL_DH*);
wolfSSL 7:481bce714567 37
wolfSSL 7:481bce714567 38 typedef WOLFSSL_DH DH;
wolfSSL 7:481bce714567 39
wolfSSL 7:481bce714567 40 #define DH_new wolfSSL_DH_new
wolfSSL 7:481bce714567 41 #define DH_free wolfSSL_DH_free
wolfSSL 7:481bce714567 42
wolfSSL 7:481bce714567 43 #define DH_size wolfSSL_DH_size
wolfSSL 7:481bce714567 44 #define DH_generate_key wolfSSL_DH_generate_key
wolfSSL 7:481bce714567 45 #define DH_compute_key wolfSSL_DH_compute_key
wolfSSL 7:481bce714567 46
wolfSSL 7:481bce714567 47
wolfSSL 7:481bce714567 48 #ifdef __cplusplus
wolfSSL 7:481bce714567 49 } /* extern "C" */
wolfSSL 7:481bce714567 50 #endif
wolfSSL 7:481bce714567 51
wolfSSL 7:481bce714567 52 #ifdef HAVE_STUNNEL
wolfSSL 7:481bce714567 53 #define DH_generate_parameters wolfSSL_DH_generate_parameters
wolfSSL 7:481bce714567 54 #define DH_generate_parameters_ex wolfSSL_DH_generate_parameters_ex
wolfSSL 7:481bce714567 55 #endif /* HAVE_STUNNEL */
wolfSSL 7:481bce714567 56 #endif /* header */
wolfSSL 7:481bce714567 57