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

Side by Side Diff: crypto/signature_verifier_nss.cc

Issue 6880166: Improving logging in /app, /base, /crypto and /ipc. Updating plain DCHECK() usages for DCHECK_EQ/LE/ (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Static casting to DWORD to fix type mismatch Created 9 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « crypto/signature_verifier_mac.cc ('k') | crypto/signature_verifier_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "crypto/signature_verifier.h" 5 #include "crypto/signature_verifier.h"
6 6
7 #include <cryptohi.h> 7 #include <cryptohi.h>
8 #include <keyhi.h> 8 #include <keyhi.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 if (rv != SECSuccess) { 83 if (rv != SECSuccess) {
84 NOTREACHED(); 84 NOTREACHED();
85 return false; 85 return false;
86 } 86 }
87 return true; 87 return true;
88 } 88 }
89 89
90 void SignatureVerifier::VerifyUpdate(const uint8* data_part, 90 void SignatureVerifier::VerifyUpdate(const uint8* data_part,
91 int data_part_len) { 91 int data_part_len) {
92 SECStatus rv = VFY_Update(vfy_context_, data_part, data_part_len); 92 SECStatus rv = VFY_Update(vfy_context_, data_part, data_part_len);
93 DCHECK(rv == SECSuccess); 93 DCHECK_EQ(SECSuccess, rv);
94 } 94 }
95 95
96 bool SignatureVerifier::VerifyFinal() { 96 bool SignatureVerifier::VerifyFinal() {
97 SECStatus rv = VFY_End(vfy_context_); 97 SECStatus rv = VFY_End(vfy_context_);
98 Reset(); 98 Reset();
99 99
100 // If signature verification fails, the error code is 100 // If signature verification fails, the error code is
101 // SEC_ERROR_BAD_SIGNATURE (-8182). 101 // SEC_ERROR_BAD_SIGNATURE (-8182).
102 return (rv == SECSuccess); 102 return (rv == SECSuccess);
103 } 103 }
104 104
105 void SignatureVerifier::Reset() { 105 void SignatureVerifier::Reset() {
106 if (vfy_context_) { 106 if (vfy_context_) {
107 VFY_DestroyContext(vfy_context_, PR_TRUE); 107 VFY_DestroyContext(vfy_context_, PR_TRUE);
108 vfy_context_ = NULL; 108 vfy_context_ = NULL;
109 } 109 }
110 signature_.clear(); 110 signature_.clear();
111 } 111 }
112 112
113 } // namespace crypto 113 } // namespace crypto
OLDNEW
« no previous file with comments | « crypto/signature_verifier_mac.cc ('k') | crypto/signature_verifier_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698