Index: base/crypto/symmetric_key_nss.cc |
diff --git a/base/crypto/symmetric_key_nss.cc b/base/crypto/symmetric_key_nss.cc |
index 1e3551d32ed75fc80132b1880b80facef44daad8..f29bbb9fd066fcab4296f241fea753cebcb1e04f 100644 |
--- a/base/crypto/symmetric_key_nss.cc |
+++ b/base/crypto/symmetric_key_nss.cc |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -15,6 +15,13 @@ namespace base { |
SymmetricKey::~SymmetricKey() {} |
// static |
+bool SymmetricKey::GenerateRandomBytes(size_t num_bytes, uint8* out) { |
+LOG(ERROR) << "GenerateRandomBytes nss" << num_bytes; |
+ return num_bytes == 0 || |
+ (out != NULL && PK11_GenerateRandom(out, num_bytes) == SECSuccess); |
+} |
+ |
+// static |
SymmetricKey* SymmetricKey::GenerateRandomKey(Algorithm algorithm, |
size_t key_size_in_bits) { |
DCHECK_EQ(AES, algorithm); |