aboutsummaryrefslogtreecommitdiffstats
path: root/ssl/ssl_ciph.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2015-05-02 18:30:00 +0100
committerDr. Stephen Henson <steve@openssl.org>2015-05-03 12:53:08 +0100
commitb6eb9827a6866981c08cc9613ca8b4a648894fb1 (patch)
treec5a6351461d8be964bc1f31fa2e34c4ebb7cfafd /ssl/ssl_ciph.c
parent31ff45aa975acb43f1da20e714eadf4649655714 (diff)
downloadopenssl-b6eb9827a6866981c08cc9613ca8b4a648894fb1.tar.gz
Add OSSL_NELEM macro.
Add OSSL_NELEM macro to e_os.h to determine the number of elements in an array. Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'ssl/ssl_ciph.c')
-rw-r--r--ssl/ssl_ciph.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c
index 6c6ac8db62..a3dca18ad2 100644
--- a/ssl/ssl_ciph.c
+++ b/ssl/ssl_ciph.c
@@ -242,7 +242,7 @@ static int ssl_cipher_info_find(const ssl_cipher_table * table,
}
#define ssl_cipher_info_lookup(table, x) \
- ssl_cipher_info_find(table, sizeof(table)/sizeof(*table), x)
+ ssl_cipher_info_find(table, OSSL_NELEM(table), x)
/*
* PKEY_TYPE for GOST89MAC is known in advance, but, because implementation
@@ -1531,7 +1531,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method, STACK
* groups of cipher_aliases added together in one list (otherwise
* we would be happy with just the cipher_aliases table).
*/
- num_of_group_aliases = sizeof(cipher_aliases) / sizeof(SSL_CIPHER);
+ num_of_group_aliases = OSSL_NELEM(cipher_aliases);
num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1;
ca_list = OPENSSL_malloc(sizeof(SSL_CIPHER *) * num_of_alias_max);
if (ca_list == NULL) {