diff --git a/cyassl/openssl/crypto.h b/cyassl/openssl/crypto.h index df9c3d9bb..f7d5337c2 100644 --- a/cyassl/openssl/crypto.h +++ b/cyassl/openssl/crypto.h @@ -3,10 +3,14 @@ #ifndef CYASSL_CRYPTO_H_ #define CYASSL_CRYPTO_H_ + +#include + #ifdef YASSL_PREFIX #include "prefix_crypto.h" #endif + CYASSL_API const char* CyaSSLeay_version(int type); CYASSL_API unsigned long CyaSSLeay(void); diff --git a/cyassl/openssl/des.h b/cyassl/openssl/des.h index ca5c1f6dd..81a79d093 100644 --- a/cyassl/openssl/des.h +++ b/cyassl/openssl/des.h @@ -28,6 +28,8 @@ #ifndef CYASSL_DES_H_ #define CYASSL_DES_H_ +#include + #ifdef YASSL_PREFIX #include "prefix_des.h" #endif diff --git a/cyassl/openssl/evp.h b/cyassl/openssl/evp.h index 4252f21a3..fd1cf3a96 100644 --- a/cyassl/openssl/evp.h +++ b/cyassl/openssl/evp.h @@ -28,6 +28,8 @@ #ifndef CYASSL_EVP_H_ #define CYASSL_EVP_H_ +#include + #ifdef YASSL_PREFIX #include "prefix_evp.h" #endif diff --git a/cyassl/openssl/hmac.h b/cyassl/openssl/hmac.h index 0ab338345..aad744eb2 100644 --- a/cyassl/openssl/hmac.h +++ b/cyassl/openssl/hmac.h @@ -28,6 +28,8 @@ #ifndef CYASSL_HMAC_H_ #define CYASSL_HMAC_H_ +#include + #ifdef YASSL_PREFIX #include "prefix_hmac.h" #endif diff --git a/cyassl/openssl/md5.h b/cyassl/openssl/md5.h index 6dab2fbed..bc9219c1e 100644 --- a/cyassl/openssl/md5.h +++ b/cyassl/openssl/md5.h @@ -4,6 +4,8 @@ #ifndef CYASSL_MD5_H_ #define CYASSL_MD5_H_ +#include + #ifdef YASSL_PREFIX #include "prefix_md5.h" #endif diff --git a/cyassl/openssl/sha.h b/cyassl/openssl/sha.h index 18d3f57fe..4cf2112b8 100644 --- a/cyassl/openssl/sha.h +++ b/cyassl/openssl/sha.h @@ -4,6 +4,8 @@ #ifndef CYASSL_SHA_H_ #define CYASSL_SHA_H_ +#include + #ifdef YASSL_PREFIX #include "prefix_sha.h" #endif diff --git a/cyassl/openssl/ssl.h b/cyassl/openssl/ssl.h index 1d39fabe2..680373941 100644 --- a/cyassl/openssl/ssl.h +++ b/cyassl/openssl/ssl.h @@ -148,6 +148,7 @@ typedef CYASSL_X509_STORE_CTX X509_STORE_CTX; #define SSL_get_version CyaSSL_get_version #define SSL_get_current_cipher CyaSSL_get_current_cipher +#define SSL_get_cipher CyaSSL_get_cipher #define SSL_CIPHER_description CyaSSL_CIPHER_description #define SSL_CIPHER_get_name CyaSSL_CIPHER_get_name #define SSL_get1_session CyaSSL_get1_session diff --git a/cyassl/ssl.h b/cyassl/ssl.h index 0086b039a..b402b0462 100644 --- a/cyassl/ssl.h +++ b/cyassl/ssl.h @@ -233,6 +233,7 @@ CYASSL_API const char* CyaSSL_get_version(CYASSL*); CYASSL_API CYASSL_CIPHER* CyaSSL_get_current_cipher(CYASSL*); CYASSL_API char* CyaSSL_CIPHER_description(CYASSL_CIPHER*, char*, int); CYASSL_API const char* CyaSSL_CIPHER_get_name(const CYASSL_CIPHER* cipher); +CYASSL_API const char* CyaSSL_get_cipher(CYASSL*); CYASSL_API CYASSL_SESSION* CyaSSL_get1_session(CYASSL* ssl); /* what's ref count */ diff --git a/src/ssl.c b/src/ssl.c index ba99241dd..2c8c888e2 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -3598,10 +3598,13 @@ int CyaSSL_set_compression(CYASSL* ssl) } - CYASSL_CIPHER* CyaSSL_get_current_cipher(CYASSL* ssl) + CYASSL_CIPHER* CyaSSL_get_current_cipher(CYASSL* ssl) { CYASSL_ENTER("SSL_get_current_cipher"); - return &ssl->cipher; + if (ssl) + return &ssl->cipher; + else + return NULL; } @@ -3687,6 +3690,13 @@ int CyaSSL_set_compression(CYASSL* ssl) } + const char* CyaSSL_get_cipher(CYASSL* ssl) + { + CYASSL_ENTER("CyaSSL_get_cipher"); + return CyaSSL_CIPHER_get_name(CyaSSL_get_current_cipher(ssl)); + } + + /* server ctx Diffie-Hellman parameters */ int CyaSSL_CTX_SetTmpDH(CYASSL_CTX* ctx, const unsigned char* p, int pSz, const unsigned char* g, int gSz)