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

Unified Diff: crypto/ec_signature_creator_openssl.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_nss.cc ('k') | crypto/ec_signature_creator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/ec_signature_creator_openssl.cc
diff --git a/crypto/ec_signature_creator_openssl.cc b/crypto/ec_signature_creator_openssl.cc
index 30343a72592ed4216c980264832dac088cd76a27..e9c39b7c585f32cda7c875013ad9a72913993dd7 100644
--- a/crypto/ec_signature_creator_openssl.cc
+++ b/crypto/ec_signature_creator_openssl.cc
@@ -9,6 +9,8 @@
#include <openssl/ecdsa.h>
#include <openssl/evp.h>
#include <openssl/sha.h>
+#include <stddef.h>
+#include <stdint.h>
#include "base/logging.h"
#include "crypto/ec_private_key.h"
@@ -24,9 +26,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) {
OpenSSLErrStackTracer err_tracer(FROM_HERE);
ScopedEVP_MD_CTX ctx(EVP_MD_CTX_create());
size_t sig_len = 0;
@@ -48,8 +50,9 @@ bool ECSignatureCreatorImpl::Sign(const uint8* data,
return true;
}
-bool ECSignatureCreatorImpl::DecodeSignature(const std::vector<uint8>& der_sig,
- std::vector<uint8>* out_raw_sig) {
+bool ECSignatureCreatorImpl::DecodeSignature(
+ const std::vector<uint8_t>& der_sig,
+ std::vector<uint8_t>* out_raw_sig) {
OpenSSLErrStackTracer err_tracer(FROM_HERE);
// Create ECDSA_SIG object from DER-encoded data.
const unsigned char* der_data = &der_sig.front();
@@ -60,7 +63,7 @@ bool ECSignatureCreatorImpl::DecodeSignature(const std::vector<uint8>& der_sig,
// The result is made of two 32-byte vectors.
const size_t kMaxBytesPerBN = 32;
- std::vector<uint8> result(2 * kMaxBytesPerBN);
+ std::vector<uint8_t> result(2 * kMaxBytesPerBN);
if (!BN_bn2bin_padded(&result[0], kMaxBytesPerBN, ecdsa_sig->r) ||
!BN_bn2bin_padded(&result[kMaxBytesPerBN], kMaxBytesPerBN,
« no previous file with comments | « crypto/ec_signature_creator_nss.cc ('k') | crypto/ec_signature_creator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698