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

Side by Side Diff: crypto/signature_verifier_nss.cc

Issue 7189044: net: Don't access SECOID_AlgorithmIDTemplate directly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 | « no previous file | net/base/dnssec_keyset.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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 SECKEY_DestroyPublicKey(public_key); 47 SECKEY_DestroyPublicKey(public_key);
48 return false; 48 return false;
49 } 49 }
50 50
51 SECItem sig_alg_der; 51 SECItem sig_alg_der;
52 sig_alg_der.type = siBuffer; 52 sig_alg_der.type = siBuffer;
53 sig_alg_der.data = const_cast<uint8*>(signature_algorithm); 53 sig_alg_der.data = const_cast<uint8*>(signature_algorithm);
54 sig_alg_der.len = signature_algorithm_len; 54 sig_alg_der.len = signature_algorithm_len;
55 SECAlgorithmID sig_alg_id; 55 SECAlgorithmID sig_alg_id;
56 SECStatus rv; 56 SECStatus rv;
57 rv = SEC_QuickDERDecodeItem(arena, &sig_alg_id, SECOID_AlgorithmIDTemplate, 57 rv = SEC_QuickDERDecodeItem(arena, &sig_alg_id,
58 SEC_ASN1_GET(SECOID_AlgorithmIDTemplate),
58 &sig_alg_der); 59 &sig_alg_der);
59 if (rv != SECSuccess) { 60 if (rv != SECSuccess) {
60 SECKEY_DestroyPublicKey(public_key); 61 SECKEY_DestroyPublicKey(public_key);
61 PORT_FreeArena(arena, PR_TRUE); 62 PORT_FreeArena(arena, PR_TRUE);
62 return false; 63 return false;
63 } 64 }
64 65
65 SECItem sig; 66 SECItem sig;
66 sig.type = siBuffer; 67 sig.type = siBuffer;
67 sig.data = const_cast<uint8*>(signature); 68 sig.data = const_cast<uint8*>(signature);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 105
105 void SignatureVerifier::Reset() { 106 void SignatureVerifier::Reset() {
106 if (vfy_context_) { 107 if (vfy_context_) {
107 VFY_DestroyContext(vfy_context_, PR_TRUE); 108 VFY_DestroyContext(vfy_context_, PR_TRUE);
108 vfy_context_ = NULL; 109 vfy_context_ = NULL;
109 } 110 }
110 signature_.clear(); 111 signature_.clear();
111 } 112 }
112 113
113 } // namespace crypto 114 } // namespace crypto
OLDNEW
« no previous file with comments | « no previous file | net/base/dnssec_keyset.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698