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

Unified Diff: extensions/browser/api/cast_channel/cast_auth_util_nss.cc

Issue 687733004: Implement crypto signature verification routines using OpenSSL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Standardized capitalization of error strings, quick fixes Created 6 years, 2 months 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
Index: extensions/browser/api/cast_channel/cast_auth_util_nss.cc
diff --git a/extensions/browser/api/cast_channel/cast_auth_util_nss.cc b/extensions/browser/api/cast_channel/cast_auth_util_nss.cc
index 9a0d067a72f6ae80ecab358fa6e58bdcc0ec07bd..2d5bd143dcb1698a6c37f27f8d54982aa9dbdada 100644
--- a/extensions/browser/api/cast_channel/cast_auth_util_nss.cc
+++ b/extensions/browser/api/cast_channel/cast_auth_util_nss.cc
@@ -30,10 +30,10 @@ typedef scoped_ptr<
ScopedCERTCertificate;
// Authenticates the given credentials:
-// 1. |signature| verification of |data| using |certificate|.
+// 1. |signature| verification of |peer_cert| using |certificate|.
// 2. |certificate| is signed by a trusted CA.
AuthResult VerifyCredentials(const AuthResponse& response,
- const std::string& data) {
+ const std::string& peer_cert) {
const std::string kErrorPrefix("Failed to verify credentials: ");
const std::string& certificate = response.client_auth_certificate();
const std::string& signature = response.signature();
@@ -98,7 +98,7 @@ AuthResult VerifyCredentials(const AuthResponse& response,
VLOG(1) << "Cert signed by trusted CA";
- // Verify that the |signature| matches |data|.
+ // Verify that the |signature| matches |peer_cert|.
crypto::ScopedSECKEYPublicKey public_key(CERT_ExtractPublicKey(cert.get()));
if (!public_key.get()) {
return AuthResult::CreateWithNSSError(
@@ -112,7 +112,7 @@ AuthResult VerifyCredentials(const AuthResponse& response,
const_cast<char*>(signature.data()));
signature_item.len = signature.length();
verified = VFY_VerifyDataDirect(
- reinterpret_cast<unsigned char*>(const_cast<char*>(data.data())),
+ reinterpret_cast<unsigned char*>(const_cast<char*>(peer_cert.data())),
data.size(),
public_key.get(),
&signature_item,

Powered by Google App Engine
This is Rietveld 408576698