Bug 1017348 - DumpASN1Object/ifdef-ed out code removed. r=dkeeler

This commit is contained in:
Harsh Pathak 2014-06-10 16:58:00 +02:00
Родитель 356949aa3d
Коммит 06164477b9
2 изменённых файлов: 1 добавлений и 56 удалений

Просмотреть файл

@ -2013,9 +2013,6 @@ nsCrypto::GenerateCRMFRequest(JSContext* aContext,
const_cast<char*>(aRegToken.get()), const_cast<char*>(aRegToken.get()),
const_cast<char*>(aAuthenticator.get()), const_cast<char*>(aAuthenticator.get()),
escrowCert); escrowCert);
#ifdef DEBUG_javi
printf ("Created the folloing CRMF request:\n%s\n", encodedRequest);
#endif
if (!encodedRequest) { if (!encodedRequest) {
nsFreeKeyPairInfo(keyids, numRequests); nsFreeKeyPairInfo(keyids, numRequests);
aRv.Throw(NS_ERROR_FAILURE); aRv.Throw(NS_ERROR_FAILURE);

Просмотреть файл

@ -1359,63 +1359,11 @@ nsNSSCertificate::GetUsagesString(bool localOnly, uint32_t* _verified,
return NS_OK; return NS_OK;
} }
#if defined(DEBUG_javi) || defined(DEBUG_jgmyers)
void
DumpASN1Object(nsIASN1Object* object, unsigned int level)
{
nsAutoString dispNameU, dispValU;
unsigned int i;
nsCOMPtr<nsIMutableArray> asn1Objects;
nsCOMPtr<nsISupports> isupports;
nsCOMPtr<nsIASN1Object> currObject;
bool processObjects;
uint32_t numObjects;
for (i=0; i<level; i++)
printf (" ");
object->GetDisplayName(dispNameU);
nsCOMPtr<nsIASN1Sequence> sequence(do_QueryInterface(object));
if (sequence) {
printf ("%s ", NS_ConvertUTF16toUTF8(dispNameU).get());
sequence->GetIsValidContainer(&processObjects);
if (processObjects) {
printf("\n");
sequence->GetASN1Objects(getter_AddRefs(asn1Objects));
asn1Objects->GetLength(&numObjects);
for (i=0; i<numObjects;i++) {
asn1Objects->QueryElementAt(i, NS_GET_IID(nsISupports),
getter_AddRefs(currObject));
DumpASN1Object(currObject, level+1);
}
} else {
object->GetDisplayValue(dispValU);
printf("= %s\n", NS_ConvertUTF16toUTF8(dispValU).get());
}
} else {
object->GetDisplayValue(dispValU);
printf("%s = %s\n",NS_ConvertUTF16toUTF8(dispNameU).get(),
NS_ConvertUTF16toUTF8(dispValU).get());
}
}
#endif
NS_IMETHODIMP NS_IMETHODIMP
nsNSSCertificate::GetASN1Structure(nsIASN1Object** aASN1Structure) nsNSSCertificate::GetASN1Structure(nsIASN1Object** aASN1Structure)
{ {
nsNSSShutDownPreventionLock locker;
nsresult rv = NS_OK;
NS_ENSURE_ARG_POINTER(aASN1Structure); NS_ENSURE_ARG_POINTER(aASN1Structure);
// First create the recursive structure os ASN1Objects return CreateASN1Struct(aASN1Structure);
// which tells us the layout of the cert.
rv = CreateASN1Struct(aASN1Structure);
if (NS_FAILED(rv)) {
return rv;
}
#ifdef DEBUG_javi
DumpASN1Object(*aASN1Structure, 0);
#endif
return rv;
} }
NS_IMETHODIMP NS_IMETHODIMP