OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 syntax = "proto2"; | |
6 | |
7 option optimize_for = LITE_RUNTIME; | |
8 | |
9 package cast_channel; | |
10 | |
11 message CastMessage { | |
12 // Always pass a version of the protocol for future compatibility | |
13 // requirements. | |
14 enum ProtocolVersion { CASTV2_1_0 = 0; } | |
15 required ProtocolVersion protocol_version = 1; | |
16 | |
17 // source and destination ids identify the origin and destination of the | |
18 // message. They are used to route messages between endpoints that share a | |
19 // device-to-device channel. | |
20 // | |
21 // For messages between applications: | |
22 // - The sender application id is a unique identifier generated on behalf of | |
23 // the sender application. | |
24 // - The receiver id is always the the session id for the application. | |
25 // | |
26 // For messages to or from the sender or receiver platform, the special ids | |
27 // 'sender-0' and 'receiver-0' can be used. | |
28 // | |
29 // For messages intended for all endpoints using a given channel, the | |
30 // wildcard destination_id '*' can be used. | |
31 required string source_id = 2; | |
32 required string destination_id = 3; | |
33 | |
34 // This is the core multiplexing key. All messages are sent on a namespace | |
35 // and endpoints sharing a channel listen on one or more namespaces. The | |
36 // namespace defines the protocol and semantics of the message. | |
37 required string namespace = 4; | |
38 | |
39 // Encoding and payload info follows. | |
40 | |
41 // What type of data do we have in this message. | |
42 enum PayloadType { | |
43 STRING = 0; | |
44 BINARY = 1; | |
45 } | |
46 required PayloadType payload_type = 5; | |
47 | |
48 // Depending on payload_type, exactly one of the following optional fields | |
49 // will always be set. | |
50 optional string payload_utf8 = 6; | |
51 optional bytes payload_binary = 7; | |
52 } | |
53 | |
54 enum SignatureAlgorithm { | |
55 UNSPECIFIED = 0; | |
56 RSASSA_PKCS1v15 = 1; | |
57 RSASSA_PSS = 2; | |
58 } | |
59 | |
60 enum HashAlgorithm { | |
61 SHA1 = 0; | |
62 SHA256 = 1; | |
63 } | |
64 | |
65 // Messages for authentication protocol between a sender and a receiver. | |
66 message AuthChallenge { | |
67 optional SignatureAlgorithm signature_algorithm = 1 | |
68 [default = RSASSA_PKCS1v15]; | |
69 optional bytes sender_nonce = 2; | |
70 optional HashAlgorithm hash_algorithm = 3 [default = SHA1]; | |
71 } | |
72 | |
73 message AuthResponse { | |
74 required bytes signature = 1; | |
75 required bytes client_auth_certificate = 2; | |
76 repeated bytes intermediate_certificate = 3; | |
77 optional SignatureAlgorithm signature_algorithm = 4 | |
78 [default = RSASSA_PKCS1v15]; | |
79 optional bytes sender_nonce = 5; | |
80 optional HashAlgorithm hash_algorithm = 6 [default = SHA1]; | |
81 optional bytes crl = 7; | |
82 } | |
83 | |
84 message AuthError { | |
85 enum ErrorType { | |
86 INTERNAL_ERROR = 0; | |
87 NO_TLS = 1; // The underlying connection is not TLS | |
88 SIGNATURE_ALGORITHM_UNAVAILABLE = 2; | |
89 } | |
90 required ErrorType error_type = 1; | |
91 } | |
92 | |
93 message DeviceAuthMessage { | |
94 // Request fields | |
95 optional AuthChallenge challenge = 1; | |
96 // Response fields | |
97 optional AuthResponse response = 2; | |
98 optional AuthError error = 3; | |
99 } | |
OLD | NEW |