Commit 53b6c9d2 authored by eroman@chromium.org's avatar eroman@chromium.org

Replace uses of uint8 with uint8_t.

This changelist was generated automatically by:

 sed -i 's/\<uint8>\>/s

BUG=394944

Review URL: https://codereview.chromium.org/404733005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284319 0039d316-1c4b-4281-b951-d872f2087c98
parent 2981c2d8
...@@ -22,7 +22,7 @@ namespace { ...@@ -22,7 +22,7 @@ namespace {
Status DecryptDontCheckKeyUsage(const blink::WebCryptoAlgorithm& algorithm, Status DecryptDontCheckKeyUsage(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) { std::vector<uint8_t>* buffer) {
if (algorithm.id() != key.algorithm().id()) if (algorithm.id() != key.algorithm().id())
return Status::ErrorUnexpected(); return Status::ErrorUnexpected();
...@@ -37,7 +37,7 @@ Status DecryptDontCheckKeyUsage(const blink::WebCryptoAlgorithm& algorithm, ...@@ -37,7 +37,7 @@ Status DecryptDontCheckKeyUsage(const blink::WebCryptoAlgorithm& algorithm,
Status EncryptDontCheckUsage(const blink::WebCryptoAlgorithm& algorithm, Status EncryptDontCheckUsage(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) { std::vector<uint8_t>* buffer) {
if (algorithm.id() != key.algorithm().id()) if (algorithm.id() != key.algorithm().id())
return Status::ErrorUnexpected(); return Status::ErrorUnexpected();
...@@ -51,7 +51,7 @@ Status EncryptDontCheckUsage(const blink::WebCryptoAlgorithm& algorithm, ...@@ -51,7 +51,7 @@ Status EncryptDontCheckUsage(const blink::WebCryptoAlgorithm& algorithm,
Status ExportKeyDontCheckExtractability(blink::WebCryptoKeyFormat format, Status ExportKeyDontCheckExtractability(blink::WebCryptoKeyFormat format,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) { std::vector<uint8_t>* buffer) {
const AlgorithmImplementation* impl = NULL; const AlgorithmImplementation* impl = NULL;
Status status = GetAlgorithmImplementation(key.algorithm().id(), &impl); Status status = GetAlgorithmImplementation(key.algorithm().id(), &impl);
if (status.IsError()) if (status.IsError())
...@@ -76,7 +76,7 @@ Status ExportKeyDontCheckExtractability(blink::WebCryptoKeyFormat format, ...@@ -76,7 +76,7 @@ Status ExportKeyDontCheckExtractability(blink::WebCryptoKeyFormat format,
Status Encrypt(const blink::WebCryptoAlgorithm& algorithm, Status Encrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) { std::vector<uint8_t>* buffer) {
if (!KeyUsageAllows(key, blink::WebCryptoKeyUsageEncrypt)) if (!KeyUsageAllows(key, blink::WebCryptoKeyUsageEncrypt))
return Status::ErrorUnexpected(); return Status::ErrorUnexpected();
return EncryptDontCheckUsage(algorithm, key, data, buffer); return EncryptDontCheckUsage(algorithm, key, data, buffer);
...@@ -85,7 +85,7 @@ Status Encrypt(const blink::WebCryptoAlgorithm& algorithm, ...@@ -85,7 +85,7 @@ Status Encrypt(const blink::WebCryptoAlgorithm& algorithm,
Status Decrypt(const blink::WebCryptoAlgorithm& algorithm, Status Decrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) { std::vector<uint8_t>* buffer) {
if (!KeyUsageAllows(key, blink::WebCryptoKeyUsageDecrypt)) if (!KeyUsageAllows(key, blink::WebCryptoKeyUsageDecrypt))
return Status::ErrorUnexpected(); return Status::ErrorUnexpected();
return DecryptDontCheckKeyUsage(algorithm, key, data, buffer); return DecryptDontCheckKeyUsage(algorithm, key, data, buffer);
...@@ -93,7 +93,7 @@ Status Decrypt(const blink::WebCryptoAlgorithm& algorithm, ...@@ -93,7 +93,7 @@ Status Decrypt(const blink::WebCryptoAlgorithm& algorithm,
Status Digest(const blink::WebCryptoAlgorithm& algorithm, Status Digest(const blink::WebCryptoAlgorithm& algorithm,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) { std::vector<uint8_t>* buffer) {
const AlgorithmImplementation* impl = NULL; const AlgorithmImplementation* impl = NULL;
Status status = GetAlgorithmImplementation(algorithm.id(), &impl); Status status = GetAlgorithmImplementation(algorithm.id(), &impl);
if (status.IsError()) if (status.IsError())
...@@ -179,7 +179,7 @@ Status ImportKey(blink::WebCryptoKeyFormat format, ...@@ -179,7 +179,7 @@ Status ImportKey(blink::WebCryptoKeyFormat format,
Status ExportKey(blink::WebCryptoKeyFormat format, Status ExportKey(blink::WebCryptoKeyFormat format,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) { std::vector<uint8_t>* buffer) {
if (!key.extractable()) if (!key.extractable())
return Status::ErrorKeyNotExtractable(); return Status::ErrorKeyNotExtractable();
return ExportKeyDontCheckExtractability(format, key, buffer); return ExportKeyDontCheckExtractability(format, key, buffer);
...@@ -188,7 +188,7 @@ Status ExportKey(blink::WebCryptoKeyFormat format, ...@@ -188,7 +188,7 @@ Status ExportKey(blink::WebCryptoKeyFormat format,
Status Sign(const blink::WebCryptoAlgorithm& algorithm, Status Sign(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) { std::vector<uint8_t>* buffer) {
if (!KeyUsageAllows(key, blink::WebCryptoKeyUsageSign)) if (!KeyUsageAllows(key, blink::WebCryptoKeyUsageSign))
return Status::ErrorUnexpected(); return Status::ErrorUnexpected();
if (algorithm.id() != key.algorithm().id()) if (algorithm.id() != key.algorithm().id())
...@@ -233,11 +233,11 @@ Status WrapKey(blink::WebCryptoKeyFormat format, ...@@ -233,11 +233,11 @@ Status WrapKey(blink::WebCryptoKeyFormat format,
const blink::WebCryptoKey& key_to_wrap, const blink::WebCryptoKey& key_to_wrap,
const blink::WebCryptoKey& wrapping_key, const blink::WebCryptoKey& wrapping_key,
const blink::WebCryptoAlgorithm& wrapping_algorithm, const blink::WebCryptoAlgorithm& wrapping_algorithm,
std::vector<uint8>* buffer) { std::vector<uint8_t>* buffer) {
if (!KeyUsageAllows(wrapping_key, blink::WebCryptoKeyUsageWrapKey)) if (!KeyUsageAllows(wrapping_key, blink::WebCryptoKeyUsageWrapKey))
return Status::ErrorUnexpected(); return Status::ErrorUnexpected();
std::vector<uint8> exported_data; std::vector<uint8_t> exported_data;
Status status = ExportKey(format, key_to_wrap, &exported_data); Status status = ExportKey(format, key_to_wrap, &exported_data);
if (status.IsError()) if (status.IsError())
return status; return status;
...@@ -268,7 +268,7 @@ Status UnwrapKey(blink::WebCryptoKeyFormat format, ...@@ -268,7 +268,7 @@ Status UnwrapKey(blink::WebCryptoKeyFormat format,
if (status.IsError()) if (status.IsError())
return status; return status;
std::vector<uint8> buffer; std::vector<uint8_t> buffer;
status = DecryptDontCheckKeyUsage( status = DecryptDontCheckKeyUsage(
wrapping_algorithm, wrapping_key, wrapped_key_data, &buffer); wrapping_algorithm, wrapping_key, wrapped_key_data, &buffer);
if (status.IsError()) if (status.IsError())
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
#ifndef CONTENT_CHILD_WEBCRYPTO_ALGORITHM_DISPATCH_H_ #ifndef CONTENT_CHILD_WEBCRYPTO_ALGORITHM_DISPATCH_H_
#define CONTENT_CHILD_WEBCRYPTO_ALGORITHM_DISPATCH_H_ #define CONTENT_CHILD_WEBCRYPTO_ALGORITHM_DISPATCH_H_
#include <stdint.h>
#include <vector> #include <vector>
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "content/common/content_export.h" #include "content/common/content_export.h"
#include "third_party/WebKit/public/platform/WebCrypto.h" #include "third_party/WebKit/public/platform/WebCrypto.h"
...@@ -31,16 +31,16 @@ class Status; ...@@ -31,16 +31,16 @@ class Status;
CONTENT_EXPORT Status Encrypt(const blink::WebCryptoAlgorithm& algorithm, CONTENT_EXPORT Status Encrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer); std::vector<uint8_t>* buffer);
CONTENT_EXPORT Status Decrypt(const blink::WebCryptoAlgorithm& algorithm, CONTENT_EXPORT Status Decrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer); std::vector<uint8_t>* buffer);
CONTENT_EXPORT Status Digest(const blink::WebCryptoAlgorithm& algorithm, CONTENT_EXPORT Status Digest(const blink::WebCryptoAlgorithm& algorithm,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer); std::vector<uint8_t>* buffer);
CONTENT_EXPORT Status CONTENT_EXPORT Status
GenerateSecretKey(const blink::WebCryptoAlgorithm& algorithm, GenerateSecretKey(const blink::WebCryptoAlgorithm& algorithm,
...@@ -64,12 +64,12 @@ CONTENT_EXPORT Status ImportKey(blink::WebCryptoKeyFormat format, ...@@ -64,12 +64,12 @@ CONTENT_EXPORT Status ImportKey(blink::WebCryptoKeyFormat format,
CONTENT_EXPORT Status ExportKey(blink::WebCryptoKeyFormat format, CONTENT_EXPORT Status ExportKey(blink::WebCryptoKeyFormat format,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
std::vector<uint8>* buffer); std::vector<uint8_t>* buffer);
CONTENT_EXPORT Status Sign(const blink::WebCryptoAlgorithm& algorithm, CONTENT_EXPORT Status Sign(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer); std::vector<uint8_t>* buffer);
CONTENT_EXPORT Status Verify(const blink::WebCryptoAlgorithm& algorithm, CONTENT_EXPORT Status Verify(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
...@@ -82,7 +82,7 @@ CONTENT_EXPORT Status ...@@ -82,7 +82,7 @@ CONTENT_EXPORT Status
const blink::WebCryptoKey& key_to_wrap, const blink::WebCryptoKey& key_to_wrap,
const blink::WebCryptoKey& wrapping_key, const blink::WebCryptoKey& wrapping_key,
const blink::WebCryptoAlgorithm& wrapping_algorithm, const blink::WebCryptoAlgorithm& wrapping_algorithm,
std::vector<uint8>* buffer); std::vector<uint8_t>* buffer);
CONTENT_EXPORT Status CONTENT_EXPORT Status
UnwrapKey(blink::WebCryptoKeyFormat format, UnwrapKey(blink::WebCryptoKeyFormat format,
......
...@@ -17,7 +17,7 @@ Status AlgorithmImplementation::Encrypt( ...@@ -17,7 +17,7 @@ Status AlgorithmImplementation::Encrypt(
const blink::WebCryptoAlgorithm& algorithm, const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const { std::vector<uint8_t>* buffer) const {
return Status::ErrorUnsupported(); return Status::ErrorUnsupported();
} }
...@@ -25,14 +25,14 @@ Status AlgorithmImplementation::Decrypt( ...@@ -25,14 +25,14 @@ Status AlgorithmImplementation::Decrypt(
const blink::WebCryptoAlgorithm& algorithm, const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const { std::vector<uint8_t>* buffer) const {
return Status::ErrorUnsupported(); return Status::ErrorUnsupported();
} }
Status AlgorithmImplementation::Sign(const blink::WebCryptoAlgorithm& algorithm, Status AlgorithmImplementation::Sign(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const { std::vector<uint8_t>* buffer) const {
return Status::ErrorUnsupported(); return Status::ErrorUnsupported();
} }
...@@ -48,7 +48,7 @@ Status AlgorithmImplementation::Verify( ...@@ -48,7 +48,7 @@ Status AlgorithmImplementation::Verify(
Status AlgorithmImplementation::Digest( Status AlgorithmImplementation::Digest(
const blink::WebCryptoAlgorithm& algorithm, const blink::WebCryptoAlgorithm& algorithm,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const { std::vector<uint8_t>* buffer) const {
return Status::ErrorUnsupported(); return Status::ErrorUnsupported();
} }
...@@ -125,25 +125,27 @@ Status AlgorithmImplementation::ImportKeyJwk( ...@@ -125,25 +125,27 @@ Status AlgorithmImplementation::ImportKeyJwk(
return Status::ErrorUnsupportedImportKeyFormat(); return Status::ErrorUnsupportedImportKeyFormat();
} }
Status AlgorithmImplementation::ExportKeyRaw(const blink::WebCryptoKey& key, Status AlgorithmImplementation::ExportKeyRaw(
std::vector<uint8>* buffer) const { const blink::WebCryptoKey& key,
std::vector<uint8_t>* buffer) const {
return Status::ErrorUnsupportedExportKeyFormat(); return Status::ErrorUnsupportedExportKeyFormat();
} }
Status AlgorithmImplementation::ExportKeyPkcs8( Status AlgorithmImplementation::ExportKeyPkcs8(
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const { std::vector<uint8_t>* buffer) const {
return Status::ErrorUnsupportedExportKeyFormat(); return Status::ErrorUnsupportedExportKeyFormat();
} }
Status AlgorithmImplementation::ExportKeySpki( Status AlgorithmImplementation::ExportKeySpki(
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const { std::vector<uint8_t>* buffer) const {
return Status::ErrorUnsupportedExportKeyFormat(); return Status::ErrorUnsupportedExportKeyFormat();
} }
Status AlgorithmImplementation::ExportKeyJwk(const blink::WebCryptoKey& key, Status AlgorithmImplementation::ExportKeyJwk(
std::vector<uint8>* buffer) const { const blink::WebCryptoKey& key,
std::vector<uint8_t>* buffer) const {
return Status::ErrorUnsupportedExportKeyFormat(); return Status::ErrorUnsupportedExportKeyFormat();
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef CONTENT_CHILD_WEBCRYPTO_CRYPTO_ALGORITHM_IMPLEMENTATION_H_ #ifndef CONTENT_CHILD_WEBCRYPTO_CRYPTO_ALGORITHM_IMPLEMENTATION_H_
#define CONTENT_CHILD_WEBCRYPTO_CRYPTO_ALGORITHM_IMPLEMENTATION_H_ #define CONTENT_CHILD_WEBCRYPTO_CRYPTO_ALGORITHM_IMPLEMENTATION_H_
#include <stdint.h>
#include <vector> #include <vector>
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
...@@ -44,19 +45,19 @@ class AlgorithmImplementation { ...@@ -44,19 +45,19 @@ class AlgorithmImplementation {
virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm, virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const; std::vector<uint8_t>* buffer) const;
// This method corresponds to Web Crypto's crypto.subtle.decrypt(). // This method corresponds to Web Crypto's crypto.subtle.decrypt().
virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm, virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const; std::vector<uint8_t>* buffer) const;
// This method corresponds to Web Crypto's crypto.subtle.sign(). // This method corresponds to Web Crypto's crypto.subtle.sign().
virtual Status Sign(const blink::WebCryptoAlgorithm& algorithm, virtual Status Sign(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const; std::vector<uint8_t>* buffer) const;
// This method corresponds to Web Crypto's crypto.subtle.verify(). // This method corresponds to Web Crypto's crypto.subtle.verify().
virtual Status Verify(const blink::WebCryptoAlgorithm& algorithm, virtual Status Verify(const blink::WebCryptoAlgorithm& algorithm,
...@@ -68,7 +69,7 @@ class AlgorithmImplementation { ...@@ -68,7 +69,7 @@ class AlgorithmImplementation {
// This method corresponds to Web Crypto's crypto.subtle.digest(). // This method corresponds to Web Crypto's crypto.subtle.digest().
virtual Status Digest(const blink::WebCryptoAlgorithm& algorithm, virtual Status Digest(const blink::WebCryptoAlgorithm& algorithm,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const; std::vector<uint8_t>* buffer) const;
// VerifyKeyUsagesBeforeGenerateKey() must be called prior to // VerifyKeyUsagesBeforeGenerateKey() must be called prior to
// GenerateSecretKey() to validate the requested key usages. // GenerateSecretKey() to validate the requested key usages.
...@@ -154,16 +155,16 @@ class AlgorithmImplementation { ...@@ -154,16 +155,16 @@ class AlgorithmImplementation {
// ----------------------------------------------- // -----------------------------------------------
virtual Status ExportKeyRaw(const blink::WebCryptoKey& key, virtual Status ExportKeyRaw(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const; std::vector<uint8_t>* buffer) const;
virtual Status ExportKeyPkcs8(const blink::WebCryptoKey& key, virtual Status ExportKeyPkcs8(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const; std::vector<uint8_t>* buffer) const;
virtual Status ExportKeySpki(const blink::WebCryptoKey& key, virtual Status ExportKeySpki(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const; std::vector<uint8_t>* buffer) const;
virtual Status ExportKeyJwk(const blink::WebCryptoKey& key, virtual Status ExportKeyJwk(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const; std::vector<uint8_t>* buffer) const;
}; };
} // namespace webcrypto } // namespace webcrypto
......
...@@ -241,7 +241,7 @@ class JwkWriter { ...@@ -241,7 +241,7 @@ class JwkWriter {
value.byte_length()))); value.byte_length())));
} }
void ToBytes(std::vector<uint8>* utf8_bytes) { void ToBytes(std::vector<uint8_t>* utf8_bytes) {
std::string json; std::string json;
base::JSONWriter::Write(&dict_, &json); base::JSONWriter::Write(&dict_, &json);
utf8_bytes->assign(json.begin(), json.end()); utf8_bytes->assign(json.begin(), json.end());
...@@ -482,7 +482,7 @@ Status ReadSecretKeyNoExpectedAlg( ...@@ -482,7 +482,7 @@ Status ReadSecretKeyNoExpectedAlg(
const CryptoData& key_data, const CryptoData& key_data,
bool expected_extractable, bool expected_extractable,
blink::WebCryptoKeyUsageMask expected_usage_mask, blink::WebCryptoKeyUsageMask expected_usage_mask,
std::vector<uint8>* raw_key_data, std::vector<uint8_t>* raw_key_data,
scoped_ptr<base::DictionaryValue>* dict) { scoped_ptr<base::DictionaryValue>* dict) {
if (!key_data.byte_length()) if (!key_data.byte_length())
return Status::ErrorImportEmptyKeyData(); return Status::ErrorImportEmptyKeyData();
...@@ -511,7 +511,7 @@ void WriteSecretKeyJwk(const CryptoData& raw_key_data, ...@@ -511,7 +511,7 @@ void WriteSecretKeyJwk(const CryptoData& raw_key_data,
const std::string& algorithm, const std::string& algorithm,
bool extractable, bool extractable,
blink::WebCryptoKeyUsageMask usage_mask, blink::WebCryptoKeyUsageMask usage_mask,
std::vector<uint8>* jwk_key_data) { std::vector<uint8_t>* jwk_key_data) {
JwkWriter writer(algorithm, extractable, usage_mask, "oct"); JwkWriter writer(algorithm, extractable, usage_mask, "oct");
writer.SetBase64Encoded("k", raw_key_data); writer.SetBase64Encoded("k", raw_key_data);
writer.ToBytes(jwk_key_data); writer.ToBytes(jwk_key_data);
...@@ -521,7 +521,7 @@ Status ReadSecretKeyJwk(const CryptoData& key_data, ...@@ -521,7 +521,7 @@ Status ReadSecretKeyJwk(const CryptoData& key_data,
const std::string& expected_algorithm, const std::string& expected_algorithm,
bool expected_extractable, bool expected_extractable,
blink::WebCryptoKeyUsageMask expected_usage_mask, blink::WebCryptoKeyUsageMask expected_usage_mask,
std::vector<uint8>* raw_key_data) { std::vector<uint8_t>* raw_key_data) {
scoped_ptr<base::DictionaryValue> dict; scoped_ptr<base::DictionaryValue> dict;
Status status = ReadSecretKeyNoExpectedAlg( Status status = ReadSecretKeyNoExpectedAlg(
key_data, expected_extractable, expected_usage_mask, raw_key_data, &dict); key_data, expected_extractable, expected_usage_mask, raw_key_data, &dict);
...@@ -545,7 +545,7 @@ Status ReadAesSecretKeyJwk(const CryptoData& key_data, ...@@ -545,7 +545,7 @@ Status ReadAesSecretKeyJwk(const CryptoData& key_data,
const std::string& algorithm_name_suffix, const std::string& algorithm_name_suffix,
bool expected_extractable, bool expected_extractable,
blink::WebCryptoKeyUsageMask expected_usage_mask, blink::WebCryptoKeyUsageMask expected_usage_mask,
std::vector<uint8>* raw_key_data) { std::vector<uint8_t>* raw_key_data) {
scoped_ptr<base::DictionaryValue> dict; scoped_ptr<base::DictionaryValue> dict;
Status status = ReadSecretKeyNoExpectedAlg( Status status = ReadSecretKeyNoExpectedAlg(
key_data, expected_extractable, expected_usage_mask, raw_key_data, &dict); key_data, expected_extractable, expected_usage_mask, raw_key_data, &dict);
...@@ -582,7 +582,7 @@ void WriteRsaPublicKeyJwk(const CryptoData& n, ...@@ -582,7 +582,7 @@ void WriteRsaPublicKeyJwk(const CryptoData& n,
const std::string& algorithm, const std::string& algorithm,
bool extractable, bool extractable,
blink::WebCryptoKeyUsageMask usage_mask, blink::WebCryptoKeyUsageMask usage_mask,
std::vector<uint8>* jwk_key_data) { std::vector<uint8_t>* jwk_key_data) {
JwkWriter writer(algorithm, extractable, usage_mask, "RSA"); JwkWriter writer(algorithm, extractable, usage_mask, "RSA");
writer.SetBase64Encoded("n", n); writer.SetBase64Encoded("n", n);
writer.SetBase64Encoded("e", e); writer.SetBase64Encoded("e", e);
...@@ -601,7 +601,7 @@ void WriteRsaPrivateKeyJwk(const CryptoData& n, ...@@ -601,7 +601,7 @@ void WriteRsaPrivateKeyJwk(const CryptoData& n,
const std::string& algorithm, const std::string& algorithm,
bool extractable, bool extractable,
blink::WebCryptoKeyUsageMask usage_mask, blink::WebCryptoKeyUsageMask usage_mask,
std::vector<uint8>* jwk_key_data) { std::vector<uint8_t>* jwk_key_data) {
JwkWriter writer(algorithm, extractable, usage_mask, "RSA"); JwkWriter writer(algorithm, extractable, usage_mask, "RSA");
writer.SetBase64Encoded("n", n); writer.SetBase64Encoded("n", n);
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
#ifndef CONTENT_CHILD_WEBCRYPTO_JWK_H_ #ifndef CONTENT_CHILD_WEBCRYPTO_JWK_H_
#define CONTENT_CHILD_WEBCRYPTO_JWK_H_ #define CONTENT_CHILD_WEBCRYPTO_JWK_H_
#include <stdint.h>
#include <vector> #include <vector>
#include "base/basictypes.h"
#include "base/values.h" #include "base/values.h"
#include "third_party/WebKit/public/platform/WebArrayBuffer.h" #include "third_party/WebKit/public/platform/WebArrayBuffer.h"
#include "third_party/WebKit/public/platform/WebCrypto.h" #include "third_party/WebKit/public/platform/WebCrypto.h"
...@@ -29,7 +29,7 @@ void WriteSecretKeyJwk(const CryptoData& raw_key_data, ...@@ -29,7 +29,7 @@ void WriteSecretKeyJwk(const CryptoData& raw_key_data,
const std::string& algorithm, const std::string& algorithm,
bool extractable, bool extractable,
blink::WebCryptoKeyUsageMask usage_mask, blink::WebCryptoKeyUsageMask usage_mask,
std::vector<uint8>* jwk_key_data); std::vector<uint8_t>* jwk_key_data);
// Parses a UTF-8 encoded JWK (key_data), and extracts the key material to // Parses a UTF-8 encoded JWK (key_data), and extracts the key material to
// |*raw_key_data|. Returns Status::Success() on success, otherwise an error. // |*raw_key_data|. Returns Status::Success() on success, otherwise an error.
...@@ -42,7 +42,7 @@ Status ReadSecretKeyJwk(const CryptoData& key_data, ...@@ -42,7 +42,7 @@ Status ReadSecretKeyJwk(const CryptoData& key_data,
const std::string& expected_algorithm, const std::string& expected_algorithm,
bool expected_extractable, bool expected_extractable,
blink::WebCryptoKeyUsageMask expected_usage_mask, blink::WebCryptoKeyUsageMask expected_usage_mask,
std::vector<uint8>* raw_key_data); std::vector<uint8_t>* raw_key_data);
// Creates an AES algorithm name for the given key size (in bytes). For // Creates an AES algorithm name for the given key size (in bytes). For
// instance "A128CBC" is the result of suffix="CBC", keylen_bytes=16. // instance "A128CBC" is the result of suffix="CBC", keylen_bytes=16.
...@@ -60,7 +60,7 @@ Status ReadAesSecretKeyJwk(const CryptoData& key_data, ...@@ -60,7 +60,7 @@ Status ReadAesSecretKeyJwk(const CryptoData& key_data,
const std::string& algorithm_name_suffix, const std::string& algorithm_name_suffix,
bool expected_extractable, bool expected_extractable,
blink::WebCryptoKeyUsageMask expected_usage_mask, blink::WebCryptoKeyUsageMask expected_usage_mask,
std::vector<uint8>* raw_key_data); std::vector<uint8_t>* raw_key_data);
// Writes a JWK-formated RSA public key and saves the result to // Writes a JWK-formated RSA public key and saves the result to
// |*jwk_key_data|. // |*jwk_key_data|.
...@@ -69,7 +69,7 @@ void WriteRsaPublicKeyJwk(const CryptoData& n, ...@@ -69,7 +69,7 @@ void WriteRsaPublicKeyJwk(const CryptoData& n,
const std::string& algorithm, const std::string& algorithm,
bool extractable, bool extractable,
blink::WebCryptoKeyUsageMask usage_mask, blink::WebCryptoKeyUsageMask usage_mask,
std::vector<uint8>* jwk_key_data); std::vector<uint8_t>* jwk_key_data);
// Writes a JWK-formated RSA private key and saves the result to // Writes a JWK-formated RSA private key and saves the result to
// |*jwk_key_data|. // |*jwk_key_data|.
...@@ -84,7 +84,7 @@ void WriteRsaPrivateKeyJwk(const CryptoData& n, ...@@ -84,7 +84,7 @@ void WriteRsaPrivateKeyJwk(const CryptoData& n,
const std::string& algorithm, const std::string& algorithm,
bool extractable, bool extractable,
blink::WebCryptoKeyUsageMask usage_mask, blink::WebCryptoKeyUsageMask usage_mask,
std::vector<uint8>* jwk_key_data); std::vector<uint8_t>* jwk_key_data);
// Describes the RSA components for a parsed key. The names of the properties // Describes the RSA components for a parsed key. The names of the properties
// correspond with those from the JWK spec. Note that Chromium's WebCrypto // correspond with those from the JWK spec. Note that Chromium's WebCrypto
......
...@@ -23,7 +23,7 @@ Status AesCbcEncryptDecrypt(EncryptOrDecrypt mode, ...@@ -23,7 +23,7 @@ Status AesCbcEncryptDecrypt(EncryptOrDecrypt mode,
const blink::WebCryptoAlgorithm& algorithm, const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) { std::vector<uint8_t>* buffer) {
const blink::WebCryptoAesCbcParams* params = algorithm.aesCbcParams(); const blink::WebCryptoAesCbcParams* params = algorithm.aesCbcParams();
if (!params) if (!params)
return Status::ErrorUnexpected(); return Status::ErrorUnexpected();
...@@ -103,14 +103,14 @@ class AesCbcImplementation : public AesAlgorithm { ...@@ -103,14 +103,14 @@ class AesCbcImplementation : public AesAlgorithm {
virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm, virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
return AesCbcEncryptDecrypt(ENCRYPT, algorithm, key, data, buffer); return AesCbcEncryptDecrypt(ENCRYPT, algorithm, key, data, buffer);
} }
virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm, virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
return AesCbcEncryptDecrypt(DECRYPT, algorithm, key, data, buffer); return AesCbcEncryptDecrypt(DECRYPT, algorithm, key, data, buffer);
} }
}; };
......
...@@ -56,7 +56,7 @@ Status AesGcmEncryptDecrypt(EncryptOrDecrypt mode, ...@@ -56,7 +56,7 @@ Status AesGcmEncryptDecrypt(EncryptOrDecrypt mode,
const blink::WebCryptoAlgorithm& algorithm, const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) { std::vector<uint8_t>* buffer) {
Status status = NssSupportsAesGcm(); Status status = NssSupportsAesGcm();
if (status.IsError()) if (status.IsError())
return status; return status;
...@@ -165,14 +165,14 @@ class AesGcmImplementation : public AesAlgorithm { ...@@ -165,14 +165,14 @@ class AesGcmImplementation : public AesAlgorithm {
virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm, virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
return AesGcmEncryptDecrypt(ENCRYPT, algorithm, key, data, buffer); return AesGcmEncryptDecrypt(ENCRYPT, algorithm, key, data, buffer);
} }
virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm, virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
return AesGcmEncryptDecrypt(DECRYPT, algorithm, key, data, buffer); return AesGcmEncryptDecrypt(DECRYPT, algorithm, key, data, buffer);
} }
}; };
......
...@@ -102,7 +102,7 @@ Status AesAlgorithm::ImportKeyJwk(const CryptoData& key_data, ...@@ -102,7 +102,7 @@ Status AesAlgorithm::ImportKeyJwk(const CryptoData& key_data,
bool extractable, bool extractable,
blink::WebCryptoKeyUsageMask usage_mask, blink::WebCryptoKeyUsageMask usage_mask,
blink::WebCryptoKey* key) const { blink::WebCryptoKey* key) const {
std::vector<uint8> raw_data; std::vector<uint8_t> raw_data;
Status status = ReadAesSecretKeyJwk( Status status = ReadAesSecretKeyJwk(
key_data, jwk_suffix_, extractable, usage_mask, &raw_data); key_data, jwk_suffix_, extractable, usage_mask, &raw_data);
if (status.IsError()) if (status.IsError())
...@@ -113,15 +113,15 @@ Status AesAlgorithm::ImportKeyJwk(const CryptoData& key_data, ...@@ -113,15 +113,15 @@ Status AesAlgorithm::ImportKeyJwk(const CryptoData& key_data,
} }
Status AesAlgorithm::ExportKeyRaw(const blink::WebCryptoKey& key, Status AesAlgorithm::ExportKeyRaw(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const { std::vector<uint8_t>* buffer) const {
*buffer = SymKeyNss::Cast(key)->raw_key_data(); *buffer = SymKeyNss::Cast(key)->raw_key_data();
return Status::Success(); return Status::Success();
} }
Status AesAlgorithm::ExportKeyJwk(const blink::WebCryptoKey& key, Status AesAlgorithm::ExportKeyJwk(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const { std::vector<uint8_t>* buffer) const {
SymKeyNss* sym_key = SymKeyNss::Cast(key); SymKeyNss* sym_key = SymKeyNss::Cast(key);
const std::vector<uint8>& raw_data = sym_key->raw_key_data(); const std::vector<uint8_t>& raw_data = sym_key->raw_key_data();
WriteSecretKeyJwk(CryptoData(raw_data), WriteSecretKeyJwk(CryptoData(raw_data),
MakeJwkAesAlgorithmName(jwk_suffix_, raw_data.size()), MakeJwkAesAlgorithmName(jwk_suffix_, raw_data.size()),
......
...@@ -61,10 +61,10 @@ class AesAlgorithm : public AlgorithmImplementation { ...@@ -61,10 +61,10 @@ class AesAlgorithm : public AlgorithmImplementation {
blink::WebCryptoKey* key) const OVERRIDE; blink::WebCryptoKey* key) const OVERRIDE;
virtual Status ExportKeyRaw(const blink::WebCryptoKey& key, virtual Status ExportKeyRaw(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const OVERRIDE; std::vector<uint8_t>* buffer) const OVERRIDE;
virtual Status ExportKeyJwk(const blink::WebCryptoKey& key, virtual Status ExportKeyJwk(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const OVERRIDE; std::vector<uint8_t>* buffer) const OVERRIDE;
private: private:
const CK_MECHANISM_TYPE import_mechanism_; const CK_MECHANISM_TYPE import_mechanism_;
......
...@@ -88,7 +88,7 @@ Status DoUnwrapSymKeyAesKw(const CryptoData& wrapped_key_data, ...@@ -88,7 +88,7 @@ Status DoUnwrapSymKeyAesKw(const CryptoData& wrapped_key_data,
Status WrapSymKeyAesKw(PK11SymKey* key, Status WrapSymKeyAesKw(PK11SymKey* key,
PK11SymKey* wrapping_key, PK11SymKey* wrapping_key,
std::vector<uint8>* buffer) { std::vector<uint8_t>* buffer) {
// The data size must be at least 16 bytes and a multiple of 8 bytes. // The data size must be at least 16 bytes and a multiple of 8 bytes.
// RFC 3394 does not specify a maximum allowed data length, but since only // RFC 3394 does not specify a maximum allowed data length, but since only
// keys are being wrapped in this application (which are small), a reasonable // keys are being wrapped in this application (which are small), a reasonable
...@@ -135,7 +135,7 @@ class AesKwCryptoAlgorithmNss : public AesAlgorithm { ...@@ -135,7 +135,7 @@ class AesKwCryptoAlgorithmNss : public AesAlgorithm {
virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm, virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& wrapping_key, const blink::WebCryptoKey& wrapping_key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
if (data.byte_length() < 16) if (data.byte_length() < 16)
return Status::ErrorDataTooSmall(); return Status::ErrorDataTooSmall();
if (data.byte_length() % 8) if (data.byte_length() % 8)
...@@ -162,7 +162,7 @@ class AesKwCryptoAlgorithmNss : public AesAlgorithm { ...@@ -162,7 +162,7 @@ class AesKwCryptoAlgorithmNss : public AesAlgorithm {
virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm, virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& wrapping_key, const blink::WebCryptoKey& wrapping_key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
if (data.byte_length() < 24) if (data.byte_length() < 24)
return Status::ErrorDataTooSmall(); return Status::ErrorDataTooSmall();
if (data.byte_length() % 8) if (data.byte_length() % 8)
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <sechash.h> #include <sechash.h>
#include "base/logging.h" #include "base/logging.h"
#include "content/child/webcrypto/algorithm_implementation.h"
#include "content/child/webcrypto/crypto_data.h" #include "content/child/webcrypto/crypto_data.h"
#include "content/child/webcrypto/jwk.h" #include "content/child/webcrypto/jwk.h"
#include "content/child/webcrypto/nss/key_nss.h" #include "content/child/webcrypto/nss/key_nss.h"
...@@ -129,7 +130,7 @@ class HmacImplementation : public AlgorithmImplementation { ...@@ -129,7 +130,7 @@ class HmacImplementation : public AlgorithmImplementation {
if (!algorithm_name) if (!algorithm_name)
return Status::ErrorUnexpected(); return Status::ErrorUnexpected();
std::vector<uint8> raw_data; std::vector<uint8_t> raw_data;
Status status = ReadSecretKeyJwk( Status status = ReadSecretKeyJwk(
key_data, algorithm_name, extractable, usage_mask, &raw_data); key_data, algorithm_name, extractable, usage_mask, &raw_data);
if (status.IsError()) if (status.IsError())
...@@ -140,15 +141,15 @@ class HmacImplementation : public AlgorithmImplementation { ...@@ -140,15 +141,15 @@ class HmacImplementation : public AlgorithmImplementation {
} }
virtual Status ExportKeyRaw(const blink::WebCryptoKey& key, virtual Status ExportKeyRaw(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
*buffer = SymKeyNss::Cast(key)->raw_key_data(); *buffer = SymKeyNss::Cast(key)->raw_key_data();
return Status::Success(); return Status::Success();
} }
virtual Status ExportKeyJwk(const blink::WebCryptoKey& key, virtual Status ExportKeyJwk(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
SymKeyNss* sym_key = SymKeyNss::Cast(key); SymKeyNss* sym_key = SymKeyNss::Cast(key);
const std::vector<uint8>& raw_data = sym_key->raw_key_data(); const std::vector<uint8_t>& raw_data = sym_key->raw_key_data();
const char* algorithm_name = const char* algorithm_name =
GetJwkHmacAlgorithmName(key.algorithm().hmacParams()->hash().id()); GetJwkHmacAlgorithmName(key.algorithm().hmacParams()->hash().id());
...@@ -167,7 +168,7 @@ class HmacImplementation : public AlgorithmImplementation { ...@@ -167,7 +168,7 @@ class HmacImplementation : public AlgorithmImplementation {
virtual Status Sign(const blink::WebCryptoAlgorithm& algorithm, virtual Status Sign(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
const blink::WebCryptoAlgorithm& hash = const blink::WebCryptoAlgorithm& hash =
key.algorithm().hmacParams()->hash(); key.algorithm().hmacParams()->hash();
PK11SymKey* sym_key = SymKeyNss::Cast(key)->key(); PK11SymKey* sym_key = SymKeyNss::Cast(key)->key();
...@@ -207,7 +208,7 @@ class HmacImplementation : public AlgorithmImplementation { ...@@ -207,7 +208,7 @@ class HmacImplementation : public AlgorithmImplementation {
const CryptoData& signature, const CryptoData& signature,
const CryptoData& data, const CryptoData& data,
bool* signature_match) const OVERRIDE { bool* signature_match) const OVERRIDE {
std::vector<uint8> result; std::vector<uint8_t> result;
Status status = Sign(algorithm, key, data, &result); Status status = Sign(algorithm, key, data, &result);
if (status.IsError()) if (status.IsError())
......
...@@ -85,7 +85,7 @@ PrivateKeyNss::PrivateKeyNss(crypto::ScopedSECKEYPrivateKey key, ...@@ -85,7 +85,7 @@ PrivateKeyNss::PrivateKeyNss(crypto::ScopedSECKEYPrivateKey key,
} }
bool PlatformSerializeKeyForClone(const blink::WebCryptoKey& key, bool PlatformSerializeKeyForClone(const blink::WebCryptoKey& key,
blink::WebVector<uint8>* key_data) { blink::WebVector<uint8_t>* key_data) {
const KeyNss* nss_key = static_cast<KeyNss*>(key.handle()); const KeyNss* nss_key = static_cast<KeyNss*>(key.handle());
*key_data = nss_key->serialized_key_data(); *key_data = nss_key->serialized_key_data();
return true; return true;
......
...@@ -5,14 +5,17 @@ ...@@ -5,14 +5,17 @@
#ifndef CONTENT_CHILD_WEBCRYPTO_NSS_KEY_NSS_H_ #ifndef CONTENT_CHILD_WEBCRYPTO_NSS_KEY_NSS_H_
#define CONTENT_CHILD_WEBCRYPTO_NSS_KEY_NSS_H_ #define CONTENT_CHILD_WEBCRYPTO_NSS_KEY_NSS_H_
#include "content/child/webcrypto/algorithm_implementation.h" #include <stdint.h>
#include <vector>
#include "crypto/scoped_nss_types.h" #include "crypto/scoped_nss_types.h"
#include "third_party/WebKit/public/platform/WebCryptoKey.h"
namespace content { namespace content {
namespace webcrypto { namespace webcrypto {
class CryptoData;
class PrivateKeyNss; class PrivateKeyNss;
class PublicKeyNss; class PublicKeyNss;
class SymKeyNss; class SymKeyNss;
...@@ -30,12 +33,12 @@ class KeyNss : public blink::WebCryptoKeyHandle { ...@@ -30,12 +33,12 @@ class KeyNss : public blink::WebCryptoKeyHandle {
virtual PublicKeyNss* AsPublicKey(); virtual PublicKeyNss* AsPublicKey();
virtual PrivateKeyNss* AsPrivateKey(); virtual PrivateKeyNss* AsPrivateKey();
const std::vector<uint8>& serialized_key_data() const { const std::vector<uint8_t>& serialized_key_data() const {
return serialized_key_data_; return serialized_key_data_;
} }
private: private:
const std::vector<uint8> serialized_key_data_; const std::vector<uint8_t> serialized_key_data_;
}; };
class SymKeyNss : public KeyNss { class SymKeyNss : public KeyNss {
...@@ -48,7 +51,7 @@ class SymKeyNss : public KeyNss { ...@@ -48,7 +51,7 @@ class SymKeyNss : public KeyNss {
PK11SymKey* key() { return key_.get(); } PK11SymKey* key() { return key_.get(); }
virtual SymKeyNss* AsSymKey() OVERRIDE; virtual SymKeyNss* AsSymKey() OVERRIDE;
const std::vector<uint8>& raw_key_data() const { const std::vector<uint8_t>& raw_key_data() const {
return serialized_key_data(); return serialized_key_data();
} }
...@@ -68,7 +71,9 @@ class PublicKeyNss : public KeyNss { ...@@ -68,7 +71,9 @@ class PublicKeyNss : public KeyNss {
SECKEYPublicKey* key() { return key_.get(); } SECKEYPublicKey* key() { return key_.get(); }
virtual PublicKeyNss* AsPublicKey() OVERRIDE; virtual PublicKeyNss* AsPublicKey() OVERRIDE;
const std::vector<uint8>& spki_data() const { return serialized_key_data(); } const std::vector<uint8_t>& spki_data() const {
return serialized_key_data();
}
private: private:
crypto::ScopedSECKEYPublicKey key_; crypto::ScopedSECKEYPublicKey key_;
...@@ -87,7 +92,9 @@ class PrivateKeyNss : public KeyNss { ...@@ -87,7 +92,9 @@ class PrivateKeyNss : public KeyNss {
SECKEYPrivateKey* key() { return key_.get(); } SECKEYPrivateKey* key() { return key_.get(); }
virtual PrivateKeyNss* AsPrivateKey() OVERRIDE; virtual PrivateKeyNss* AsPrivateKey() OVERRIDE;
const std::vector<uint8>& pkcs8_data() const { return serialized_key_data(); } const std::vector<uint8_t>& pkcs8_data() const {
return serialized_key_data();
}
private: private:
crypto::ScopedSECKEYPrivateKey key_; crypto::ScopedSECKEYPrivateKey key_;
......
...@@ -23,7 +23,7 @@ namespace { ...@@ -23,7 +23,7 @@ namespace {
// Converts a (big-endian) WebCrypto BigInteger, with or without leading zeros, // Converts a (big-endian) WebCrypto BigInteger, with or without leading zeros,
// to unsigned long. // to unsigned long.
bool BigIntegerToLong(const uint8* data, bool BigIntegerToLong(const uint8_t* data,
unsigned int data_size, unsigned int data_size,
unsigned long* result) { unsigned long* result) {
// TODO(eroman): Fix handling of empty biginteger. http://crubg.com/373552 // TODO(eroman): Fix handling of empty biginteger. http://crubg.com/373552
...@@ -310,7 +310,7 @@ void AddOptionalAttribute(CK_ATTRIBUTE_TYPE type, ...@@ -310,7 +310,7 @@ void AddOptionalAttribute(CK_ATTRIBUTE_TYPE type,
AddOptionalAttribute(type, CryptoData(data), templ); AddOptionalAttribute(type, CryptoData(data), templ);
} }
Status ExportKeyPkcs8Nss(SECKEYPrivateKey* key, std::vector<uint8>* buffer) { Status ExportKeyPkcs8Nss(SECKEYPrivateKey* key, std::vector<uint8_t>* buffer) {
if (key->keyType != rsaKey) if (key->keyType != rsaKey)
return Status::ErrorUnsupported(); return Status::ErrorUnsupported();
...@@ -452,7 +452,7 @@ Status ImportRsaPrivateKey(const blink::WebCryptoAlgorithm& algorithm, ...@@ -452,7 +452,7 @@ Status ImportRsaPrivateKey(const blink::WebCryptoAlgorithm& algorithm,
if (!CreatePrivateKeyAlgorithm(algorithm, private_key.get(), &key_algorithm)) if (!CreatePrivateKeyAlgorithm(algorithm, private_key.get(), &key_algorithm))
return Status::ErrorUnexpected(); return Status::ErrorUnexpected();
std::vector<uint8> pkcs8_data; std::vector<uint8_t> pkcs8_data;
status = ExportKeyPkcs8Nss(private_key.get(), &pkcs8_data); status = ExportKeyPkcs8Nss(private_key.get(), &pkcs8_data);
if (status.IsError()) if (status.IsError())
return status; return status;
...@@ -468,7 +468,7 @@ Status ImportRsaPrivateKey(const blink::WebCryptoAlgorithm& algorithm, ...@@ -468,7 +468,7 @@ Status ImportRsaPrivateKey(const blink::WebCryptoAlgorithm& algorithm,
return Status::Success(); return Status::Success();
} }
Status ExportKeySpkiNss(SECKEYPublicKey* key, std::vector<uint8>* buffer) { Status ExportKeySpkiNss(SECKEYPublicKey* key, std::vector<uint8_t>* buffer) {
const crypto::ScopedSECItem spki_der( const crypto::ScopedSECItem spki_der(
SECKEY_EncodeDERSubjectPublicKeyInfo(key)); SECKEY_EncodeDERSubjectPublicKeyInfo(key));
if (!spki_der) if (!spki_der)
...@@ -538,7 +538,7 @@ Status ImportRsaPublicKey(const blink::WebCryptoAlgorithm& algorithm, ...@@ -538,7 +538,7 @@ Status ImportRsaPublicKey(const blink::WebCryptoAlgorithm& algorithm,
if (!CreatePublicKeyAlgorithm(algorithm, pubkey.get(), &key_algorithm)) if (!CreatePublicKeyAlgorithm(algorithm, pubkey.get(), &key_algorithm))
return Status::ErrorUnexpected(); return Status::ErrorUnexpected();
std::vector<uint8> spki_data; std::vector<uint8_t> spki_data;
Status status = ExportKeySpkiNss(pubkey.get(), &spki_data); Status status = ExportKeySpkiNss(pubkey.get(), &spki_data);
if (status.IsError()) if (status.IsError())
return status; return status;
...@@ -630,7 +630,7 @@ Status RsaHashedAlgorithm::GenerateKeyPair( ...@@ -630,7 +630,7 @@ Status RsaHashedAlgorithm::GenerateKeyPair(
if (!CreatePublicKeyAlgorithm(algorithm, sec_public_key, &key_algorithm)) if (!CreatePublicKeyAlgorithm(algorithm, sec_public_key, &key_algorithm))
return Status::ErrorUnexpected(); return Status::ErrorUnexpected();
std::vector<uint8> spki_data; std::vector<uint8_t> spki_data;
Status status = ExportKeySpkiNss(sec_public_key, &spki_data); Status status = ExportKeySpkiNss(sec_public_key, &spki_data);
if (status.IsError()) if (status.IsError())
return status; return status;
...@@ -638,7 +638,7 @@ Status RsaHashedAlgorithm::GenerateKeyPair( ...@@ -638,7 +638,7 @@ Status RsaHashedAlgorithm::GenerateKeyPair(
scoped_ptr<PublicKeyNss> public_key_handle(new PublicKeyNss( scoped_ptr<PublicKeyNss> public_key_handle(new PublicKeyNss(
crypto::ScopedSECKEYPublicKey(sec_public_key), CryptoData(spki_data))); crypto::ScopedSECKEYPublicKey(sec_public_key), CryptoData(spki_data)));
std::vector<uint8> pkcs8_data; std::vector<uint8_t> pkcs8_data;
status = ExportKeyPkcs8Nss(scoped_sec_private_key.get(), &pkcs8_data); status = ExportKeyPkcs8Nss(scoped_sec_private_key.get(), &pkcs8_data);
if (status.IsError()) if (status.IsError())
return status; return status;
...@@ -719,7 +719,7 @@ Status RsaHashedAlgorithm::ImportKeyPkcs8( ...@@ -719,7 +719,7 @@ Status RsaHashedAlgorithm::ImportKeyPkcs8(
return Status::ErrorUnexpected(); return Status::ErrorUnexpected();
// TODO(eroman): This is probably going to be the same as the input. // TODO(eroman): This is probably going to be the same as the input.
std::vector<uint8> pkcs8_data; std::vector<uint8_t> pkcs8_data;
status = ExportKeyPkcs8Nss(private_key.get(), &pkcs8_data); status = ExportKeyPkcs8Nss(private_key.get(), &pkcs8_data);
if (status.IsError()) if (status.IsError())
return status; return status;
...@@ -772,7 +772,7 @@ Status RsaHashedAlgorithm::ImportKeySpki( ...@@ -772,7 +772,7 @@ Status RsaHashedAlgorithm::ImportKeySpki(
return Status::ErrorUnexpected(); return Status::ErrorUnexpected();
// TODO(eroman): This is probably going to be the same as the input. // TODO(eroman): This is probably going to be the same as the input.
std::vector<uint8> spki_data; std::vector<uint8_t> spki_data;
status = ExportKeySpkiNss(sec_public_key.get(), &spki_data); status = ExportKeySpkiNss(sec_public_key.get(), &spki_data);
if (status.IsError()) if (status.IsError())
return status; return status;
...@@ -790,7 +790,7 @@ Status RsaHashedAlgorithm::ImportKeySpki( ...@@ -790,7 +790,7 @@ Status RsaHashedAlgorithm::ImportKeySpki(
} }
Status RsaHashedAlgorithm::ExportKeyPkcs8(const blink::WebCryptoKey& key, Status RsaHashedAlgorithm::ExportKeyPkcs8(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const { std::vector<uint8_t>* buffer) const {
if (key.type() != blink::WebCryptoKeyTypePrivate) if (key.type() != blink::WebCryptoKeyTypePrivate)
return Status::ErrorUnexpectedKeyType(); return Status::ErrorUnexpectedKeyType();
*buffer = PrivateKeyNss::Cast(key)->pkcs8_data(); *buffer = PrivateKeyNss::Cast(key)->pkcs8_data();
...@@ -798,7 +798,7 @@ Status RsaHashedAlgorithm::ExportKeyPkcs8(const blink::WebCryptoKey& key, ...@@ -798,7 +798,7 @@ Status RsaHashedAlgorithm::ExportKeyPkcs8(const blink::WebCryptoKey& key,
} }
Status RsaHashedAlgorithm::ExportKeySpki(const blink::WebCryptoKey& key, Status RsaHashedAlgorithm::ExportKeySpki(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const { std::vector<uint8_t>* buffer) const {
if (key.type() != blink::WebCryptoKeyTypePublic) if (key.type() != blink::WebCryptoKeyTypePublic)
return Status::ErrorUnexpectedKeyType(); return Status::ErrorUnexpectedKeyType();
*buffer = PublicKeyNss::Cast(key)->spki_data(); *buffer = PublicKeyNss::Cast(key)->spki_data();
...@@ -841,7 +841,7 @@ Status RsaHashedAlgorithm::ImportKeyJwk( ...@@ -841,7 +841,7 @@ Status RsaHashedAlgorithm::ImportKeyJwk(
} }
Status RsaHashedAlgorithm::ExportKeyJwk(const blink::WebCryptoKey& key, Status RsaHashedAlgorithm::ExportKeyJwk(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const { std::vector<uint8_t>* buffer) const {
const char* jwk_algorithm = const char* jwk_algorithm =
GetJwkAlgorithm(key.algorithm().rsaHashedParams()->hash().id()); GetJwkAlgorithm(key.algorithm().rsaHashedParams()->hash().id());
......
...@@ -73,10 +73,10 @@ class RsaHashedAlgorithm : public AlgorithmImplementation { ...@@ -73,10 +73,10 @@ class RsaHashedAlgorithm : public AlgorithmImplementation {
blink::WebCryptoKey* key) const OVERRIDE; blink::WebCryptoKey* key) const OVERRIDE;
virtual Status ExportKeyPkcs8(const blink::WebCryptoKey& key, virtual Status ExportKeyPkcs8(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const OVERRIDE; std::vector<uint8_t>* buffer) const OVERRIDE;
virtual Status ExportKeySpki(const blink::WebCryptoKey& key, virtual Status ExportKeySpki(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const OVERRIDE; std::vector<uint8_t>* buffer) const OVERRIDE;
virtual Status ImportKeyJwk(const CryptoData& key_data, virtual Status ImportKeyJwk(const CryptoData& key_data,
const blink::WebCryptoAlgorithm& algorithm, const blink::WebCryptoAlgorithm& algorithm,
...@@ -85,7 +85,7 @@ class RsaHashedAlgorithm : public AlgorithmImplementation { ...@@ -85,7 +85,7 @@ class RsaHashedAlgorithm : public AlgorithmImplementation {
blink::WebCryptoKey* key) const OVERRIDE; blink::WebCryptoKey* key) const OVERRIDE;
virtual Status ExportKeyJwk(const blink::WebCryptoKey& key, virtual Status ExportKeyJwk(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const OVERRIDE; std::vector<uint8_t>* buffer) const OVERRIDE;
private: private:
CK_FLAGS generate_flags_; CK_FLAGS generate_flags_;
......
...@@ -85,7 +85,7 @@ Status EncryptRsaOaep(SECKEYPublicKey* key, ...@@ -85,7 +85,7 @@ Status EncryptRsaOaep(SECKEYPublicKey* key,
const blink::WebCryptoAlgorithm& hash, const blink::WebCryptoAlgorithm& hash,
const CryptoData& label, const CryptoData& label,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) { std::vector<uint8_t>* buffer) {
CK_RSA_PKCS_OAEP_PARAMS oaep_params = {0}; CK_RSA_PKCS_OAEP_PARAMS oaep_params = {0};
if (!InitializeRsaOaepParams(hash, label, &oaep_params)) if (!InitializeRsaOaepParams(hash, label, &oaep_params))
return Status::ErrorUnsupported(); return Status::ErrorUnsupported();
...@@ -119,7 +119,7 @@ Status DecryptRsaOaep(SECKEYPrivateKey* key, ...@@ -119,7 +119,7 @@ Status DecryptRsaOaep(SECKEYPrivateKey* key,
const blink::WebCryptoAlgorithm& hash, const blink::WebCryptoAlgorithm& hash,
const CryptoData& label, const CryptoData& label,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) { std::vector<uint8_t>* buffer) {
Status status = NssSupportsRsaOaep(); Status status = NssSupportsRsaOaep();
if (status.IsError()) if (status.IsError())
return status; return status;
...@@ -207,7 +207,7 @@ class RsaOaepImplementation : public RsaHashedAlgorithm { ...@@ -207,7 +207,7 @@ class RsaOaepImplementation : public RsaHashedAlgorithm {
virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm, virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
if (key.type() != blink::WebCryptoKeyTypePublic) if (key.type() != blink::WebCryptoKeyTypePublic)
return Status::ErrorUnexpectedKeyType(); return Status::ErrorUnexpectedKeyType();
...@@ -222,7 +222,7 @@ class RsaOaepImplementation : public RsaHashedAlgorithm { ...@@ -222,7 +222,7 @@ class RsaOaepImplementation : public RsaHashedAlgorithm {
virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm, virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
if (key.type() != blink::WebCryptoKeyTypePrivate) if (key.type() != blink::WebCryptoKeyTypePrivate)
return Status::ErrorUnexpectedKeyType(); return Status::ErrorUnexpectedKeyType();
......
...@@ -44,7 +44,7 @@ class RsaSsaImplementation : public RsaHashedAlgorithm { ...@@ -44,7 +44,7 @@ class RsaSsaImplementation : public RsaHashedAlgorithm {
virtual Status Sign(const blink::WebCryptoAlgorithm& algorithm, virtual Status Sign(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
if (key.type() != blink::WebCryptoKeyTypePrivate) if (key.type() != blink::WebCryptoKeyTypePrivate)
return Status::ErrorUnexpectedKeyType(); return Status::ErrorUnexpectedKeyType();
......
...@@ -79,7 +79,7 @@ class DigestorNSS : public blink::WebCryptoDigestor { ...@@ -79,7 +79,7 @@ class DigestorNSS : public blink::WebCryptoDigestor {
return true; return true;
} }
Status FinishWithVectorAndStatus(std::vector<uint8>* result) { Status FinishWithVectorAndStatus(std::vector<uint8_t>* result) {
if (!hash_context_) if (!hash_context_)
return Status::ErrorUnexpected(); return Status::ErrorUnexpected();
...@@ -132,7 +132,7 @@ class ShaImplementation : public AlgorithmImplementation { ...@@ -132,7 +132,7 @@ class ShaImplementation : public AlgorithmImplementation {
public: public:
virtual Status Digest(const blink::WebCryptoAlgorithm& algorithm, virtual Status Digest(const blink::WebCryptoAlgorithm& algorithm,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
DigestorNSS digestor(algorithm.id()); DigestorNSS digestor(algorithm.id());
Status error = digestor.ConsumeWithStatus(data.bytes(), data.byte_length()); Status error = digestor.ConsumeWithStatus(data.bytes(), data.byte_length());
// http://crbug.com/366427: the spec does not define any other failures for // http://crbug.com/366427: the spec does not define any other failures for
......
...@@ -39,9 +39,10 @@ Status AesCbcEncryptDecrypt(CipherOperation cipher_operation, ...@@ -39,9 +39,10 @@ Status AesCbcEncryptDecrypt(CipherOperation cipher_operation,
const blink::WebCryptoAlgorithm& algorithm, const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) { std::vector<uint8_t>* buffer) {
const blink::WebCryptoAesCbcParams* params = algorithm.aesCbcParams(); const blink::WebCryptoAesCbcParams* params = algorithm.aesCbcParams();
const std::vector<uint8>& raw_key = SymKeyOpenSsl::Cast(key)->raw_key_data(); const std::vector<uint8_t>& raw_key =
SymKeyOpenSsl::Cast(key)->raw_key_data();
if (params->iv().size() != 16) if (params->iv().size() != 16)
return Status::ErrorIncorrectSizeAesCbcIv(); return Status::ErrorIncorrectSizeAesCbcIv();
...@@ -115,14 +116,14 @@ class AesCbcImplementation : public AesAlgorithm { ...@@ -115,14 +116,14 @@ class AesCbcImplementation : public AesAlgorithm {
virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm, virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
return AesCbcEncryptDecrypt(kDoEncrypt, algorithm, key, data, buffer); return AesCbcEncryptDecrypt(kDoEncrypt, algorithm, key, data, buffer);
} }
virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm, virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
return AesCbcEncryptDecrypt(kDoDecrypt, algorithm, key, data, buffer); return AesCbcEncryptDecrypt(kDoDecrypt, algorithm, key, data, buffer);
} }
}; };
......
...@@ -36,8 +36,9 @@ Status AesGcmEncryptDecrypt(EncryptOrDecrypt mode, ...@@ -36,8 +36,9 @@ Status AesGcmEncryptDecrypt(EncryptOrDecrypt mode,
const blink::WebCryptoAlgorithm& algorithm, const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) { std::vector<uint8_t>* buffer) {
const std::vector<uint8>& raw_key = SymKeyOpenSsl::Cast(key)->raw_key_data(); const std::vector<uint8_t>& raw_key =
SymKeyOpenSsl::Cast(key)->raw_key_data();
const blink::WebCryptoAesGcmParams* params = algorithm.aesGcmParams(); const blink::WebCryptoAesGcmParams* params = algorithm.aesGcmParams();
crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE); crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
...@@ -116,14 +117,14 @@ class AesGcmImplementation : public AesAlgorithm { ...@@ -116,14 +117,14 @@ class AesGcmImplementation : public AesAlgorithm {
virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm, virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
return AesGcmEncryptDecrypt(ENCRYPT, algorithm, key, data, buffer); return AesGcmEncryptDecrypt(ENCRYPT, algorithm, key, data, buffer);
} }
virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm, virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
return AesGcmEncryptDecrypt(DECRYPT, algorithm, key, data, buffer); return AesGcmEncryptDecrypt(DECRYPT, algorithm, key, data, buffer);
} }
}; };
......
...@@ -92,7 +92,7 @@ Status AesAlgorithm::ImportKeyJwk(const CryptoData& key_data, ...@@ -92,7 +92,7 @@ Status AesAlgorithm::ImportKeyJwk(const CryptoData& key_data,
bool extractable, bool extractable,
blink::WebCryptoKeyUsageMask usage_mask, blink::WebCryptoKeyUsageMask usage_mask,
blink::WebCryptoKey* key) const { blink::WebCryptoKey* key) const {
std::vector<uint8> raw_data; std::vector<uint8_t> raw_data;
Status status = ReadAesSecretKeyJwk( Status status = ReadAesSecretKeyJwk(
key_data, jwk_suffix_, extractable, usage_mask, &raw_data); key_data, jwk_suffix_, extractable, usage_mask, &raw_data);
if (status.IsError()) if (status.IsError())
...@@ -103,14 +103,15 @@ Status AesAlgorithm::ImportKeyJwk(const CryptoData& key_data, ...@@ -103,14 +103,15 @@ Status AesAlgorithm::ImportKeyJwk(const CryptoData& key_data,
} }
Status AesAlgorithm::ExportKeyRaw(const blink::WebCryptoKey& key, Status AesAlgorithm::ExportKeyRaw(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const { std::vector<uint8_t>* buffer) const {
*buffer = SymKeyOpenSsl::Cast(key)->raw_key_data(); *buffer = SymKeyOpenSsl::Cast(key)->raw_key_data();
return Status::Success(); return Status::Success();
} }
Status AesAlgorithm::ExportKeyJwk(const blink::WebCryptoKey& key, Status AesAlgorithm::ExportKeyJwk(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const { std::vector<uint8_t>* buffer) const {
const std::vector<uint8>& raw_data = SymKeyOpenSsl::Cast(key)->raw_key_data(); const std::vector<uint8_t>& raw_data =
SymKeyOpenSsl::Cast(key)->raw_key_data();
WriteSecretKeyJwk(CryptoData(raw_data), WriteSecretKeyJwk(CryptoData(raw_data),
MakeJwkAesAlgorithmName(jwk_suffix_, raw_data.size()), MakeJwkAesAlgorithmName(jwk_suffix_, raw_data.size()),
......
...@@ -53,10 +53,10 @@ class AesAlgorithm : public AlgorithmImplementation { ...@@ -53,10 +53,10 @@ class AesAlgorithm : public AlgorithmImplementation {
blink::WebCryptoKey* key) const OVERRIDE; blink::WebCryptoKey* key) const OVERRIDE;
virtual Status ExportKeyRaw(const blink::WebCryptoKey& key, virtual Status ExportKeyRaw(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const OVERRIDE; std::vector<uint8_t>* buffer) const OVERRIDE;
virtual Status ExportKeyJwk(const blink::WebCryptoKey& key, virtual Status ExportKeyJwk(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const OVERRIDE; std::vector<uint8_t>* buffer) const OVERRIDE;
private: private:
const blink::WebCryptoKeyUsageMask all_key_usages_; const blink::WebCryptoKeyUsageMask all_key_usages_;
......
...@@ -19,7 +19,7 @@ class AesKwImplementation : public AesAlgorithm { ...@@ -19,7 +19,7 @@ class AesKwImplementation : public AesAlgorithm {
virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm, virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
// TODO(eroman): // TODO(eroman):
return Status::ErrorUnsupported(); return Status::ErrorUnsupported();
} }
...@@ -27,7 +27,7 @@ class AesKwImplementation : public AesAlgorithm { ...@@ -27,7 +27,7 @@ class AesKwImplementation : public AesAlgorithm {
virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm, virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
// TODO(eroman): // TODO(eroman):
return Status::ErrorUnsupported(); return Status::ErrorUnsupported();
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <openssl/hmac.h> #include <openssl/hmac.h>
#include "base/logging.h" #include "base/logging.h"
#include "content/child/webcrypto/algorithm_implementation.h"
#include "content/child/webcrypto/crypto_data.h" #include "content/child/webcrypto/crypto_data.h"
#include "content/child/webcrypto/jwk.h" #include "content/child/webcrypto/jwk.h"
#include "content/child/webcrypto/openssl/key_openssl.h" #include "content/child/webcrypto/openssl/key_openssl.h"
...@@ -26,10 +27,10 @@ namespace { ...@@ -26,10 +27,10 @@ namespace {
const blink::WebCryptoKeyUsageMask kAllKeyUsages = const blink::WebCryptoKeyUsageMask kAllKeyUsages =
blink::WebCryptoKeyUsageSign | blink::WebCryptoKeyUsageVerify; blink::WebCryptoKeyUsageSign | blink::WebCryptoKeyUsageVerify;
Status SignHmac(const std::vector<uint8>& raw_key, Status SignHmac(const std::vector<uint8_t>& raw_key,
const blink::WebCryptoAlgorithm& hash, const blink::WebCryptoAlgorithm& hash,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) { std::vector<uint8_t>* buffer) {
crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE); crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
const EVP_MD* digest_algorithm = GetDigest(hash.id()); const EVP_MD* digest_algorithm = GetDigest(hash.id());
...@@ -133,7 +134,7 @@ class HmacImplementation : public AlgorithmImplementation { ...@@ -133,7 +134,7 @@ class HmacImplementation : public AlgorithmImplementation {
if (!algorithm_name) if (!algorithm_name)
return Status::ErrorUnexpected(); return Status::ErrorUnexpected();
std::vector<uint8> raw_data; std::vector<uint8_t> raw_data;
Status status = ReadSecretKeyJwk( Status status = ReadSecretKeyJwk(
key_data, algorithm_name, extractable, usage_mask, &raw_data); key_data, algorithm_name, extractable, usage_mask, &raw_data);
if (status.IsError()) if (status.IsError())
...@@ -144,15 +145,15 @@ class HmacImplementation : public AlgorithmImplementation { ...@@ -144,15 +145,15 @@ class HmacImplementation : public AlgorithmImplementation {
} }
virtual Status ExportKeyRaw(const blink::WebCryptoKey& key, virtual Status ExportKeyRaw(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
*buffer = SymKeyOpenSsl::Cast(key)->raw_key_data(); *buffer = SymKeyOpenSsl::Cast(key)->raw_key_data();
return Status::Success(); return Status::Success();
} }
virtual Status ExportKeyJwk(const blink::WebCryptoKey& key, virtual Status ExportKeyJwk(const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
SymKeyOpenSsl* sym_key = SymKeyOpenSsl::Cast(key); SymKeyOpenSsl* sym_key = SymKeyOpenSsl::Cast(key);
const std::vector<uint8>& raw_data = sym_key->raw_key_data(); const std::vector<uint8_t>& raw_data = sym_key->raw_key_data();
const char* algorithm_name = const char* algorithm_name =
GetJwkHmacAlgorithmName(key.algorithm().hmacParams()->hash().id()); GetJwkHmacAlgorithmName(key.algorithm().hmacParams()->hash().id());
...@@ -171,7 +172,7 @@ class HmacImplementation : public AlgorithmImplementation { ...@@ -171,7 +172,7 @@ class HmacImplementation : public AlgorithmImplementation {
virtual Status Sign(const blink::WebCryptoAlgorithm& algorithm, virtual Status Sign(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key, const blink::WebCryptoKey& key,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
const blink::WebCryptoAlgorithm& hash = const blink::WebCryptoAlgorithm& hash =
key.algorithm().hmacParams()->hash(); key.algorithm().hmacParams()->hash();
...@@ -184,7 +185,7 @@ class HmacImplementation : public AlgorithmImplementation { ...@@ -184,7 +185,7 @@ class HmacImplementation : public AlgorithmImplementation {
const CryptoData& signature, const CryptoData& signature,
const CryptoData& data, const CryptoData& data,
bool* signature_match) const OVERRIDE { bool* signature_match) const OVERRIDE {
std::vector<uint8> result; std::vector<uint8_t> result;
Status status = Sign(algorithm, key, data, &result); Status status = Sign(algorithm, key, data, &result);
if (status.IsError()) if (status.IsError())
......
...@@ -42,7 +42,7 @@ SymKeyOpenSsl::SymKeyOpenSsl(const CryptoData& raw_key_data) ...@@ -42,7 +42,7 @@ SymKeyOpenSsl::SymKeyOpenSsl(const CryptoData& raw_key_data)
} }
bool PlatformSerializeKeyForClone(const blink::WebCryptoKey& key, bool PlatformSerializeKeyForClone(const blink::WebCryptoKey& key,
blink::WebVector<uint8>* key_data) { blink::WebVector<uint8_t>* key_data) {
const KeyOpenSsl* openssl_key = static_cast<KeyOpenSsl*>(key.handle()); const KeyOpenSsl* openssl_key = static_cast<KeyOpenSsl*>(key.handle());
*key_data = openssl_key->serialized_key_data(); *key_data = openssl_key->serialized_key_data();
return true; return true;
......
...@@ -5,12 +5,17 @@ ...@@ -5,12 +5,17 @@
#ifndef CONTENT_CHILD_WEBCRYPTO_OPENSSL_KEY_OPENSSL_H_ #ifndef CONTENT_CHILD_WEBCRYPTO_OPENSSL_KEY_OPENSSL_H_
#define CONTENT_CHILD_WEBCRYPTO_OPENSSL_KEY_OPENSSL_H_ #define CONTENT_CHILD_WEBCRYPTO_OPENSSL_KEY_OPENSSL_H_
#include "content/child/webcrypto/algorithm_implementation.h" #include <stdint.h>
#include <vector>
#include "base/macros.h"
#include "third_party/WebKit/public/platform/WebCryptoKey.h"
namespace content { namespace content {
namespace webcrypto { namespace webcrypto {
class CryptoData;
class SymKeyOpenSsl; class SymKeyOpenSsl;
// Base key class for all OpenSSL keys, used to safely cast between types. Each // Base key class for all OpenSSL keys, used to safely cast between types. Each
...@@ -24,12 +29,12 @@ class KeyOpenSsl : public blink::WebCryptoKeyHandle { ...@@ -24,12 +29,12 @@ class KeyOpenSsl : public blink::WebCryptoKeyHandle {
virtual SymKeyOpenSsl* AsSymKey(); virtual SymKeyOpenSsl* AsSymKey();
const std::vector<uint8>& serialized_key_data() const { const std::vector<uint8_t>& serialized_key_data() const {
return serialized_key_data_; return serialized_key_data_;
} }
private: private:
const std::vector<uint8> serialized_key_data_; const std::vector<uint8_t> serialized_key_data_;
}; };
class SymKeyOpenSsl : public KeyOpenSsl { class SymKeyOpenSsl : public KeyOpenSsl {
...@@ -41,7 +46,7 @@ class SymKeyOpenSsl : public KeyOpenSsl { ...@@ -41,7 +46,7 @@ class SymKeyOpenSsl : public KeyOpenSsl {
virtual SymKeyOpenSsl* AsSymKey() OVERRIDE; virtual SymKeyOpenSsl* AsSymKey() OVERRIDE;
const std::vector<uint8>& raw_key_data() const { const std::vector<uint8_t>& raw_key_data() const {
return serialized_key_data(); return serialized_key_data();
} }
......
...@@ -57,7 +57,7 @@ class DigestorOpenSsl : public blink::WebCryptoDigestor { ...@@ -57,7 +57,7 @@ class DigestorOpenSsl : public blink::WebCryptoDigestor {
return true; return true;
} }
Status FinishWithVectorAndStatus(std::vector<uint8>* result) { Status FinishWithVectorAndStatus(std::vector<uint8_t>* result) {
const int hash_expected_size = EVP_MD_CTX_size(digest_context_.get()); const int hash_expected_size = EVP_MD_CTX_size(digest_context_.get());
result->resize(hash_expected_size); result->resize(hash_expected_size);
unsigned char* const hash_buffer = Uint8VectorStart(result); unsigned char* const hash_buffer = Uint8VectorStart(result);
...@@ -112,7 +112,7 @@ class ShaImplementation : public AlgorithmImplementation { ...@@ -112,7 +112,7 @@ class ShaImplementation : public AlgorithmImplementation {
public: public:
virtual Status Digest(const blink::WebCryptoAlgorithm& algorithm, virtual Status Digest(const blink::WebCryptoAlgorithm& algorithm,
const CryptoData& data, const CryptoData& data,
std::vector<uint8>* buffer) const OVERRIDE { std::vector<uint8_t>* buffer) const OVERRIDE {
DigestorOpenSsl digestor(algorithm.id()); DigestorOpenSsl digestor(algorithm.id());
Status error = digestor.ConsumeWithStatus(data.bytes(), data.byte_length()); Status error = digestor.ConsumeWithStatus(data.bytes(), data.byte_length());
// http://crbug.com/366427: the spec does not define any other failures for // http://crbug.com/366427: the spec does not define any other failures for
......
...@@ -5,11 +5,10 @@ ...@@ -5,11 +5,10 @@
#ifndef CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ #ifndef CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_
#define CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ #define CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_
#include <stdint.h>
#include <vector> #include <vector>
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "content/common/content_export.h"
#include "third_party/WebKit/public/platform/WebCrypto.h" #include "third_party/WebKit/public/platform/WebCrypto.h"
// The definitions for these methods lives in either nss/ or openssl/ // The definitions for these methods lives in either nss/ or openssl/
...@@ -33,7 +32,7 @@ AlgorithmImplementation* CreatePlatformRsaOaepImplementation(); ...@@ -33,7 +32,7 @@ AlgorithmImplementation* CreatePlatformRsaOaepImplementation();
AlgorithmImplementation* CreatePlatformRsaSsaImplementation(); AlgorithmImplementation* CreatePlatformRsaSsaImplementation();
bool PlatformSerializeKeyForClone(const blink::WebCryptoKey& key, bool PlatformSerializeKeyForClone(const blink::WebCryptoKey& key,
blink::WebVector<uint8>* key_data); blink::WebVector<uint8_t>* key_data);
} // namespace webcrypto } // namespace webcrypto
......
...@@ -101,7 +101,7 @@ bool ValidateDeserializedKey(const blink::WebCryptoKey& key, ...@@ -101,7 +101,7 @@ bool ValidateDeserializedKey(const blink::WebCryptoKey& key,
// Note that this function is called from the target Blink thread. // Note that this function is called from the target Blink thread.
bool SerializeKeyForClone(const blink::WebCryptoKey& key, bool SerializeKeyForClone(const blink::WebCryptoKey& key,
blink::WebVector<uint8>* key_data) { blink::WebVector<uint8_t>* key_data) {
return PlatformSerializeKeyForClone(key, key_data); return PlatformSerializeKeyForClone(key, key_data);
} }
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
#ifndef CONTENT_CHILD_WEBCRYPTO_STRUCTURED_CLONE_H_ #ifndef CONTENT_CHILD_WEBCRYPTO_STRUCTURED_CLONE_H_
#define CONTENT_CHILD_WEBCRYPTO_STRUCTURED_CLONE_H_ #define CONTENT_CHILD_WEBCRYPTO_STRUCTURED_CLONE_H_
#include "base/basictypes.h" #include <stdint.h>
#include "third_party/WebKit/public/platform/WebCrypto.h" #include "third_party/WebKit/public/platform/WebCrypto.h"
namespace content { namespace content {
...@@ -16,7 +17,7 @@ class CryptoData; ...@@ -16,7 +17,7 @@ class CryptoData;
// Called on the target Blink thread. // Called on the target Blink thread.
bool SerializeKeyForClone(const blink::WebCryptoKey& key, bool SerializeKeyForClone(const blink::WebCryptoKey& key,
blink::WebVector<uint8>* key_data); blink::WebVector<uint8_t>* key_data);
// Called on the target Blink thread. // Called on the target Blink thread.
bool DeserializeKeyForClone(const blink::WebCryptoKeyAlgorithm& algorithm, bool DeserializeKeyForClone(const blink::WebCryptoKeyAlgorithm& algorithm,
......
...@@ -109,7 +109,7 @@ void CompleteWithError(const Status& status, blink::WebCryptoResult* result) { ...@@ -109,7 +109,7 @@ void CompleteWithError(const Status& status, blink::WebCryptoResult* result) {
} }
void CompleteWithBufferOrError(const Status& status, void CompleteWithBufferOrError(const Status& status,
const std::vector<uint8>& buffer, const std::vector<uint8_t>& buffer,
blink::WebCryptoResult* result) { blink::WebCryptoResult* result) {
if (status.IsError()) { if (status.IsError()) {
CompleteWithError(status, result); CompleteWithError(status, result);
...@@ -199,9 +199,9 @@ struct EncryptState : public BaseState { ...@@ -199,9 +199,9 @@ struct EncryptState : public BaseState {
const blink::WebCryptoAlgorithm algorithm; const blink::WebCryptoAlgorithm algorithm;
const blink::WebCryptoKey key; const blink::WebCryptoKey key;
const std::vector<uint8> data; const std::vector<uint8_t> data;
std::vector<uint8> buffer; std::vector<uint8_t> buffer;
}; };
typedef EncryptState DecryptState; typedef EncryptState DecryptState;
...@@ -248,7 +248,7 @@ struct ImportKeyState : public BaseState { ...@@ -248,7 +248,7 @@ struct ImportKeyState : public BaseState {
key(blink::WebCryptoKey::createNull()) {} key(blink::WebCryptoKey::createNull()) {}
const blink::WebCryptoKeyFormat format; const blink::WebCryptoKeyFormat format;
const std::vector<uint8> key_data; const std::vector<uint8_t> key_data;
const blink::WebCryptoAlgorithm algorithm; const blink::WebCryptoAlgorithm algorithm;
const bool extractable; const bool extractable;
const blink::WebCryptoKeyUsageMask usage_mask; const blink::WebCryptoKeyUsageMask usage_mask;
...@@ -265,7 +265,7 @@ struct ExportKeyState : public BaseState { ...@@ -265,7 +265,7 @@ struct ExportKeyState : public BaseState {
const blink::WebCryptoKeyFormat format; const blink::WebCryptoKeyFormat format;
const blink::WebCryptoKey key; const blink::WebCryptoKey key;
std::vector<uint8> buffer; std::vector<uint8_t> buffer;
}; };
typedef EncryptState SignState; typedef EncryptState SignState;
...@@ -287,8 +287,8 @@ struct VerifySignatureState : public BaseState { ...@@ -287,8 +287,8 @@ struct VerifySignatureState : public BaseState {
const blink::WebCryptoAlgorithm algorithm; const blink::WebCryptoAlgorithm algorithm;
const blink::WebCryptoKey key; const blink::WebCryptoKey key;
const std::vector<uint8> signature; const std::vector<uint8_t> signature;
const std::vector<uint8> data; const std::vector<uint8_t> data;
bool verify_result; bool verify_result;
}; };
...@@ -310,7 +310,7 @@ struct WrapKeyState : public BaseState { ...@@ -310,7 +310,7 @@ struct WrapKeyState : public BaseState {
const blink::WebCryptoKey wrapping_key; const blink::WebCryptoKey wrapping_key;
const blink::WebCryptoAlgorithm wrap_algorithm; const blink::WebCryptoAlgorithm wrap_algorithm;
std::vector<uint8> buffer; std::vector<uint8_t> buffer;
}; };
struct UnwrapKeyState : public BaseState { struct UnwrapKeyState : public BaseState {
...@@ -334,7 +334,7 @@ struct UnwrapKeyState : public BaseState { ...@@ -334,7 +334,7 @@ struct UnwrapKeyState : public BaseState {
unwrapped_key(blink::WebCryptoKey::createNull()) {} unwrapped_key(blink::WebCryptoKey::createNull()) {}
const blink::WebCryptoKeyFormat format; const blink::WebCryptoKeyFormat format;
const std::vector<uint8> wrapped_key; const std::vector<uint8_t> wrapped_key;
const blink::WebCryptoKey wrapping_key; const blink::WebCryptoKey wrapping_key;
const blink::WebCryptoAlgorithm unwrap_algorithm; const blink::WebCryptoAlgorithm unwrap_algorithm;
const blink::WebCryptoAlgorithm unwrapped_key_algorithm; const blink::WebCryptoAlgorithm unwrapped_key_algorithm;
......
...@@ -16,13 +16,13 @@ namespace content { ...@@ -16,13 +16,13 @@ namespace content {
namespace webcrypto { namespace webcrypto {
const uint8* Uint8VectorStart(const std::vector<uint8>& data) { const uint8_t* Uint8VectorStart(const std::vector<uint8_t>& data) {
if (data.empty()) if (data.empty())
return NULL; return NULL;
return &data[0]; return &data[0];
} }
uint8* Uint8VectorStart(std::vector<uint8>* data) { uint8_t* Uint8VectorStart(std::vector<uint8_t>* data) {
if (data->empty()) if (data->empty())
return NULL; return NULL;
return &(*data)[0]; return &(*data)[0];
...@@ -52,7 +52,7 @@ std::string Base64EncodeUrlSafe(const base::StringPiece& input) { ...@@ -52,7 +52,7 @@ std::string Base64EncodeUrlSafe(const base::StringPiece& input) {
return output; return output;
} }
std::string Base64EncodeUrlSafe(const std::vector<uint8>& input) { std::string Base64EncodeUrlSafe(const std::vector<uint8_t>& input) {
const base::StringPiece string_piece( const base::StringPiece string_piece(
reinterpret_cast<const char*>(Uint8VectorStart(input)), input.size()); reinterpret_cast<const char*>(Uint8VectorStart(input)), input.size());
return Base64EncodeUrlSafe(string_piece); return Base64EncodeUrlSafe(string_piece);
......
...@@ -5,9 +5,10 @@ ...@@ -5,9 +5,10 @@
#ifndef CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ #ifndef CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_
#define CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ #define CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_
#include <stdint.h>
#include <string> #include <string>
#include <vector> #include <vector>
#include "base/basictypes.h"
#include "base/strings/string_piece.h" #include "base/strings/string_piece.h"
#include "base/values.h" #include "base/values.h"
#include "content/common/content_export.h" #include "content/common/content_export.h"
...@@ -23,8 +24,9 @@ class Status; ...@@ -23,8 +24,9 @@ class Status;
// Returns a pointer to the start of |data|, or NULL if it is empty. This is a // Returns a pointer to the start of |data|, or NULL if it is empty. This is a
// convenience function for getting the pointer, and should not be used beyond // convenience function for getting the pointer, and should not be used beyond
// the expected lifetime of |data|. // the expected lifetime of |data|.
CONTENT_EXPORT const uint8* Uint8VectorStart(const std::vector<uint8>& data); CONTENT_EXPORT const uint8_t* Uint8VectorStart(
CONTENT_EXPORT uint8* Uint8VectorStart(std::vector<uint8>* data); const std::vector<uint8_t>& data);
CONTENT_EXPORT uint8_t* Uint8VectorStart(std::vector<uint8_t>* data);
// This function decodes unpadded 'base64url' encoded data, as described in // This function decodes unpadded 'base64url' encoded data, as described in
// RFC4648 (http://www.ietf.org/rfc/rfc4648.txt) Section 5. // RFC4648 (http://www.ietf.org/rfc/rfc4648.txt) Section 5.
...@@ -35,7 +37,8 @@ CONTENT_EXPORT bool Base64DecodeUrlSafe(const std::string& input, ...@@ -35,7 +37,8 @@ CONTENT_EXPORT bool Base64DecodeUrlSafe(const std::string& input,
// Returns an unpadded 'base64url' encoding of the input data, the opposite of // Returns an unpadded 'base64url' encoding of the input data, the opposite of
// Base64DecodeUrlSafe() above. // Base64DecodeUrlSafe() above.
CONTENT_EXPORT std::string Base64EncodeUrlSafe(const base::StringPiece& input); CONTENT_EXPORT std::string Base64EncodeUrlSafe(const base::StringPiece& input);
CONTENT_EXPORT std::string Base64EncodeUrlSafe(const std::vector<uint8>& input); CONTENT_EXPORT std::string Base64EncodeUrlSafe(
const std::vector<uint8_t>& input);
// Composes a Web Crypto usage mask from an array of JWK key_ops values. // Composes a Web Crypto usage mask from an array of JWK key_ops values.
CONTENT_EXPORT Status GetWebCryptoUsagesFromJwkKeyOps( CONTENT_EXPORT Status GetWebCryptoUsagesFromJwkKeyOps(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment