Skip to content

Commit

Permalink
sectransp: fix compiler warning c89 declaration in loop statement
Browse files Browse the repository at this point in the history
Reported-by: FeignClaims@users.noreply.github.com

Fixes curl#11155
Closes #xxxx
  • Loading branch information
jay committed May 20, 2023
1 parent a64d7de commit 26a63d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/vtls/sectransp.c
Expand Up @@ -897,14 +897,15 @@ static OSStatus bio_cf_out_write(SSLConnectionRef connection,
#ifndef CURL_DISABLE_VERBOSE_STRINGS
CF_INLINE const char *TLSCipherNameForNumber(SSLCipherSuite cipher)
{
size_t i;
/* The first ciphers in the ciphertable are continuous. Here we do small
optimization and instead of loop directly get SSL name by cipher number.
*/
if(cipher <= SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA) {
return ciphertable[cipher].name;
}
/* Iterate through the rest of the ciphers */
for(size_t i = SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA + 1;
for(i = SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA + 1;
i < NUM_OF_CIPHERS;
++i) {
if(ciphertable[i].num == cipher) {
Expand Down Expand Up @@ -1429,7 +1430,8 @@ static CURLcode set_ssl_version_min_max(struct Curl_cfilter *cf,

static bool is_cipher_suite_strong(SSLCipherSuite suite_num)
{
for(size_t i = 0; i < NUM_OF_CIPHERS; ++i) {
size_t i;
for(i = 0; i < NUM_OF_CIPHERS; ++i) {
if(ciphertable[i].num == suite_num) {
return !ciphertable[i].weak;
}
Expand Down

0 comments on commit 26a63d3

Please sign in to comment.