зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1063013, Part 3: Move dependencies on pkixnss to pkixtestnss, r=keeler
--HG-- rename : security/pkix/test/lib/pkixtestutil.cpp => security/pkix/test/lib/pkixtestnss.cpp extra : rebase_source : b22bd341a5c72ba87efcf23a4e048bba8adf1544
This commit is contained in:
Родитель
18c10a4998
Коммит
030872a85c
|
@ -185,7 +185,7 @@ private:
|
|||
|
||||
virtual Result CheckPublicKey(Input subjectPublicKeyInfo)
|
||||
{
|
||||
return ::mozilla::pkix::CheckPublicKey(subjectPublicKeyInfo);
|
||||
return TestCheckPublicKey(subjectPublicKeyInfo);
|
||||
}
|
||||
|
||||
// We hold references to CERTCertificates in the cert chain tail so that we
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
#include "nssgtest.h"
|
||||
#include "pkix/pkix.h"
|
||||
#include "pkix/pkixnss.h"
|
||||
#include "pkixtestutil.h"
|
||||
|
||||
using namespace mozilla::pkix;
|
||||
|
@ -96,8 +95,7 @@ private:
|
|||
virtual Result VerifySignedData(const SignedDataWithSignature& signedData,
|
||||
Input subjectPublicKeyInfo)
|
||||
{
|
||||
return ::mozilla::pkix::VerifySignedData(signedData, subjectPublicKeyInfo,
|
||||
nullptr);
|
||||
return TestVerifySignedData(signedData, subjectPublicKeyInfo);
|
||||
}
|
||||
|
||||
virtual Result DigestBuf(Input, /*out*/ uint8_t*, size_t)
|
||||
|
@ -108,7 +106,7 @@ private:
|
|||
|
||||
virtual Result CheckPublicKey(Input subjectPublicKeyInfo)
|
||||
{
|
||||
return ::mozilla::pkix::CheckPublicKey(subjectPublicKeyInfo);
|
||||
return TestCheckPublicKey(subjectPublicKeyInfo);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
*/
|
||||
|
||||
#include "nssgtest.h"
|
||||
#include "pkix/pkixnss.h"
|
||||
#include "pkix/pkix.h"
|
||||
#include "pkixder.h"
|
||||
#include "pkixtestutil.h"
|
||||
|
@ -70,7 +69,7 @@ private:
|
|||
virtual Result DigestBuf(Input item, /*out*/ uint8_t *digestBuf,
|
||||
size_t digestBufLen)
|
||||
{
|
||||
return ::mozilla::pkix::DigestBuf(item, digestBuf, digestBufLen);
|
||||
return TestDigestBuf(item, digestBuf, digestBufLen);
|
||||
}
|
||||
|
||||
virtual Result CheckPublicKey(Input subjectPublicKeyInfo)
|
||||
|
|
|
@ -73,19 +73,18 @@ public:
|
|||
virtual Result VerifySignedData(const SignedDataWithSignature& signedData,
|
||||
Input subjectPublicKeyInfo)
|
||||
{
|
||||
return ::mozilla::pkix::VerifySignedData(signedData, subjectPublicKeyInfo,
|
||||
nullptr);
|
||||
return TestVerifySignedData(signedData, subjectPublicKeyInfo);
|
||||
}
|
||||
|
||||
virtual Result DigestBuf(Input item, /*out*/ uint8_t *digestBuf,
|
||||
size_t digestBufLen)
|
||||
{
|
||||
return ::mozilla::pkix::DigestBuf(item, digestBuf, digestBufLen);
|
||||
return TestDigestBuf(item, digestBuf, digestBufLen);
|
||||
}
|
||||
|
||||
virtual Result CheckPublicKey(Input subjectPublicKeyInfo)
|
||||
{
|
||||
return ::mozilla::pkix::CheckPublicKey(subjectPublicKeyInfo);
|
||||
return TestCheckPublicKey(subjectPublicKeyInfo);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -181,4 +181,23 @@ SHA1(const ByteString& toHash)
|
|||
return ByteString(digestBuf, sizeof(digestBuf));
|
||||
}
|
||||
|
||||
Result
|
||||
TestCheckPublicKey(Input subjectPublicKeyInfo)
|
||||
{
|
||||
return CheckPublicKey(subjectPublicKeyInfo);
|
||||
}
|
||||
|
||||
Result
|
||||
TestVerifySignedData(const SignedDataWithSignature& signedData,
|
||||
Input subjectPublicKeyInfo)
|
||||
{
|
||||
return VerifySignedData(signedData, subjectPublicKeyInfo, nullptr);
|
||||
}
|
||||
|
||||
Result
|
||||
TestDigestBuf(Input item, /*out*/ uint8_t* digestBuf, size_t digestBufLen)
|
||||
{
|
||||
return DigestBuf(item, digestBuf, digestBufLen);
|
||||
}
|
||||
|
||||
} } } // namespace mozilla::pkix::test
|
||||
|
|
|
@ -130,6 +130,12 @@ typedef ScopedPtr<TestKeyPair, DeleteTestKeyPair> ScopedTestKeyPair;
|
|||
|
||||
ByteString SHA1(const ByteString& toHash);
|
||||
|
||||
Result TestCheckPublicKey(Input subjectPublicKeyInfo);
|
||||
Result TestVerifySignedData(const SignedDataWithSignature& signedData,
|
||||
Input subjectPublicKeyInfo);
|
||||
Result TestDigestBuf(Input item, /*out*/ uint8_t* digestBuf,
|
||||
size_t digestBufLen);
|
||||
|
||||
// Replace one substring in item with another of the same length, but only if
|
||||
// the substring was found exactly once. The "same length" restriction is
|
||||
// useful for avoiding invalidating lengths encoded within the item. The
|
||||
|
|
Загрузка…
Ссылка в новой задаче