From f4a7386ad452be83302d05d40576b1606b18e4c6 Mon Sep 17 00:00:00 2001 From: Ingmar Runge Date: Thu, 6 Feb 2014 18:42:22 +0100 Subject: [PATCH] certauth: case insensitive hex key comparison As noted in issue 464, comparing the hex representation of the public key fingerprint should be case insensitive. --- modules/certauth.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/certauth.cpp b/modules/certauth.cpp index 850973dd..13fb934c 100644 --- a/modules/certauth.cpp +++ b/modules/certauth.cpp @@ -60,7 +60,7 @@ public: it1->second.Split(" ", vsKeys, false); for (it2 = vsKeys.begin(); it2 != vsKeys.end(); ++it2) { - m_PubKeys[it1->first].insert(*it2); + m_PubKeys[it1->first].insert(it2->AsLower()); } } @@ -96,7 +96,7 @@ public: } bool AddKey(CUser *pUser, CString sKey) { - pair pair = m_PubKeys[pUser->GetUserName()].insert(sKey); + pair pair = m_PubKeys[pUser->GetUserName()].insert(sKey.AsLower()); if (pair.second) { Save(); @@ -235,7 +235,7 @@ public: case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: - return sRes; + return sRes.AsLower(); default: return ""; }