forked from wolfSSL/wolfssl
compatibility of get cipher list function and update cmake files
This commit is contained in:
@ -27,9 +27,9 @@ SET(WOLFCRYPT_SOURCES src/aes.c src/arc4.c src/asn.c src/blake2b.c
|
|||||||
src/camellia.c src/chacha.c src/coding.c src/compress.c src/des3.c
|
src/camellia.c src/chacha.c src/coding.c src/compress.c src/des3.c
|
||||||
src/dh.c src/dsa.c src/ecc.c src/error.c src/hc128.c src/hmac.c
|
src/dh.c src/dsa.c src/ecc.c src/error.c src/hc128.c src/hmac.c
|
||||||
src/integer.c src/logging.c src/md2.c src/md4.c src/md5.c src/memory.c
|
src/integer.c src/logging.c src/md2.c src/md4.c src/md5.c src/memory.c
|
||||||
src/pkcs7.c src/poly1305.c src/pwdbased.c src/rabbit.c
|
src/pkcs7.c src/pkcs12.c src/poly1305.c src/pwdbased.c src/rabbit.c
|
||||||
src/random.c src/ripemd.c src/rsa.c src/sha.c src/sha256.c src/sha512.c
|
src/random.c src/ripemd.c src/rsa.c src/sha.c src/sha256.c src/sha512.c
|
||||||
src/tfm.c src/wc_port.c src/wc_encrypt.c src/hash.c
|
src/tfm.c src/wc_port.c src/wc_encrypt.c src/hash.c src/wolfmath.c
|
||||||
../wolfssl/wolfcrypt/aes.h ../wolfssl/wolfcrypt/arc4.h ../wolfssl/wolfcrypt/asn.h ../wolfssl/wolfcrypt/blake2.h
|
../wolfssl/wolfcrypt/aes.h ../wolfssl/wolfcrypt/arc4.h ../wolfssl/wolfcrypt/asn.h ../wolfssl/wolfcrypt/blake2.h
|
||||||
../wolfssl/wolfcrypt/camellia.h ../wolfssl/wolfcrypt/chacha.h ../wolfssl/wolfcrypt/coding.h ../wolfssl/wolfcrypt/compress.h ../wolfssl/wolfcrypt/des3.h
|
../wolfssl/wolfcrypt/camellia.h ../wolfssl/wolfcrypt/chacha.h ../wolfssl/wolfcrypt/coding.h ../wolfssl/wolfcrypt/compress.h ../wolfssl/wolfcrypt/des3.h
|
||||||
../wolfssl/wolfcrypt/dh.h ../wolfssl/wolfcrypt/dsa.h ../wolfssl/wolfcrypt/ecc.h ../wolfssl/wolfcrypt/error-crypt.h ../wolfssl/wolfcrypt/hc128.h ../wolfssl/wolfcrypt/hmac.h
|
../wolfssl/wolfcrypt/dh.h ../wolfssl/wolfcrypt/dsa.h ../wolfssl/wolfcrypt/ecc.h ../wolfssl/wolfcrypt/error-crypt.h ../wolfssl/wolfcrypt/hc128.h ../wolfssl/wolfcrypt/hmac.h
|
||||||
@ -42,7 +42,6 @@ SET(WOLFCRYPT_SOURCES src/aes.c src/arc4.c src/asn.c src/blake2b.c
|
|||||||
# misc.c is not compiled in since using INLINE
|
# misc.c is not compiled in since using INLINE
|
||||||
|
|
||||||
ADD_CONVENIENCE_LIBRARY(wolfcrypt ${WOLFCRYPT_SOURCES})
|
ADD_CONVENIENCE_LIBRARY(wolfcrypt ${WOLFCRYPT_SOURCES})
|
||||||
RESTRICT_SYMBOL_EXPORTS(wolfcrypt)
|
|
||||||
|
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
INSTALL_DEBUG_TARGET(wolfcrypt DESTINATION ${INSTALL_LIBDIR}/debug)
|
INSTALL_DEBUG_TARGET(wolfcrypt DESTINATION ${INSTALL_LIBDIR}/debug)
|
||||||
|
@ -35,7 +35,6 @@ SET(WOLFSSL_SOURCES src/crl.c src/internal.c src/keys.c src/sniffer.c
|
|||||||
../../client/get_password.c )
|
../../client/get_password.c )
|
||||||
|
|
||||||
ADD_CONVENIENCE_LIBRARY(wolfssl ${WOLFSSL_SOURCES})
|
ADD_CONVENIENCE_LIBRARY(wolfssl ${WOLFSSL_SOURCES})
|
||||||
RESTRICT_SYMBOL_EXPORTS(wolfssl)
|
|
||||||
|
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
INSTALL_DEBUG_TARGET(wolfssl DESTINATION ${INSTALL_LIBDIR}/debug)
|
INSTALL_DEBUG_TARGET(wolfssl DESTINATION ${INSTALL_LIBDIR}/debug)
|
||||||
|
27
src/ssl.c
27
src/ssl.c
@ -634,6 +634,33 @@ char* wolfSSL_get_cipher_list(int priority)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the name of cipher at priority level passed in.
|
||||||
|
*/
|
||||||
|
char* wolfSSL_get_cipher_list_ex(WOLFSSL* ssl, int priority)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (ssl == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const char* cipher;
|
||||||
|
|
||||||
|
if ((cipher = wolfSSL_get_cipher_name_internal(ssl)) != NULL) {
|
||||||
|
if (priority == 0) {
|
||||||
|
return (char*)cipher;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return wolfSSL_get_cipher_list(priority);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int wolfSSL_get_ciphers(char* buf, int len)
|
int wolfSSL_get_ciphers(char* buf, int len)
|
||||||
{
|
{
|
||||||
const char* const* ciphers = GetCipherNames();
|
const char* const* ciphers = GetCipherNames();
|
||||||
|
@ -98,8 +98,8 @@ typedef WOLFSSL_X509_STORE_CTX X509_STORE_CTX;
|
|||||||
|
|
||||||
#define SSL_get_client_random(ssl,out,outSz) \
|
#define SSL_get_client_random(ssl,out,outSz) \
|
||||||
wolfSSL_get_client_random((ssl),(out),(outSz))
|
wolfSSL_get_client_random((ssl),(out),(outSz))
|
||||||
#define SSL_get_cipher_list(ctx,i) wolfSSL_get_cipher_list((i))
|
#define SSL_get_cipher_list(ctx,i) wolfSSL_get_cipher_list_ex((ctx),(i))
|
||||||
#define SSL_get_cipher_name(ctx) wolfSSL_get_cipher((ctx))
|
#define SSL_get_cipher_name(ctx) wolfSSL_get_cipher((ctx))
|
||||||
#define SSL_get_shared_ciphers(ctx,buf,len) \
|
#define SSL_get_shared_ciphers(ctx,buf,len) \
|
||||||
wolfSSL_get_shared_ciphers((ctx),(buf),(len))
|
wolfSSL_get_shared_ciphers((ctx),(buf),(len))
|
||||||
|
|
||||||
|
@ -388,6 +388,7 @@ WOLFSSL_API int wolfSSL_set_fd (WOLFSSL*, int);
|
|||||||
WOLFSSL_API int wolfSSL_set_write_fd (WOLFSSL*, int);
|
WOLFSSL_API int wolfSSL_set_write_fd (WOLFSSL*, int);
|
||||||
WOLFSSL_API int wolfSSL_set_read_fd (WOLFSSL*, int);
|
WOLFSSL_API int wolfSSL_set_read_fd (WOLFSSL*, int);
|
||||||
WOLFSSL_API char* wolfSSL_get_cipher_list(int priority);
|
WOLFSSL_API char* wolfSSL_get_cipher_list(int priority);
|
||||||
|
WOLFSSL_API char* wolfSSL_get_cipher_list_ex(WOLFSSL* ssl, int priority);
|
||||||
WOLFSSL_API int wolfSSL_get_ciphers(char*, int);
|
WOLFSSL_API int wolfSSL_get_ciphers(char*, int);
|
||||||
WOLFSSL_API const char* wolfSSL_get_cipher_name(WOLFSSL* ssl);
|
WOLFSSL_API const char* wolfSSL_get_cipher_name(WOLFSSL* ssl);
|
||||||
WOLFSSL_API const char* wolfSSL_get_shared_ciphers(WOLFSSL* ssl, char* buf,
|
WOLFSSL_API const char* wolfSSL_get_shared_ciphers(WOLFSSL* ssl, char* buf,
|
||||||
|
Reference in New Issue
Block a user