Bug 1241646 - remove unused token arguments from nsIX509CertDB (and other interfaces?)
--- a/security/manager/ssl/nsIX509CertDB.idl
+++ b/security/manager/ssl/nsIX509CertDB.idl
@@ -65,48 +65,46 @@ interface nsIX509CertDB : nsISupports {
* @param aToken Optionally limits the scope of
* this function to a token device.
* Can be null to mean any token.
* @param aNickname The nickname to be used as the key
* to find a certificate.
*
* @return The matching certificate if found.
*/
- nsIX509Cert findCertByNickname(in nsISupports aToken,
- in AString aNickname);
+ nsIX509Cert findCertByNickname(in AString aNickname);
/**
* Will find a certificate based on its dbkey
* retrieved by getting the dbKey attribute of
* the certificate.
*
* @param aDBkey Database internal key, as obtained using
* attribute dbkey in nsIX509Cert.
* @param aToken Optionally limits the scope of
* this function to a token device.
* Can be null to mean any token.
*/
- nsIX509Cert findCertByDBKey(in string aDBkey, in nsISupports aToken);
+ nsIX509Cert findCertByDBKey(in string aDBkey);
/**
* Obtain a list of certificate nicknames from the database.
* What the name is depends on type:
* user, ca, or server cert - the nickname
* email cert - the email address
*
* @param aToken Optionally limits the scope of
* this function to a token device.
* Can be null to mean any token.
* @param aType Type of certificate to obtain
* See certificate type constants in nsIX509Cert.
* @param count The number of nicknames in the returned array
* @param certNameList The returned array of certificate nicknames.
*/
- void findCertNicknames(in nsISupports aToken,
- in unsigned long aType,
+ void findCertNicknames(in unsigned long aType,
out unsigned long count,
[array, size_is(count)] out wstring certNameList);
/**
* Find user's own email encryption certificate by nickname.
*
* @param aNickname The nickname to be used as the key
* to find the certificate.
@@ -131,18 +129,17 @@ interface nsIX509CertDB : nsISupports {
* @param aToken Optionally limits the scope of
* this function to a token device.
* Can be null to mean any token.
* @param aEmailAddress The email address to be used as the key
* to find the certificate.
*
* @return The matching certificate if found.
*/
- nsIX509Cert findCertByEmailAddress(in nsISupports aToken,
- in string aEmailAddress);
+ nsIX509Cert findCertByEmailAddress(in string aEmailAddress);
/**
* Use this to import a stream sent down as a mime type into
* the certificate database on the default token.
* The stream may consist of one or more certificates.
*
* @param data The raw data to be imported
* @param length The length of the data to be imported
@@ -238,45 +235,42 @@ interface nsIX509CertDB : nsISupports {
* @param aToken Optionally limits the scope of
* this function to a token device.
* Can be null to mean any token.
* @param aFile Identifies a file that contains the certificate
* to be imported.
* @param aType Describes the type of certificate that is going to
* be imported. See type constants in nsIX509Cert.
*/
- void importCertsFromFile(in nsISupports aToken,
- in nsIFile aFile,
+ void importCertsFromFile(in nsIFile aFile,
in unsigned long aType);
/**
* Import a PKCS#12 file containing cert(s) and key(s) into the database.
*
* @param aToken Optionally limits the scope of
* this function to a token device.
* Can be null to mean any token.
* @param aFile Identifies a file that contains the data
* to be imported.
*/
- void importPKCS12File(in nsISupports aToken,
- in nsIFile aFile);
+ void importPKCS12File(in nsIFile aFile);
/**
* Export a set of certs and keys from the database to a PKCS#12 file.
*
* @param aToken Optionally limits the scope of
* this function to a token device.
* Can be null to mean any token.
* @param aFile Identifies a file that will be filled with the data
* to be exported.
* @param count The number of certificates to be exported.
* @param aCerts The array of all certificates to be exported.
*/
- void exportPKCS12File(in nsISupports aToken,
- in nsIFile aFile,
+ void exportPKCS12File(in nsIFile aFile,
in unsigned long count,
[array, size_is(count)] in nsIX509Cert aCerts);
/*
* Decode a raw data presentation and instantiate an object in memory.
*
* @param base64 The raw representation of a certificate,
* encoded as Base 64.
--- a/security/manager/ssl/nsNSSCertificateDB.cpp
+++ b/security/manager/ssl/nsNSSCertificateDB.cpp
@@ -87,18 +87,17 @@ nsNSSCertificateDB::~nsNSSCertificateDB(
if (isAlreadyShutDown()) {
return;
}
shutdown(calledFromObject);
}
NS_IMETHODIMP
-nsNSSCertificateDB::FindCertByNickname(nsISupports *aToken,
- const nsAString &nickname,
+nsNSSCertificateDB::FindCertByNickname(const nsAString &nickname,
nsIX509Cert **_rvCert)
{
NS_ENSURE_ARG_POINTER(_rvCert);
*_rvCert = nullptr;
nsNSSShutDownPreventionLock locker;
if (isAlreadyShutDown()) {
return NS_ERROR_NOT_AVAILABLE;
@@ -119,17 +118,17 @@ nsNSSCertificateDB::FindCertByNickname(n
pCert.forget(_rvCert);
return NS_OK;
}
}
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
-nsNSSCertificateDB::FindCertByDBKey(const char *aDBkey, nsISupports *aToken,
+nsNSSCertificateDB::FindCertByDBKey(const char *aDBkey,
nsIX509Cert **_cert)
{
NS_ENSURE_ARG_POINTER(aDBkey);
NS_ENSURE_ARG(aDBkey[0]);
NS_ENSURE_ARG_POINTER(_cert);
*_cert = nullptr;
nsNSSShutDownPreventionLock locker;
@@ -174,18 +173,17 @@ nsNSSCertificateDB::FindCertByDBKey(cons
if (!nssCert)
return NS_ERROR_OUT_OF_MEMORY;
nssCert.forget(_cert);
}
return NS_OK;
}
NS_IMETHODIMP
-nsNSSCertificateDB::FindCertNicknames(nsISupports *aToken,
- uint32_t aType,
+nsNSSCertificateDB::FindCertNicknames(uint32_t aType,
uint32_t *_count,
char16_t ***_certNames)
{
nsNSSShutDownPreventionLock locker;
if (isAlreadyShutDown()) {
return NS_ERROR_NOT_AVAILABLE;
}
@@ -1060,18 +1058,17 @@ nsNSSCertificateDB::IsCertTrusted(nsIX50
return NS_ERROR_FAILURE;
}
} /* user: ignore */
return NS_OK;
}
NS_IMETHODIMP
-nsNSSCertificateDB::ImportCertsFromFile(nsISupports *aToken,
- nsIFile *aFile,
+nsNSSCertificateDB::ImportCertsFromFile(nsIFile *aFile,
uint32_t aType)
{
nsNSSShutDownPreventionLock locker;
if (isAlreadyShutDown()) {
return NS_ERROR_NOT_AVAILABLE;
}
NS_ENSURE_ARG(aFile);
@@ -1130,36 +1127,34 @@ nsNSSCertificateDB::ImportCertsFromFile(
}
}
delete [] buf;
return rv;
}
NS_IMETHODIMP
-nsNSSCertificateDB::ImportPKCS12File(nsISupports *aToken,
- nsIFile *aFile)
+nsNSSCertificateDB::ImportPKCS12File(nsIFile *aFile)
{
nsNSSShutDownPreventionLock locker;
if (isAlreadyShutDown()) {
return NS_ERROR_NOT_AVAILABLE;
}
NS_ENSURE_ARG(aFile);
nsPKCS12Blob blob;
nsCOMPtr<nsIPK11Token> token = do_QueryInterface(aToken);
if (token) {
blob.SetToken(token);
}
return blob.ImportFromFile(aFile);
}
NS_IMETHODIMP
-nsNSSCertificateDB::ExportPKCS12File(nsISupports *aToken,
- nsIFile *aFile,
+nsNSSCertificateDB::ExportPKCS12File(nsIFile *aFile,
uint32_t count,
nsIX509Cert **certs)
//const char16_t **aCertNames)
{
nsNSSShutDownPreventionLock locker;
if (isAlreadyShutDown()) {
return NS_ERROR_NOT_AVAILABLE;
}
@@ -1319,17 +1314,17 @@ nsNSSCertificateDB::FindEmailSigningCert
if (!nssCert) {
return NS_ERROR_OUT_OF_MEMORY;
}
nssCert.forget(_retval);
return NS_OK;
}
NS_IMETHODIMP
-nsNSSCertificateDB::FindCertByEmailAddress(nsISupports *aToken, const char *aEmailAddress, nsIX509Cert **_retval)
+nsNSSCertificateDB::FindCertByEmailAddress(const char *aEmailAddress, nsIX509Cert **_retval)
{
nsNSSShutDownPreventionLock locker;
if (isAlreadyShutDown()) {
return NS_ERROR_NOT_AVAILABLE;
}
RefPtr<SharedCertVerifier> certVerifier(GetDefaultCertVerifier());
NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED);