OLD | NEW |
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/base/x509_certificate.h" | 5 #include "net/base/x509_certificate.h" |
6 | 6 |
7 #include <cert.h> | 7 #include <cert.h> |
8 #include <cryptohi.h> | 8 #include <cryptohi.h> |
9 #include <keyhi.h> | 9 #include <keyhi.h> |
10 #include <nss.h> | 10 #include <nss.h> |
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 unsigned int result_len; | 1139 unsigned int result_len; |
1140 HASH_End(sha1_ctx, sha1.data, &result_len, HASH_ResultLenContext(sha1_ctx)); | 1140 HASH_End(sha1_ctx, sha1.data, &result_len, HASH_ResultLenContext(sha1_ctx)); |
1141 HASH_Destroy(sha1_ctx); | 1141 HASH_Destroy(sha1_ctx); |
1142 | 1142 |
1143 return sha1; | 1143 return sha1; |
1144 } | 1144 } |
1145 | 1145 |
1146 // static | 1146 // static |
1147 X509Certificate::OSCertHandle | 1147 X509Certificate::OSCertHandle |
1148 X509Certificate::ReadOSCertHandleFromPickle(const Pickle& pickle, | 1148 X509Certificate::ReadOSCertHandleFromPickle(const Pickle& pickle, |
1149 void** pickle_iter) { | 1149 PickleIterator* pickle_iter) { |
1150 const char* data; | 1150 const char* data; |
1151 int length; | 1151 int length; |
1152 if (!pickle.ReadData(pickle_iter, &data, &length)) | 1152 if (!pickle.ReadData(pickle_iter, &data, &length)) |
1153 return NULL; | 1153 return NULL; |
1154 | 1154 |
1155 return CreateOSCertHandleFromBytes(data, length); | 1155 return CreateOSCertHandleFromBytes(data, length); |
1156 } | 1156 } |
1157 | 1157 |
1158 // static | 1158 // static |
1159 bool X509Certificate::WriteOSCertHandleToPickle(OSCertHandle cert_handle, | 1159 bool X509Certificate::WriteOSCertHandleToPickle(OSCertHandle cert_handle, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 *type = kPublicKeyTypeECDSA; | 1191 *type = kPublicKeyTypeECDSA; |
1192 break; | 1192 break; |
1193 default: | 1193 default: |
1194 *type = kPublicKeyTypeUnknown; | 1194 *type = kPublicKeyTypeUnknown; |
1195 *size_bits = 0; | 1195 *size_bits = 0; |
1196 break; | 1196 break; |
1197 } | 1197 } |
1198 } | 1198 } |
1199 | 1199 |
1200 } // namespace net | 1200 } // namespace net |
OLD | NEW |