diff options
Diffstat (limited to 'src/ssl/ssl_cipher.c')
-rw-r--r-- | src/ssl/ssl_cipher.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ssl/ssl_cipher.c b/src/ssl/ssl_cipher.c index 0ffeb5b..e87835f 100644 --- a/src/ssl/ssl_cipher.c +++ b/src/ssl/ssl_cipher.c @@ -1384,10 +1384,18 @@ int SSL_CIPHER_has_MD5_HMAC(const SSL_CIPHER *cipher) { return (cipher->algorithm_mac & SSL_MD5) != 0; } +int SSL_CIPHER_has_SHA1_HMAC(const SSL_CIPHER *cipher) { + return (cipher->algorithm_mac & SSL_SHA1) != 0; +} + int SSL_CIPHER_is_AESGCM(const SSL_CIPHER *cipher) { return (cipher->algorithm_enc & (SSL_AES128GCM | SSL_AES256GCM)) != 0; } +int SSL_CIPHER_is_AES128GCM(const SSL_CIPHER *cipher) { + return (cipher->algorithm_enc & SSL_AES128GCM) != 0; +} + int SSL_CIPHER_is_CHACHA20POLY1305(const SSL_CIPHER *cipher) { return (cipher->algorithm_enc & SSL_CHACHA20POLY1305_OLD) != 0; } @@ -1406,6 +1414,17 @@ int SSL_CIPHER_is_block_cipher(const SSL_CIPHER *cipher) { cipher->algorithm_mac != SSL_AEAD; } +int SSL_CIPHER_is_ECDSA(const SSL_CIPHER *cipher) { + return (cipher->algorithm_auth & SSL_aECDSA) != 0; +} + +uint16_t SSL_CIPHER_get_min_version(const SSL_CIPHER *cipher) { + if (cipher->algorithm_ssl & SSL_TLSV1_2) { + return TLS1_2_VERSION; + } + return SSL3_VERSION; +} + /* return the actual cipher being used */ const char *SSL_CIPHER_get_name(const SSL_CIPHER *cipher) { if (cipher != NULL) { |