| 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 // Definitions for CryptAuth API calls. Do not edit unless transcribing | |
| 6 // from server definitions. | |
| 7 syntax = "proto2"; | |
| 8 | |
| 9 package cryptauth; | |
| 10 | |
| 11 option optimize_for = LITE_RUNTIME; | |
| 12 | |
| 13 // Basic device information used to classify the source of a request. | |
| 14 message DeviceClassifier { | |
| 15 // The Operating System version number on the device. | |
| 16 // (e.g., an android.os.Build.VERSION.SDK_INT) | |
| 17 optional int64 device_os_version_code = 14; | |
| 18 | |
| 19 // The software version number running on the device | |
| 20 // (e.g., GmsCore version code). | |
| 21 optional int64 device_software_version_code = 18; | |
| 22 | |
| 23 // Software package information if applicable | |
| 24 // (e.g., com.google.android.apps.authenticator2). | |
| 25 optional string device_software_package = 19; | |
| 26 | |
| 27 // Device type/platform. | |
| 28 optional DeviceType device_type = 32 [default = UNKNOWN]; | |
| 29 } | |
| 30 | |
| 31 enum DeviceType { | |
| 32 UNKNOWN = 0; | |
| 33 ANDROIDOS = 1; | |
| 34 CHROME = 2; | |
| 35 IOS = 3; | |
| 36 BROWSER = 4; | |
| 37 } | |
| 38 | |
| 39 // Device information provided to external clients that need to sync device | |
| 40 // state. | |
| 41 message ExternalDeviceInfo { | |
| 42 // A cryptographic public key associated with the device. | |
| 43 optional bytes public_key = 1; | |
| 44 | |
| 45 // A user friendly (human readable) name for this device. | |
| 46 optional string friendly_device_name = 2; | |
| 47 | |
| 48 // If available, the device's bluetooth MAC address. | |
| 49 optional string bluetooth_address = 3; | |
| 50 | |
| 51 // Whether or not this device can be used as an unlock key. | |
| 52 optional bool unlock_key = 4; | |
| 53 | |
| 54 // Whether or not this device can be unlocked. | |
| 55 optional bool unlockable = 5; | |
| 56 } | |
| 57 | |
| 58 // Determine if the calling device is allowed to promote the SmartLock | |
| 59 // feature to the user and contact the user's authzen enrolled devices to make | |
| 60 // them update their enrollments and to check if they're reachable (we don't | |
| 61 // want to show a promotional popup if the user has no reachable devices). | |
| 62 message FindEligibleForPromotionRequest { | |
| 63 // The public key of the device that is asking us whether it should show | |
| 64 // promotional material. Required. | |
| 65 optional bytes promoter_public_key = 2; | |
| 66 | |
| 67 // Information about the requesting device and its platform. | |
| 68 optional DeviceClassifier device_classifier = 3; | |
| 69 } | |
| 70 | |
| 71 // Contains the authzen transaction id that the caller can use to check if | |
| 72 // there are reachable devices. | |
| 73 message FindEligibleForPromotionResponse { | |
| 74 // Whether the caller is allowed to show promotional material. | |
| 75 optional bool may_show_promo = 1; | |
| 76 } | |
| 77 | |
| 78 // Request for a list of devices that could be used as Unlock Keys, optionally | |
| 79 // requesting a callback over bluetooth (for proximity detection). | |
| 80 message FindEligibleUnlockDevicesRequest { | |
| 81 // A bluetooth MAC address to be contacted if a device that may be eligible | |
| 82 // for unlock is nearby. If set, a message will be pushed to all eligible | |
| 83 // unlock devices requesting that they contact the specified MAC address. If | |
| 84 // this field is left unset, no callback will be made, and no message will be | |
| 85 // pushed to the user's devices. | |
| 86 optional string callback_bluetooth_address = 2; | |
| 87 | |
| 88 // During setup, we call find and sendDeviceSyncTickle. If no devices are | |
| 89 // found, we call find again, in hopes that the tickle caused a state | |
| 90 // change that made some device eligible. This is the count for these | |
| 91 // retries (in practice, this will always be 0 or 1). | |
| 92 // Should always be set. | |
| 93 optional int32 retry_count = 3; | |
| 94 | |
| 95 // If present and positive, the devices must have been updated within this | |
| 96 // many milliseconds of the RPC in order to be considered eligible. | |
| 97 optional int64 max_last_update_time_delta_millis = 4; | |
| 98 | |
| 99 // If true, we will not examine the push connectivity status of devices | |
| 100 // when determining eligibility. | |
| 101 optional bool offline_allowed = 5 [default = false]; | |
| 102 | |
| 103 // Information about the requesting device and its platform. | |
| 104 optional DeviceClassifier device_classifier = 6; | |
| 105 } | |
| 106 | |
| 107 // Response containing a list of devices that could be made Unlock Keys | |
| 108 message FindEligibleUnlockDevicesResponse { | |
| 109 // Devices that could be made Unlock Keys (even if they aren't enabled yet) | |
| 110 repeated ExternalDeviceInfo eligible_devices = 1; | |
| 111 | |
| 112 // Devices that cannot be made unlock keys, and reasons for this. This list | |
| 113 // will not contain any non-gms core devices, even though these are also not | |
| 114 // eligible to be unlock keys. | |
| 115 repeated IneligibleDevice ineligible_devices = 2; | |
| 116 } | |
| 117 | |
| 118 // Request to complete a device enrollment. | |
| 119 message FinishEnrollmentRequest { | |
| 120 // The enrollment session identifer from the <code>setup</code> response. | |
| 121 optional bytes enrollment_session_id = 2; | |
| 122 | |
| 123 // An encrypted payload containing enrollment information for the device. | |
| 124 optional bytes enrollment_message = 3; | |
| 125 | |
| 126 // A Diffie-Hellman public key for the device, to complete the key exchange. | |
| 127 optional bytes device_ephemeral_key = 4; | |
| 128 | |
| 129 // An integer encoding the reason this enrollment was invoked (triggered). | |
| 130 // See InvocationReason enum for definitions. | |
| 131 optional int32 invocation_reason = 11 [default = 0]; | |
| 132 | |
| 133 // How many retries of this operation have happened thus far. | |
| 134 optional int32 retry_count = 12 [default = 0]; | |
| 135 | |
| 136 // Information about the requesting device and its platform. | |
| 137 optional DeviceClassifier device_classifier = 13; | |
| 138 } | |
| 139 | |
| 140 // Response indicating whether a device enrollment completed successfully. | |
| 141 message FinishEnrollmentResponse { | |
| 142 // Status should be OK if the request was successful. | |
| 143 optional string status = 1; | |
| 144 | |
| 145 // A detailed error message if there was a failure. | |
| 146 optional string error_message = 2; | |
| 147 } | |
| 148 | |
| 149 // Device info uploaded during enrollment. | |
| 150 message GcmDeviceInfo { | |
| 151 // This field's name does not match the one in DeviceInfo for legacy reasons. | |
| 152 // Consider using long_device_id and device_type instead when enrolling | |
| 153 // non-android devices. | |
| 154 optional fixed64 android_device_id = 1; | |
| 155 | |
| 156 // Used for device_address of DeviceInfo field 2, but for GCM capable devices. | |
| 157 optional bytes gcm_registration_id = 102; | |
| 158 | |
| 159 // Used for device_address of DeviceInfo field 2, but for iOS devices. | |
| 160 optional bytes apn_registration_id = 202; | |
| 161 | |
| 162 // Has the user enabled the associated apn_registration_id for notifications. | |
| 163 optional bool apn_notification_enabled = 203 [default = false]; | |
| 164 | |
| 165 // Used for device_address of DeviceInfo field 2, a Bluetooth Mac address for | |
| 166 // the device (e.g., to be used with EasyUnlock). | |
| 167 optional string bluetooth_mac_address = 302; | |
| 168 | |
| 169 // SHA-256 hash of the device master key (from the key exchange). | |
| 170 // Differs from DeviceInfo field 3, which contains the actual master key. | |
| 171 optional bytes device_master_key_hash = 103; | |
| 172 | |
| 173 // A SecureMessage.EcP256PublicKey. | |
| 174 required bytes user_public_key = 4; | |
| 175 | |
| 176 // device's model name | |
| 177 // (e.g., an android.os.Build.MODEL or UIDevice.model). | |
| 178 optional string device_model = 7; | |
| 179 | |
| 180 // device's locale | |
| 181 optional string locale = 8; | |
| 182 | |
| 183 // The handle for user_public_key (and implicitly, a master key). | |
| 184 optional bytes key_handle = 9; | |
| 185 | |
| 186 // The initial counter value for the device, sent by the device. | |
| 187 optional int64 counter = 12 [default = 0]; | |
| 188 | |
| 189 // The Operating System version on the device | |
| 190 // (e.g., an android.os.Build.DISPLAY or UIDevice.systemVersion). | |
| 191 optional string device_os_version = 13; | |
| 192 | |
| 193 // The Operating System version number on the device | |
| 194 // (e.g., an android.os.Build.VERSION.SDK_INT). | |
| 195 optional int64 device_os_version_code = 14; | |
| 196 | |
| 197 // The Operating System release on the device | |
| 198 // (e.g., an android.os.Build.VERSION.RELEASE). | |
| 199 optional string device_os_release = 15; | |
| 200 | |
| 201 // The Operating System codename on the device | |
| 202 // (e.g., an android.os.Build.VERSION.CODENAME or UIDevice.systemName). | |
| 203 optional string device_os_codename = 16; | |
| 204 | |
| 205 // The software version running on the device | |
| 206 // (e.g., Authenticator app version string). | |
| 207 optional string device_software_version = 17; | |
| 208 | |
| 209 // The software version number running on the device | |
| 210 // (e.g., Authenticator app version code). | |
| 211 optional int64 device_software_version_code = 18; | |
| 212 | |
| 213 // Software package information if applicable | |
| 214 // (e.g., com.google.android.apps.authenticator2). | |
| 215 optional string device_software_package = 19; | |
| 216 | |
| 217 // Size of the display in thousandths of an inch (e.g., 7000 mils = 7 in). | |
| 218 optional int32 device_display_diagonal_mils = 22; | |
| 219 | |
| 220 // For Authzen capable devices, their Authzen protocol version. | |
| 221 optional int32 device_authzen_version = 24; | |
| 222 | |
| 223 // Not all devices have device identifiers that fit in 64 bits. | |
| 224 optional bytes long_device_id = 29; | |
| 225 | |
| 226 // The device manufacturer name | |
| 227 // (e.g., android.os.Build.MANUFACTURER). | |
| 228 optional string device_manufacturer = 31; | |
| 229 | |
| 230 // Used to indicate which type of device this is. | |
| 231 optional DeviceType device_type = 32 [default = ANDROIDOS]; | |
| 232 | |
| 233 // Fields corresponding to screenlock type/features and hardware features | |
| 234 // should be numbered in the 400 range. | |
| 235 | |
| 236 // Is this device using a secure screenlock (e.g., pattern or pin unlock). | |
| 237 optional bool using_secure_screenlock = 400 [default = false]; | |
| 238 | |
| 239 // Is auto-unlocking the screenlock (e.g., when at "home") supported? | |
| 240 optional bool auto_unlock_screenlock_supported = 401 [default = false]; | |
| 241 | |
| 242 // Is auto-unlocking the screenlock (e.g., when at "home") enabled? | |
| 243 optional bool auto_unlock_screenlock_enabled = 402 [default = false]; | |
| 244 | |
| 245 // Does the device have a Bluetooth (classic) radio? | |
| 246 optional bool bluetooth_radio_supported = 403 [default = false]; | |
| 247 | |
| 248 // Is the Bluetooth (classic) radio on? | |
| 249 optional bool bluetooth_radio_enabled = 404 [default = false]; | |
| 250 | |
| 251 // The enrollment session id this is sent with. | |
| 252 optional bytes enrollment_session_id = 1000; | |
| 253 | |
| 254 // A copy of the user's OAuth token. | |
| 255 optional string oauth_token = 1001; | |
| 256 } | |
| 257 | |
| 258 message GcmMetadata { | |
| 259 required MessageType type = 1; | |
| 260 optional int32 version = 2 [default = 0]; | |
| 261 } | |
| 262 | |
| 263 // Request for a listing of a user's own devices. | |
| 264 message GetMyDevicesRequest { | |
| 265 // Return only devices that can act as EasyUnlock keys. | |
| 266 optional bool approved_for_unlock_required = 2; | |
| 267 | |
| 268 // Allow the returned list to be somewhat out of date (read will be faster). | |
| 269 optional bool allow_stale_read = 3 [default = false]; | |
| 270 | |
| 271 // An integer encoding the reason this request was invoked (triggered). | |
| 272 // See InvocationReason enum for definitions. | |
| 273 optional int32 invocation_reason = 4 [default = 0]; | |
| 274 | |
| 275 // How many retries of this operation have happened thus far. | |
| 276 optional int32 retry_count = 5 [default = 0]; | |
| 277 | |
| 278 // Information about the requesting device and its platform. | |
| 279 optional DeviceClassifier device_classifier = 6; | |
| 280 } | |
| 281 | |
| 282 // Response containing a listing of the users devices. | |
| 283 message GetMyDevicesResponse { | |
| 284 // A listing of all sync-able devices. | |
| 285 repeated ExternalDeviceInfo devices = 1; | |
| 286 } | |
| 287 | |
| 288 // A device that the server thinks is not eligible to be an unlock key, and the | |
| 289 // reason for this. | |
| 290 message IneligibleDevice { | |
| 291 // The device that is not eligible to be an unlock key. | |
| 292 optional ExternalDeviceInfo device = 1; | |
| 293 | |
| 294 // The reasons why the server thinks it is not an unlock key. NOTE: for now, | |
| 295 // this list of reasons will contain exactly one element. It is a repeated | |
| 296 // field because, in principle, there can be more than one reason that makes a | |
| 297 // device not eligible to be an unlock key, and we want to be able to add | |
| 298 // multiple reasons in the future. | |
| 299 repeated string reasons = 2; | |
| 300 } | |
| 301 | |
| 302 // A list of "reasons" that can be provided for calling server-side APIs. | |
| 303 // This is particularly important for calls that can be triggered by different | |
| 304 // kinds of events. | |
| 305 // NOTE: Added INVOCATION_* prefix to enum names due to name conflict with | |
| 306 // preprocessor MACRO on Windows. | |
| 307 enum InvocationReason { | |
| 308 INVOCATION_REASON_UNKNOWN = 0; | |
| 309 // First run of the software package invoking this call. | |
| 310 INVOCATION_REASON_INITIALIZATION = 1; | |
| 311 // Ordinary periodic actions (e.g. monthly master key rotation). | |
| 312 INVOCATION_REASON_PERIODIC = 2; | |
| 313 // Slow-cycle periodic action (e.g. yearly keypair rotation???). | |
| 314 INVOCATION_REASON_SLOW_PERIODIC = 3; | |
| 315 // Fast-cycle periodic action (e.g. daily sync for Smart Lock users). | |
| 316 INVOCATION_REASON_FAST_PERIODIC = 4; | |
| 317 // Expired state (e.g. expired credentials, or cached entries) was detected. | |
| 318 INVOCATION_REASON_EXPIRATION = 5; | |
| 319 // An unexpected protocol failure occurred (so attempting to repair state). | |
| 320 INVOCATION_REASON_FAILURE_RECOVERY = 6; | |
| 321 // A new account has been added to the device. | |
| 322 INVOCATION_REASON_NEW_ACCOUNT = 7; | |
| 323 // An existing account on the device has been changed. | |
| 324 INVOCATION_REASON_CHANGED_ACCOUNT = 8; | |
| 325 // The user toggled the state of a feature (e.g. Smart Lock enabled via BT). | |
| 326 INVOCATION_REASON_FEATURE_TOGGLED = 9; | |
| 327 // A "push" from the server caused this action (e.g. a sync tickle). | |
| 328 INVOCATION_REASON_SERVER_INITIATED = 10; | |
| 329 // A local address change triggered this (e.g. GCM registration id changed). | |
| 330 INVOCATION_REASON_ADDRESS_CHANGE = 11; | |
| 331 // A software update has triggered this. | |
| 332 INVOCATION_REASON_SOFTWARE_UPDATE = 12; | |
| 333 // A manual action by the user triggered this (e.g. commands sent via adb). | |
| 334 INVOCATION_REASON_MANUAL = 13; | |
| 335 } | |
| 336 | |
| 337 // Note: This is the same enum as securegcm.Type in securegcm.proto in the | |
| 338 // server definitions. Renamed for clarity here. | |
| 339 enum MessageType { | |
| 340 ENROLLMENT = 0; | |
| 341 TICKLE = 1; | |
| 342 TX_REQUEST = 2; | |
| 343 TX_REPLY = 3; | |
| 344 TX_SYNC_REQUEST = 4; | |
| 345 TX_SYNC_RESPONSE = 5; | |
| 346 TX_PING = 6; | |
| 347 DEVICE_INFO_UPDATE = 7; | |
| 348 TX_CANCEL_REQUEST = 8; | |
| 349 PROXIMITYAUTH_PAIRING = 10; | |
| 350 GCMV1_IDENTITY_ASSERTION = 11; | |
| 351 | |
| 352 // Device-to-device communications are protected by an unauthenticated | |
| 353 // Diffie-Hellman exchange. The InitiatorHello message is simply the | |
| 354 // initiator's public DH key, and is not encoded as a SecureMessage, so | |
| 355 // it doesn't have a tag. | |
| 356 // The ResponderHello message (which is sent by the responder | |
| 357 // to the initiator), on the other hand, carries a payload that is protected | |
| 358 // by the derived shared key. It also contains the responder's | |
| 359 // public DH key. ResponderHelloAndPayload messages have the | |
| 360 // DEVICE_TO_DEVICE_RESPONDER_HELLO tag. | |
| 361 DEVICE_TO_DEVICE_RESPONDER_HELLO_PAYLOAD = 12; | |
| 362 | |
| 363 // Device-to-device communications are protected by an unauthenticated | |
| 364 // Diffie-Hellman exchange. Once the initiator and responder | |
| 365 // agree on a shared key (through Diffie-Hellman), they will use messages | |
| 366 // tagged with DEVICE_TO_DEVICE_MESSAGE to exchange data. | |
| 367 DEVICE_TO_DEVICE_MESSAGE = 13; | |
| 368 | |
| 369 // Notification to let a device know it should contact a nearby device. | |
| 370 DEVICE_PROXIMITY_CALLBACK = 14; | |
| 371 | |
| 372 // Device-to-device communications are protected by an unauthenticated | |
| 373 // Diffie-Hellman exchange. During device-to-device authentication, the first | |
| 374 // message from initiator (the challenge) is signed and put into the payload | |
| 375 // of the message sent back to the initiator. | |
| 376 UNLOCK_KEY_SIGNED_CHALLENGE = 15; | |
| 377 } | |
| 378 | |
| 379 // GCM tickles related to registration management. | |
| 380 enum RegistrationTickleType { | |
| 381 UNKNOWN_REGISTRATION_TICKLE_TYPE = 0; | |
| 382 | |
| 383 // Force a re-enrollment with the server. | |
| 384 FORCE_ENROLLMENT = 1; | |
| 385 | |
| 386 // Update enrollment information with the server. This could either be an | |
| 387 // authzen re-enrollment or a SyncTx. | |
| 388 UPDATE_ENROLLMENT = 2; | |
| 389 | |
| 390 // Devices that receive this should sync the user's list of devices. | |
| 391 DEVICES_SYNC = 3; | |
| 392 } | |
| 393 | |
| 394 // Requests to send a "tickle" requesting to sync all of a user's devices now | |
| 395 message SendDeviceSyncTickleRequest { | |
| 396 // The type of tickle. *_ENROLLMENT tickles will only be sent to | |
| 397 // android devices. DEVICES_SYNC will be sent to chromebooks and android | |
| 398 // devices. UNKNOWN_TICKLE_TYPE or absent will be treated as | |
| 399 // UPDATE_ENROLLMENT. | |
| 400 // This field will also determine GCM parameters, such as | |
| 401 // TTL and collapse token. | |
| 402 optional RegistrationTickleType tickle_type = 3; | |
| 403 | |
| 404 // Information about the requesting device and its platform. | |
| 405 optional DeviceClassifier device_classifier = 4; | |
| 406 } | |
| 407 | |
| 408 message SendDeviceSyncTickleResponse { | |
| 409 // empty for now. | |
| 410 } | |
| 411 | |
| 412 // Contains information needed to begin a device enrollment. | |
| 413 message SetupEnrollmentInfo { | |
| 414 // Type of protocol this setup information was requested for. | |
| 415 optional string type = 1; | |
| 416 | |
| 417 // A session identifier to be used for this enrollment session. | |
| 418 optional bytes enrollment_session_id = 2; | |
| 419 | |
| 420 // A Diffie-Hellman public key used to perform a key exchange during | |
| 421 // enrollment. | |
| 422 optional bytes server_ephemeral_key = 3; | |
| 423 } | |
| 424 | |
| 425 // Requests information needed to begin a device enrollment. | |
| 426 message SetupEnrollmentRequest { | |
| 427 // Deprecated. See <code>application_id</code>. | |
| 428 optional string origin = 2; | |
| 429 | |
| 430 // Type(s) of protocol supported by this enrolling device (e.g. "gcmV1"). | |
| 431 repeated string types = 3; | |
| 432 | |
| 433 // Indicates whether a legacy crypto suite must be used with this device. | |
| 434 optional bool use_legacy_crypto = 4; | |
| 435 | |
| 436 // A URL describing which application facets this enrollment can be used (see | |
| 437 // http://go/appid). | |
| 438 optional string application_id = 5; | |
| 439 | |
| 440 // An integer encoding the reason this enrollment was invoked (triggered). | |
| 441 // See InvocationReason enum for definitions. | |
| 442 optional int32 invocation_reason = 6 [default = 0]; | |
| 443 | |
| 444 // How many retries of this operation have happened thus far. | |
| 445 optional int32 retry_count = 7 [default = 0]; | |
| 446 | |
| 447 // Information about the requesting device and its platform. | |
| 448 optional DeviceClassifier device_classifier = 8; | |
| 449 } | |
| 450 | |
| 451 // Contains information needed to begin a device enrollment. | |
| 452 message SetupEnrollmentResponse { | |
| 453 // Should return OK if the request was well formed. | |
| 454 optional string status = 1; | |
| 455 | |
| 456 // Information for each of the requested protocol <code>type</code>s. | |
| 457 repeated SetupEnrollmentInfo infos = 2; | |
| 458 } | |
| 459 | |
| 460 // Used to enable or disable EasyUnlock features on a specified device, and also | |
| 461 // causes other devices to sync the new EasyUnlock state. | |
| 462 message ToggleEasyUnlockRequest { | |
| 463 // If true, Easy Unlock will be enabled for the device with public key equal | |
| 464 // to public_key. Otherwise, it will be disabled for that device. | |
| 465 optional bool enable = 1; | |
| 466 | |
| 467 // Encoded public key of the device to enable/disable (here you must use the | |
| 468 // same exact encoding that was sent during device enrollment). | |
| 469 optional bytes public_key = 2; | |
| 470 | |
| 471 // If true, EasyUnlock enabled state will be set to the value of "enable" for | |
| 472 // all of a user's devices. This is the same as calling the toggle RPC for | |
| 473 // every device. However, this removes the need for calling GetMyDevices, so | |
| 474 // it reduces network overhead. If this field is set "public_key" must not be | |
| 475 // set. NOTE: the case enable=true is not yet supported, so this option can | |
| 476 // only disable EasyUnlock for all devices. | |
| 477 optional bool apply_to_all = 3; | |
| 478 | |
| 479 // Information about the requesting device and its platform. | |
| 480 optional DeviceClassifier device_classifier = 4; | |
| 481 } | |
| 482 | |
| 483 message ToggleEasyUnlockResponse { | |
| 484 // empty for now. | |
| 485 } | |
| OLD | NEW |