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

Side by Side Diff: net/cert/x509_util_ios.cc

Issue 36593002: crypto/nss_util: Get TPM slot id, do lookup by id instead of by name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sandbox debugging crap Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/x509_util_ios.h" 5 #include "net/cert/x509_util_ios.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 #include <CommonCrypto/CommonDigest.h> 8 #include <CommonCrypto/CommonDigest.h>
9 #include <nss.h> 9 #include <nss.h>
10 #include <prtypes.h> 10 #include <prtypes.h>
(...skipping 10 matching lines...) Expand all
21 21
22 namespace { 22 namespace {
23 23
24 // Creates an NSS certificate handle from |data|, which is |length| bytes in 24 // Creates an NSS certificate handle from |data|, which is |length| bytes in
25 // size. 25 // size.
26 CERTCertificate* CreateNSSCertHandleFromBytes(const char* data, 26 CERTCertificate* CreateNSSCertHandleFromBytes(const char* data,
27 int length) { 27 int length) {
28 if (length < 0) 28 if (length < 0)
29 return NULL; 29 return NULL;
30 30
31 LOG(ERROR) << "HIIIIIIIIIIIIIIIIIIIIIIIIIII";
31 crypto::EnsureNSSInit(); 32 crypto::EnsureNSSInit();
32 33
33 if (!NSS_IsInitialized()) 34 if (!NSS_IsInitialized())
34 return NULL; 35 return NULL;
35 36
36 SECItem der_cert; 37 SECItem der_cert;
37 der_cert.data = reinterpret_cast<unsigned char*>(const_cast<char*>(data)); 38 der_cert.data = reinterpret_cast<unsigned char*>(const_cast<char*>(data));
38 der_cert.len = length; 39 der_cert.len = length;
39 der_cert.type = siDERCertBuffer; 40 der_cert.type = siDERCertBuffer;
40 41
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 CERTCertificate* NSSCertChain::cert_handle() const { 133 CERTCertificate* NSSCertChain::cert_handle() const {
133 return certs_.empty() ? NULL : certs_.front(); 134 return certs_.empty() ? NULL : certs_.front();
134 } 135 }
135 136
136 const std::vector<CERTCertificate*>& NSSCertChain::cert_chain() const { 137 const std::vector<CERTCertificate*>& NSSCertChain::cert_chain() const {
137 return certs_; 138 return certs_;
138 } 139 }
139 140
140 } // namespace x509_util_ios 141 } // namespace x509_util_ios
141 } // namespace net 142 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698