Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Unified Diff: crypto/ec_signature_creator_unittest.cc

Issue 1539353003: Switch to standard integer types in crypto/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « crypto/ec_signature_creator_openssl.cc ('k') | crypto/encryptor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/ec_signature_creator_unittest.cc
diff --git a/crypto/ec_signature_creator_unittest.cc b/crypto/ec_signature_creator_unittest.cc
index 2a40cfe0c12a40f93dfa7f4db51f779de18b8663..36c850a9bf64aed45ef02208c0fc2ff3694acc14 100644
--- a/crypto/ec_signature_creator_unittest.cc
+++ b/crypto/ec_signature_creator_unittest.cc
@@ -4,6 +4,8 @@
#include "crypto/ec_signature_creator.h"
+#include <stdint.h>
+
#include <string>
#include <vector>
@@ -21,10 +23,10 @@ TEST(ECSignatureCreatorTest, BasicTest) {
crypto::ECPrivateKey::Create());
ASSERT_TRUE(key_original.get());
- std::vector<uint8> key_info;
+ std::vector<uint8_t> key_info;
ASSERT_TRUE(
key_original->ExportEncryptedPrivateKey(std::string(), 1000, &key_info));
- std::vector<uint8> pubkey_info;
+ std::vector<uint8_t> pubkey_info;
ASSERT_TRUE(key_original->ExportPublicKey(&pubkey_info));
scoped_ptr<crypto::ECPrivateKey> key(
@@ -38,12 +40,11 @@ TEST(ECSignatureCreatorTest, BasicTest) {
ASSERT_TRUE(signer.get());
std::string data("Hello, World!");
- std::vector<uint8> signature;
- ASSERT_TRUE(signer->Sign(reinterpret_cast<const uint8*>(data.c_str()),
- data.size(),
- &signature));
+ std::vector<uint8_t> signature;
+ ASSERT_TRUE(signer->Sign(reinterpret_cast<const uint8_t*>(data.c_str()),
+ data.size(), &signature));
- std::vector<uint8> public_key_info;
+ std::vector<uint8_t> public_key_info;
ASSERT_TRUE(key_original->ExportPublicKey(&public_key_info));
// This is the algorithm ID for ECDSA with SHA-256. Parameters are ABSENT.
@@ -58,10 +59,8 @@ TEST(ECSignatureCreatorTest, BasicTest) {
// component, the OID ecdsa-with-SHA224, ecdsa-with-SHA256, ecdsa-with-
// SHA384, or ecdsa-with-SHA512.
// See also RFC 5480, Appendix A.
- const uint8 kECDSAWithSHA256AlgorithmID[] = {
- 0x30, 0x0a,
- 0x06, 0x08,
- 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02,
+ const uint8_t kECDSAWithSHA256AlgorithmID[] = {
+ 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02,
};
crypto::SignatureVerifier verifier;
ASSERT_TRUE(verifier.VerifyInit(
@@ -69,7 +68,7 @@ TEST(ECSignatureCreatorTest, BasicTest) {
&signature[0], signature.size(),
&public_key_info.front(), public_key_info.size()));
- verifier.VerifyUpdate(reinterpret_cast<const uint8*>(data.c_str()),
+ verifier.VerifyUpdate(reinterpret_cast<const uint8_t*>(data.c_str()),
data.size());
ASSERT_TRUE(verifier.VerifyFinal());
}
« no previous file with comments | « crypto/ec_signature_creator_openssl.cc ('k') | crypto/encryptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698