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

Side by Side Diff: google_apis/cup/client_update_protocol_nss.cc

Issue 169193002: Convert scoped_ptr_malloc -> scoped_ptr, part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 10 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 | « device/hid/hid_service_win.cc ('k') | media/audio/alsa/alsa_output.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "google_apis/cup/client_update_protocol.h" 5 #include "google_apis/cup/client_update_protocol.h"
6 6
7 #include <keyhi.h> 7 #include <keyhi.h>
8 #include <pk11pub.h> 8 #include <pk11pub.h>
9 #include <seccomon.h> 9 #include <seccomon.h>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "crypto/nss_util.h" 12 #include "crypto/nss_util.h"
13 #include "crypto/scoped_nss_types.h" 13 #include "crypto/scoped_nss_types.h"
14 14
15 typedef scoped_ptr_malloc< 15 typedef scoped_ptr<CERTSubjectPublicKeyInfo,
16 CERTSubjectPublicKeyInfo, 16 crypto::NSSDestroyer<CERTSubjectPublicKeyInfo,
17 crypto::NSSDestroyer<CERTSubjectPublicKeyInfo, 17 SECKEY_DestroySubjectPublicKeyInfo> >
18 SECKEY_DestroySubjectPublicKeyInfo> >
19 ScopedCERTSubjectPublicKeyInfo; 18 ScopedCERTSubjectPublicKeyInfo;
20 19
21 ClientUpdateProtocol::~ClientUpdateProtocol() { 20 ClientUpdateProtocol::~ClientUpdateProtocol() {
22 if (public_key_) 21 if (public_key_)
23 SECKEY_DestroyPublicKey(public_key_); 22 SECKEY_DestroyPublicKey(public_key_);
24 } 23 }
25 24
26 bool ClientUpdateProtocol::LoadPublicKey(const base::StringPiece& public_key) { 25 bool ClientUpdateProtocol::LoadPublicKey(const base::StringPiece& public_key) {
27 crypto::EnsureNSSInit(); 26 crypto::EnsureNSSInit();
28 27
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 71
73 encrypted_key_source_.resize(keysize); 72 encrypted_key_source_.resize(keysize);
74 return SECSuccess == PK11_PubEncryptRaw( 73 return SECSuccess == PK11_PubEncryptRaw(
75 public_key_, 74 public_key_,
76 &encrypted_key_source_[0], 75 &encrypted_key_source_[0],
77 const_cast<unsigned char*>(&key_source[0]), 76 const_cast<unsigned char*>(&key_source[0]),
78 key_source.size(), 77 key_source.size(),
79 NULL); 78 NULL);
80 } 79 }
81 80
OLDNEW
« no previous file with comments | « device/hid/hid_service_win.cc ('k') | media/audio/alsa/alsa_output.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698