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:
Brian Smith 2014-08-31 19:16:26 -07:00
Родитель 18c10a4998
Коммит 030872a85c
6 изменённых файлов: 32 добавлений и 11 удалений

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

@ -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