From 98a1571d8890a43c9b5fe1cf21f3a1a0e3d02656 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 7 Oct 2014 11:44:56 +0300 Subject: [PATCH] OpenSSL: Clean up one part from the BoringSSL patch The (int) typecast I used with sk_GENERAL_NAME_num() to complete the BoringSSL compilation was not really the cleanest way of doing this. Update that to use stack_index_t variable to avoid this just like the other sk_*_num() calls. Signed-off-by: Jouni Malinen --- src/crypto/tls_openssl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c index 733503385..e1534224c 100644 --- a/src/crypto/tls_openssl.c +++ b/src/crypto/tls_openssl.c @@ -1217,6 +1217,7 @@ static int tls_match_suffix(X509 *cert, const char *match) GENERAL_NAME *gen; void *ext; int i; + stack_index_t j; int dns_name = 0; X509_NAME *name; @@ -1224,8 +1225,8 @@ static int tls_match_suffix(X509 *cert, const char *match) ext = X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL); - for (i = 0; ext && i < (int) sk_GENERAL_NAME_num(ext); i++) { - gen = sk_GENERAL_NAME_value(ext, i); + for (j = 0; ext && j < sk_GENERAL_NAME_num(ext); j++) { + gen = sk_GENERAL_NAME_value(ext, j); if (gen->type != GEN_DNS) continue; dns_name++;