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

Side by Side Diff: net/cert/jwk_serializer_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, 9 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 | « net/cert/cert_verify_proc_win.cc ('k') | net/cert/scoped_nss_types.h » ('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 "net/cert/jwk_serializer.h" 5 #include "net/cert/jwk_serializer.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 #include <keyhi.h> 8 #include <keyhi.h>
9 #include <nss.h> 9 #include <nss.h>
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 }; 62 };
63 if (spki->algorithm.parameters.len == sizeof(kPrime256v1) && 63 if (spki->algorithm.parameters.len == sizeof(kPrime256v1) &&
64 !memcmp(spki->algorithm.parameters.data, kPrime256v1, 64 !memcmp(spki->algorithm.parameters.data, kPrime256v1,
65 sizeof(kPrime256v1))) { 65 sizeof(kPrime256v1))) {
66 return ConvertEcPrime256v1PublicKeyInfoToJwk(spki, public_key_jwk); 66 return ConvertEcPrime256v1PublicKeyInfoToJwk(spki, public_key_jwk);
67 } 67 }
68 // TODO(juanlang): other curves 68 // TODO(juanlang): other curves
69 return false; 69 return false;
70 } 70 }
71 71
72 typedef scoped_ptr_malloc< 72 typedef scoped_ptr<
73 CERTSubjectPublicKeyInfo, 73 CERTSubjectPublicKeyInfo,
74 crypto::NSSDestroyer<CERTSubjectPublicKeyInfo, 74 crypto::NSSDestroyer<CERTSubjectPublicKeyInfo,
75 SECKEY_DestroySubjectPublicKeyInfo> > 75 SECKEY_DestroySubjectPublicKeyInfo> >
76 ScopedCERTSubjectPublicKeyInfo; 76 ScopedCERTSubjectPublicKeyInfo;
77 77
78 } // namespace 78 } // namespace
79 79
80 bool ConvertSpkiFromDerToJwk( 80 bool ConvertSpkiFromDerToJwk(
81 const base::StringPiece& spki_der, 81 const base::StringPiece& spki_der,
82 base::DictionaryValue* public_key_jwk) { 82 base::DictionaryValue* public_key_jwk) {
(...skipping 26 matching lines...) Expand all
109 sizeof(kIdEcPublicKey))) { 109 sizeof(kIdEcPublicKey))) {
110 rv = ConvertEcPublicKeyInfoToJwk(spki.get(), public_key_jwk); 110 rv = ConvertEcPublicKeyInfoToJwk(spki.get(), public_key_jwk);
111 } 111 }
112 // TODO(juanlang): other algorithms 112 // TODO(juanlang): other algorithms
113 return rv; 113 return rv;
114 } 114 }
115 115
116 } // namespace JwkSerializer 116 } // namespace JwkSerializer
117 117
118 } // namespace net 118 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/cert_verify_proc_win.cc ('k') | net/cert/scoped_nss_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698