Closed Bug 1048070 Opened 11 years ago Closed 11 years ago

Remove uses of NSPR macros from non-NSS-specific parts of mozilla::pkix

Categories

(Core :: Security: PSM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: briansmith, Assigned: briansmith)

Details

Attachments

(2 files, 1 obsolete file)

Note that in this patch, I intentionally didn't change pkixnss.cpp, the NSS-based test code, or the NSS-based name constraint code, because that code uses PR_SetError/SECStatus instead of mozilla::pkix::Result.
Attachment #8466843 - Flags: review?(dkeeler)
Attachment #8466843 - Attachment is obsolete: true
Attachment #8466843 - Flags: review?(dkeeler)
Attachment #8466845 - Flags: review?(dkeeler)
Comment on attachment 8466842 [details] [diff] [review] Part 1: Replace uses of PR_ASSERT with uses of standard assert Review of attachment 8466842 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me in general. One question: pkixtestutil.cpp is fairly NSS-heavy - shouldn't we keep using PR_ASSERT there? ::: security/pkix/test/gtest/pkixocsp_VerifyEncodedOCSPResponse.cpp @@ +391,5 @@ > const char* signerName, > SECOidTag signerEKU = SEC_OID_OCSP_RESPONDER, > /*optional, out*/ Input* signerDEROut = nullptr) > { > + assert(certSubjectName); Don't we want some sort of gtest macro here?
Attachment #8466842 - Flags: review?(dkeeler) → review+
Comment on attachment 8466845 [details] [diff] [review] Part 2: Replace uses of PR_NOT_REACHED and PR_ARRAY_SIZE Review of attachment 8466845 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. ::: security/pkix/lib/pkixder.h @@ -36,5 @@ > // Skip* functions unconditionally advance the input mark and return Success if > // they are able to do so; otherwise they fail with the input mark in an > // undefined state. > > -#include <cassert> wait what? Wasn't this added in the previous patch? Oh, I see - I guess it was moved to Result.h? Sounds good.
Attachment #8466845 - Flags: review?(dkeeler) → review+
Comment on attachment 8466842 [details] [diff] [review] Part 1: Replace uses of PR_ASSERT with uses of standard assert Review of attachment 8466842 [details] [diff] [review]: ----------------------------------------------------------------- In pkixtestutil.cpp, I have been removing the NSS dependencies too. My goal is for the test suite to work in the same way as the rest of mozilla::pkix--you plug in a crypto implementation for generating keys and signing and the rest is portable. So, I think it would be better to just keep the pkixtestutil.cpp changes. ::: security/pkix/test/gtest/pkixocsp_VerifyEncodedOCSPResponse.cpp @@ +391,5 @@ > const char* signerName, > SECOidTag signerEKU = SEC_OID_OCSP_RESPONDER, > /*optional, out*/ Input* signerDEROut = nullptr) > { > + assert(certSubjectName); If an assertion was OK before, it should be OK now. Though, it is strange that we assert(certSubjectName) but not assert(signerName) even though signerName isn't documented as being /*optional*/. Will make that consistent, at least.
Comment on attachment 8466842 [details] [diff] [review] Part 1: Replace uses of PR_ASSERT with uses of standard assert Review of attachment 8466842 [details] [diff] [review]: ----------------------------------------------------------------- ::: security/pkix/test/gtest/pkixocsp_VerifyEncodedOCSPResponse.cpp @@ +391,5 @@ > const char* signerName, > SECOidTag signerEKU = SEC_OID_OCSP_RESPONDER, > /*optional, out*/ Input* signerDEROut = nullptr) > { > + assert(certSubjectName); I checked this, and signerName is not marked /*optional*/ because the caller is supposed to pass |byKey| (an alias for nullptr) or a non-null char*. A little confusing but marking it /*optional*/ would be more confusing. So, I won't change anything here.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: