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

Side by Side Diff: crypto/ec_signature_creator_nss.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 "crypto/ec_signature_creator_impl.h" 5 #include "crypto/ec_signature_creator_impl.h"
6 6
7 #include <cryptohi.h> 7 #include <cryptohi.h>
8 #include <pk11pub.h> 8 #include <pk11pub.h>
9 #include <secerr.h> 9 #include <secerr.h>
10 #include <sechash.h> 10 #include <sechash.h>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 // DER encode the signature. 55 // DER encode the signature.
56 return DSAU_EncodeDerSigWithLen(result, &sig, sig.len); 56 return DSAU_EncodeDerSigWithLen(result, &sig, sig.len);
57 } 57 }
58 58
59 } // namespace 59 } // namespace
60 60
61 ECSignatureCreatorImpl::ECSignatureCreatorImpl(ECPrivateKey* key) 61 ECSignatureCreatorImpl::ECSignatureCreatorImpl(ECPrivateKey* key)
62 : key_(key), 62 : key_(key),
63 signature_len_(0) { 63 signature_len_(0) {
64 LOG(ERROR) << "HIIIIIIIIIIIIIIIIIIIIIIIIIII";
64 EnsureNSSInit(); 65 EnsureNSSInit();
65 } 66 }
66 67
67 ECSignatureCreatorImpl::~ECSignatureCreatorImpl() {} 68 ECSignatureCreatorImpl::~ECSignatureCreatorImpl() {}
68 69
69 bool ECSignatureCreatorImpl::Sign(const uint8* data, 70 bool ECSignatureCreatorImpl::Sign(const uint8* data,
70 int data_len, 71 int data_len,
71 std::vector<uint8>* signature) { 72 std::vector<uint8>* signature) {
72 // Data to be signed 73 // Data to be signed
73 SECItem secret; 74 SECItem secret;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 106
106 SECItem* raw_sig = DSAU_DecodeDerSigToLen(&der_sig_item, signature_len_); 107 SECItem* raw_sig = DSAU_DecodeDerSigToLen(&der_sig_item, signature_len_);
107 if (!raw_sig) 108 if (!raw_sig)
108 return false; 109 return false;
109 out_raw_sig->assign(raw_sig->data, raw_sig->data + raw_sig->len); 110 out_raw_sig->assign(raw_sig->data, raw_sig->data + raw_sig->len);
110 SECITEM_FreeItem(raw_sig, PR_TRUE /* free SECItem structure itself. */); 111 SECITEM_FreeItem(raw_sig, PR_TRUE /* free SECItem structure itself. */);
111 return true; 112 return true;
112 } 113 }
113 114
114 } // namespace crypto 115 } // namespace crypto
OLDNEW
« no previous file with comments | « crypto/ec_private_key_nss.cc ('k') | crypto/encryptor_nss.cc » ('j') | crypto/nss_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698