Cipher family functions.
This change adds functions to check membership of various cipher
families. Clients and servers need this in order to optimise the size of
records because different families have different amounts of prefix and
postfix overhead.
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c
index 03702cb..1dc6b5a 100644
--- a/ssl/ssl_ciph.c
+++ b/ssl/ssl_ciph.c
@@ -1626,6 +1626,22 @@
return(buf);
}
+/* Next three functions require non-null cipher */
+int SSL_CIPHER_is_AES(const SSL_CIPHER *c)
+ {
+ return (c->algorithm_enc & SSL_AES) != 0;
+ }
+
+int SSL_CIPHER_has_MD5_HMAC(const SSL_CIPHER *c)
+ {
+ return (c->algorithm_mac & SSL_MD5) != 0;
+ }
+
+int SSL_CIPHER_is_AESGCM(const SSL_CIPHER *c)
+ {
+ return (c->algorithm_mac & (SSL_AES128GCM|SSL_AES256GCM)) != 0;
+ }
+
char *SSL_CIPHER_get_version(const SSL_CIPHER *c)
{
int i;