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

Side by Side Diff: net/base/keygen_handler_mac.cc

Issue 843005: Adds support for the <keygen> element to Windows, matching support present on... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Fixing remaining issues Created 10 years, 8 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/base/keygen_handler.cc ('k') | net/base/keygen_handler_nss.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/base/keygen_handler.h" 5 #include "net/base/keygen_handler.h"
6 6
7 #include <Security/SecAsn1Coder.h> 7 #include <Security/SecAsn1Coder.h>
8 #include <Security/SecAsn1Templates.h> 8 #include <Security/SecAsn1Templates.h>
9 #include <Security/Security.h> 9 #include <Security/Security.h>
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 82
83 static OSStatus CreateRSAKeyPair(int size_in_bits, 83 static OSStatus CreateRSAKeyPair(int size_in_bits,
84 SecKeyRef* out_pub_key, 84 SecKeyRef* out_pub_key,
85 SecKeyRef* out_priv_key); 85 SecKeyRef* out_priv_key);
86 static OSStatus SignData(CSSM_DATA data, 86 static OSStatus SignData(CSSM_DATA data,
87 SecKeyRef private_key, 87 SecKeyRef private_key,
88 CSSM_DATA* signature); 88 CSSM_DATA* signature);
89 89
90 90
91 bool KeygenHandler::KeyLocation::Equals(
92 const KeygenHandler::KeyLocation& location) const {
93 return keychain_path == location.keychain_path;
94 }
95
91 std::string KeygenHandler::GenKeyAndSignChallenge() { 96 std::string KeygenHandler::GenKeyAndSignChallenge() {
92 std::string result; 97 std::string result;
93 OSStatus err; 98 OSStatus err;
94 SecKeyRef public_key = NULL; 99 SecKeyRef public_key = NULL;
95 SecKeyRef private_key = NULL; 100 SecKeyRef private_key = NULL;
96 SecAsn1CoderRef coder = NULL; 101 SecAsn1CoderRef coder = NULL;
97 CSSM_DATA signature = {0, NULL}; 102 CSSM_DATA signature = {0, NULL};
98 103
99 { 104 {
100 // Create the key-pair. 105 // Create the key-pair.
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 CSSM_ALGID_MD5WithRSA, 248 CSSM_ALGID_MD5WithRSA,
244 &cc_handle); 249 &cc_handle);
245 if (err) 250 if (err)
246 return err; 251 return err;
247 err = CSSM_SignData(cc_handle, &data, 1, CSSM_ALGID_NONE, signature); 252 err = CSSM_SignData(cc_handle, &data, 1, CSSM_ALGID_NONE, signature);
248 CSSM_DeleteContext(cc_handle); 253 CSSM_DeleteContext(cc_handle);
249 return err; 254 return err;
250 } 255 }
251 256
252 } // namespace net 257 } // namespace net
OLDNEW
« no previous file with comments | « net/base/keygen_handler.cc ('k') | net/base/keygen_handler_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698