Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: net/cert/x509_util_nss.h

Issue 15315003: Generate unique certificate nicknames on Linux/CrOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update README Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/cert/x509_util_nss.h
diff --git a/net/cert/x509_util_nss.h b/net/cert/x509_util_nss.h
index b971963d4d18467e8d9a17c3ab0a798854c4573e..b3f0b4c62a9b50745e0444e871c41840cb52de3d 100644
--- a/net/cert/x509_util_nss.h
+++ b/net/cert/x509_util_nss.h
@@ -20,6 +20,7 @@ typedef struct PLArenaPool PLArenaPool;
typedef struct SECKEYPrivateKeyStr SECKEYPrivateKey;
typedef struct SECItemStr SECItem;
typedef struct SECKEYPublicKeyStr SECKEYPublicKey;
+typedef struct PK11SlotInfoStr PK11SlotInfo;
wtc 2013/05/22 20:58:45 Nit: list this typedef in sorted order. (The origi
namespace net {
@@ -93,6 +94,15 @@ bool GetIssuersFromEncodedList(
bool IsCertificateIssuedBy(const std::vector<CERTCertificate*>& cert_chain,
const std::vector<CERTName*>& valid_issuers);
+// Generates a unique nickname for |slot|, returning |nickname| if it is
+// already unique.
+//
+// Note: The nickname returned will NOT include the token name, and must
+// be prepended if calling an NSS function that expects <token>:<nickname>.
wtc 2013/05/22 20:58:45 Nit: this should be ..., and the token name must
+// TODO(gspencer): Internationalize this: it's wrong to hard-code English.
wtc 2013/05/22 20:58:45 We need to describe how we make the nickname uniqu
Ryan Sleevi 2013/05/22 23:20:19 I wanted to try to avoid describing in the header
+std::string GetUniqueNicknameForSlot(const std::string& nickname,
+ SECItem* subject,
wtc 2013/05/22 20:58:45 Nit: this should ideally be a const pointer. We wi
Ryan Sleevi 2013/05/22 23:20:19 Sure, fixed.
+ PK11SlotInfo* slot);
#endif // defined(USE_NSS) || defined(OS_IOS)
} // namespace x509_util

Powered by Google App Engine
This is Rietveld 408576698