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