Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Langley <agl@google.com>2016-07-12 18:09:33 +0300
committerAdam Langley <agl@google.com>2016-07-12 18:09:33 +0300
commit10f97f3bfcecc3fbe8e9f02e7c426f7e340f7f54 (patch)
tree3a23df61db5dc580eeb23916bf8955f5fcedc6cd /crypto/rsa
parentd2b5af56cf2a8b4695821b2ff64a7bfc82f3ba5e (diff)
Revert "Move C++ helpers into |bssl| namespace."
This reverts commit 09feb0f3d95a2bc58ce0faaf14256d3bd30f52a4. (In order to make WebRTC happy this also needs to be reverted.)
Diffstat (limited to 'crypto/rsa')
-rw-r--r--crypto/rsa/rsa_test.cc50
1 files changed, 23 insertions, 27 deletions
diff --git a/crypto/rsa/rsa_test.cc b/crypto/rsa/rsa_test.cc
index 5307f2cb..62177a4c 100644
--- a/crypto/rsa/rsa_test.cc
+++ b/crypto/rsa/rsa_test.cc
@@ -523,8 +523,6 @@ static const uint8_t kExponent1RSAKey[] = {
0xdd, 0x02, 0x01, 0x01,
};
-namespace bssl {
-
static bool TestRSA(const uint8_t *der, size_t der_len,
const uint8_t *oaep_ciphertext,
size_t oaep_ciphertext_len) {
@@ -857,7 +855,7 @@ static bool TestASN1() {
if (!RSA_private_key_to_bytes(&der, &der_len, rsa.get())) {
return false;
}
- ScopedBytes delete_der(der);
+ ScopedOpenSSLBytes delete_der(der);
if (der_len != sizeof(kKey1) - 1 || memcmp(der, kKey1, der_len) != 0) {
return false;
}
@@ -880,7 +878,7 @@ static bool TestASN1() {
if (!RSA_public_key_to_bytes(&der2, &der2_len, rsa.get())) {
return false;
}
- ScopedBytes delete_der2(der2);
+ ScopedOpenSSLBytes delete_der2(der2);
if (der_len != der2_len || memcmp(der, der2, der_len) != 0) {
return false;
}
@@ -924,32 +922,30 @@ static bool TestBadExponent() {
return true;
}
-} // namespace bssl
-
int main(int argc, char *argv[]) {
CRYPTO_library_init();
- if (!bssl::TestRSA(kKey1, sizeof(kKey1) - 1, kOAEPCiphertext1,
- sizeof(kOAEPCiphertext1) - 1) ||
- !bssl::TestRSA(kKey2, sizeof(kKey2) - 1, kOAEPCiphertext2,
- sizeof(kOAEPCiphertext2) - 1) ||
- !bssl::TestRSA(kKey3, sizeof(kKey3) - 1, kOAEPCiphertext3,
- sizeof(kOAEPCiphertext3) - 1) ||
- !bssl::TestOnlyDGiven() ||
- !bssl::TestRecoverCRTParams() ||
- !bssl::TestBadKey() ||
- !bssl::TestMultiPrimeKey(2, kTwoPrimeKey, sizeof(kTwoPrimeKey) - 1,
- kTwoPrimeEncryptedMessage,
- sizeof(kTwoPrimeEncryptedMessage)) ||
- !bssl::TestMultiPrimeKey(3, kThreePrimeKey, sizeof(kThreePrimeKey) - 1,
- kThreePrimeEncryptedMessage,
- sizeof(kThreePrimeEncryptedMessage)) ||
- !bssl::TestMultiPrimeKey(6, kSixPrimeKey, sizeof(kSixPrimeKey) - 1,
- kSixPrimeEncryptedMessage,
- sizeof(kSixPrimeEncryptedMessage)) ||
- !bssl::TestMultiPrimeKeygen() ||
- !bssl::TestASN1() ||
- !bssl::TestBadExponent()) {
+ if (!TestRSA(kKey1, sizeof(kKey1) - 1, kOAEPCiphertext1,
+ sizeof(kOAEPCiphertext1) - 1) ||
+ !TestRSA(kKey2, sizeof(kKey2) - 1, kOAEPCiphertext2,
+ sizeof(kOAEPCiphertext2) - 1) ||
+ !TestRSA(kKey3, sizeof(kKey3) - 1, kOAEPCiphertext3,
+ sizeof(kOAEPCiphertext3) - 1) ||
+ !TestOnlyDGiven() ||
+ !TestRecoverCRTParams() ||
+ !TestBadKey() ||
+ !TestMultiPrimeKey(2, kTwoPrimeKey, sizeof(kTwoPrimeKey) - 1,
+ kTwoPrimeEncryptedMessage,
+ sizeof(kTwoPrimeEncryptedMessage)) ||
+ !TestMultiPrimeKey(3, kThreePrimeKey, sizeof(kThreePrimeKey) - 1,
+ kThreePrimeEncryptedMessage,
+ sizeof(kThreePrimeEncryptedMessage)) ||
+ !TestMultiPrimeKey(6, kSixPrimeKey, sizeof(kSixPrimeKey) - 1,
+ kSixPrimeEncryptedMessage,
+ sizeof(kSixPrimeEncryptedMessage)) ||
+ !TestMultiPrimeKeygen() ||
+ !TestASN1() ||
+ !TestBadExponent()) {
return 1;
}