aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2016-02-04 10:44:52 +0100
committerKamil Dudka <kdudka@redhat.com>2016-02-10 18:58:49 +0100
commit64fa3b8d643f694ab2e606a5b4d89b73579a4a7b (patch)
tree1aee38834f681d1d5e1c3ae00659e3a92fafb2a1 /lib
parent6390e6566489974a99ceed931f1eed9a1142d365 (diff)
nss: search slash in forward direction in dup_nickname()
It is wasteful to search it backwards if we look for _any_ slash.
Diffstat (limited to 'lib')
-rw-r--r--lib/vtls/nss.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/vtls/nss.c b/lib/vtls/nss.c
index 2fc3f433a..3922d9c90 100644
--- a/lib/vtls/nss.c
+++ b/lib/vtls/nss.c
@@ -328,8 +328,8 @@ static char* dup_nickname(struct SessionHandle *data, enum dupstring cert_kind)
/* no such file exists, use the string as nickname */
return strdup(str);
- /* search the last slash; we require at least one slash in a file name */
- n = strrchr(str, '/');
+ /* search the first slash; we require at least one slash in a file name */
+ n = strchr(str, '/');
if(!n) {
infof(data, "warning: certificate file name \"%s\" handled as nickname; "
"please use \"./%s\" to force file name\n", str, str);
@@ -928,12 +928,6 @@ static SECStatus check_issuer_cert(PRFileDesc *sock,
SECStatus res=SECSuccess;
void *proto_win = NULL;
- /*
- PRArenaPool *tmpArena = NULL;
- CERTAuthKeyID *authorityKeyID = NULL;
- SECITEM *caname = NULL;
- */
-
cert = SSL_PeerCertificate(sock);
cert_issuer = CERT_FindCertIssuer(cert, PR_Now(), certUsageObjectSigner);