OLD | NEW |
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 "base/crypto/signature_creator.h" | 5 #include "base/crypto/signature_creator.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include "base/crypto/cssm_init.h" | 9 #include "base/crypto/cssm_init.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 key->key(), | 24 key->key(), |
25 &result->sig_handle_); | 25 &result->sig_handle_); |
26 if (crtn) { | 26 if (crtn) { |
27 NOTREACHED(); | 27 NOTREACHED(); |
28 return NULL; | 28 return NULL; |
29 } | 29 } |
30 | 30 |
31 crtn = CSSM_SignDataInit(result->sig_handle_); | 31 crtn = CSSM_SignDataInit(result->sig_handle_); |
32 if (crtn) { | 32 if (crtn) { |
33 NOTREACHED(); | 33 NOTREACHED(); |
34 return false; | 34 return NULL; |
35 } | 35 } |
36 | 36 |
37 return result.release(); | 37 return result.release(); |
38 } | 38 } |
39 | 39 |
40 SignatureCreator::SignatureCreator() : sig_handle_(0) { | 40 SignatureCreator::SignatureCreator() : sig_handle_(0) { |
41 EnsureCSSMInit(); | 41 EnsureCSSMInit(); |
42 } | 42 } |
43 | 43 |
44 SignatureCreator::~SignatureCreator() { | 44 SignatureCreator::~SignatureCreator() { |
(...skipping 24 matching lines...) Expand all Loading... |
69 } | 69 } |
70 | 70 |
71 signature->assign(sig.Data, sig.Data + sig.Length); | 71 signature->assign(sig.Data, sig.Data + sig.Length); |
72 kCssmMemoryFunctions.free_func(sig.Data, NULL); // Release data alloc'd | 72 kCssmMemoryFunctions.free_func(sig.Data, NULL); // Release data alloc'd |
73 // by CSSM | 73 // by CSSM |
74 | 74 |
75 return true; | 75 return true; |
76 } | 76 } |
77 | 77 |
78 } // namespace base | 78 } // namespace base |
OLD | NEW |