OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/extensions/api/cast_channel/cast_auth_util.h" | 5 #include "chrome/browser/extensions/api/cast_channel/cast_auth_util.h" |
6 | 6 |
7 #include <cert.h> | 7 #include <cert.h> |
8 #include <cryptohi.h> | 8 #include <cryptohi.h> |
9 #include <pk11pub.h> | 9 #include <pk11pub.h> |
10 #include <seccomon.h> | 10 #include <seccomon.h> |
(...skipping 26 matching lines...) Expand all Loading... |
37 0xad, 0x20, 0x40, 0x12, 0xf1, 0xdd, 0x25, 0xeb, 0xd5, 0xe6, 0xb8, 0x36, | 37 0xad, 0x20, 0x40, 0x12, 0xf1, 0xdd, 0x25, 0xeb, 0xd5, 0xe6, 0xb8, 0x36, |
38 0xf4, 0xd6, 0x8f, 0x7f, 0xca, 0x43, 0xdc, 0xd7, 0x10, 0x5b, 0xe6, 0x3f, | 38 0xf4, 0xd6, 0x8f, 0x7f, 0xca, 0x43, 0xdc, 0xd7, 0x10, 0x5b, 0xe6, 0x3f, |
39 0x51, 0x8a, 0x85, 0xb3, 0xf3, 0xff, 0xf6, 0x03, 0x2d, 0xcb, 0x23, 0x4f, | 39 0x51, 0x8a, 0x85, 0xb3, 0xf3, 0xff, 0xf6, 0x03, 0x2d, 0xcb, 0x23, 0x4f, |
40 0x9c, 0xad, 0x18, 0xe7, 0x93, 0x05, 0x8c, 0xac, 0x52, 0x9a, 0xf7, 0x4c, | 40 0x9c, 0xad, 0x18, 0xe7, 0x93, 0x05, 0x8c, 0xac, 0x52, 0x9a, 0xf7, 0x4c, |
41 0xe9, 0x99, 0x7a, 0xbe, 0x6e, 0x7e, 0x4d, 0x0a, 0xe3, 0xc6, 0x1c, 0xa9, | 41 0xe9, 0x99, 0x7a, 0xbe, 0x6e, 0x7e, 0x4d, 0x0a, 0xe3, 0xc6, 0x1c, 0xa9, |
42 0x93, 0xfa, 0x3a, 0xa5, 0x91, 0x5d, 0x1c, 0xbd, 0x66, 0xeb, 0xcc, 0x60, | 42 0x93, 0xfa, 0x3a, 0xa5, 0x91, 0x5d, 0x1c, 0xbd, 0x66, 0xeb, 0xcc, 0x60, |
43 0xdc, 0x86, 0x74, 0xca, 0xcf, 0xf8, 0x92, 0x1c, 0x98, 0x7d, 0x57, 0xfa, | 43 0xdc, 0x86, 0x74, 0xca, 0xcf, 0xf8, 0x92, 0x1c, 0x98, 0x7d, 0x57, 0xfa, |
44 0x61, 0x47, 0x9e, 0xab, 0x80, 0xb7, 0xe4, 0x48, 0x80, 0x2a, 0x92, 0xc5, | 44 0x61, 0x47, 0x9e, 0xab, 0x80, 0xb7, 0xe4, 0x48, 0x80, 0x2a, 0x92, 0xc5, |
45 0x1b, 0x02, 0x03, 0x01, 0x00, 0x01 }; | 45 0x1b, 0x02, 0x03, 0x01, 0x00, 0x01 }; |
46 | 46 |
47 typedef scoped_ptr_malloc< | 47 typedef scoped_ptr< |
48 CERTCertificate, | 48 CERTCertificate, |
49 crypto::NSSDestroyer<CERTCertificate, CERT_DestroyCertificate> > | 49 crypto::NSSDestroyer<CERTCertificate, CERT_DestroyCertificate> > |
50 ScopedCERTCertificate; | 50 ScopedCERTCertificate; |
51 | 51 |
52 // Parses out DeviceAuthMessage from CastMessage | 52 // Parses out DeviceAuthMessage from CastMessage |
53 static bool ParseAuthMessage( | 53 static bool ParseAuthMessage( |
54 const extensions::api::cast_channel::CastMessage& challenge_reply, | 54 const extensions::api::cast_channel::CastMessage& challenge_reply, |
55 extensions::api::cast_channel::DeviceAuthMessage* auth_message) { | 55 extensions::api::cast_channel::DeviceAuthMessage* auth_message) { |
56 if (challenge_reply.payload_type() != | 56 if (challenge_reply.payload_type() != |
57 extensions::api::cast_channel::CastMessage_PayloadType_BINARY) { | 57 extensions::api::cast_channel::CastMessage_PayloadType_BINARY) { |
58 VLOG(1) << "Wrong payload type in challenge reply"; | 58 VLOG(1) << "Wrong payload type in challenge reply"; |
59 return false; | 59 return false; |
60 } | 60 } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 const AuthResponse& response = auth_message.response(); | 159 const AuthResponse& response = auth_message.response(); |
160 return VerifyCredentials(response.client_auth_certificate(), | 160 return VerifyCredentials(response.client_auth_certificate(), |
161 response.signature(), | 161 response.signature(), |
162 peer_cert); | 162 peer_cert); |
163 } | 163 } |
164 | 164 |
165 } // namespace cast_channel | 165 } // namespace cast_channel |
166 } // namespace api | 166 } // namespace api |
167 } // namespace extensions | 167 } // namespace extensions |
OLD | NEW |