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