summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-12-18 10:59:12 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-12-18 10:59:12 +0100
commitb0adfa46f3176117bdd23ea20454464dd82a6a9f (patch)
tree5e9e7e171fa1297cedb47ec2327adcb245307031
parentcb58e3936247f065b3aca928fe3881304133fd6e (diff)
downloadcurl-b0adfa46f3176117bdd23ea20454464dd82a6a9f.tar.gz
fixup also go "unknown cipher" when too long name was used
-rw-r--r--lib/vtls/nss.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/vtls/nss.c b/lib/vtls/nss.c
index 5b6f36f54..dbe049449 100644
--- a/lib/vtls/nss.c
+++ b/lib/vtls/nss.c
@@ -333,6 +333,7 @@ static SECStatus set_ciphers(struct Curl_easy *data, PRFileDesc *model,
const char *end;
char name[MAX_CIPHER_LENGTH + 1];
size_t len;
+ bool found = FALSE;
while((*cipher) && (ISSPACE(*cipher)))
++cipher;
@@ -343,7 +344,6 @@ static SECStatus set_ciphers(struct Curl_easy *data, PRFileDesc *model,
len = strlen(cipher);
if(len && (len < MAX_CIPHER_LENGTH)) {
- bool found = FALSE;
memcpy(name, cipher, len);
name[len] = 0;
@@ -359,11 +359,11 @@ static SECStatus set_ciphers(struct Curl_easy *data, PRFileDesc *model,
break;
}
}
+ }
- if(!found) {
- failf(data, "Unknown cipher in list: %s", name);
- return SECFailure;
- }
+ if(!found && len) {
+ failf(data, "Unknown cipher: %s", name);
+ return SECFailure;
}
if(end)
cipher = ++end;