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

Unified Diff: crypto/ec_signature_creator_nss.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_impl.h ('k') | crypto/ec_signature_creator_openssl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/ec_signature_creator_nss.cc
diff --git a/crypto/ec_signature_creator_nss.cc b/crypto/ec_signature_creator_nss.cc
index 06a0ad5b25f4a191d14169055ffaea3217da0727..7c8cc7df55c73175a5d394102efc6fe2ea28771e 100644
--- a/crypto/ec_signature_creator_nss.cc
+++ b/crypto/ec_signature_creator_nss.cc
@@ -9,6 +9,8 @@
#include <secerr.h>
#include <sechash.h>
#if defined(OS_POSIX)
+#include <stddef.h>
+#include <stdint.h>
#include <unistd.h>
#endif
@@ -32,7 +34,7 @@ SECStatus SignData(SECItem* result,
}
// Hash the input.
- std::vector<uint8> hash_data(HASH_ResultLen(hash_type));
+ std::vector<uint8_t> hash_data(HASH_ResultLen(hash_type));
SECStatus rv = HASH_HashBuf(
hash_type, &hash_data[0], input->data, input->len);
if (rv != SECSuccess)
@@ -42,7 +44,7 @@ SECStatus SignData(SECItem* result,
// Compute signature of hash.
int signature_len = PK11_SignatureLen(key);
- std::vector<uint8> signature_data(signature_len);
+ std::vector<uint8_t> signature_data(signature_len);
SECItem sig = {siBuffer, &signature_data[0],
static_cast<unsigned int>(signature_len)};
rv = PK11_Sign(key, &sig, &hash);
@@ -62,9 +64,9 @@ ECSignatureCreatorImpl::ECSignatureCreatorImpl(ECPrivateKey* key)
ECSignatureCreatorImpl::~ECSignatureCreatorImpl() {}
-bool ECSignatureCreatorImpl::Sign(const uint8* data,
+bool ECSignatureCreatorImpl::Sign(const uint8_t* data,
int data_len,
- std::vector<uint8>* signature) {
+ std::vector<uint8_t>* signature) {
// Data to be signed
SECItem secret;
secret.type = siBuffer;
@@ -92,12 +94,12 @@ bool ECSignatureCreatorImpl::Sign(const uint8* data,
}
bool ECSignatureCreatorImpl::DecodeSignature(
- const std::vector<uint8>& der_sig,
- std::vector<uint8>* out_raw_sig) {
+ const std::vector<uint8_t>& der_sig,
+ std::vector<uint8_t>* out_raw_sig) {
SECItem der_sig_item;
der_sig_item.type = siBuffer;
der_sig_item.len = der_sig.size();
- der_sig_item.data = const_cast<uint8*>(&der_sig[0]);
+ der_sig_item.data = const_cast<uint8_t*>(&der_sig[0]);
size_t signature_len = SECKEY_SignatureLen(key_->public_key());
if (signature_len == 0)
« no previous file with comments | « crypto/ec_signature_creator_impl.h ('k') | crypto/ec_signature_creator_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698