keyexchange.proto 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. syntax = "proto2";
  2. message ClientHello {
  3. required BuildInfo build_info = 0xa;
  4. repeated Fingerprint fingerprints_supported = 0x14;
  5. repeated Cryptosuite cryptosuites_supported = 0x1e;
  6. repeated Powscheme powschemes_supported = 0x28;
  7. required LoginCryptoHelloUnion login_crypto_hello = 0x32;
  8. required bytes client_nonce = 0x3c;
  9. optional bytes padding = 0x46;
  10. optional FeatureSet feature_set = 0x50;
  11. }
  12. message BuildInfo {
  13. required Product product = 0xa;
  14. repeated ProductFlags product_flags = 0x14;
  15. required Platform platform = 0x1e;
  16. required uint64 version = 0x28;
  17. }
  18. enum Product {
  19. PRODUCT_CLIENT = 0x0;
  20. PRODUCT_LIBSPOTIFY= 0x1;
  21. PRODUCT_MOBILE = 0x2;
  22. PRODUCT_PARTNER = 0x3;
  23. PRODUCT_LIBSPOTIFY_EMBEDDED = 0x5;
  24. }
  25. enum ProductFlags {
  26. PRODUCT_FLAG_NONE = 0x0;
  27. PRODUCT_FLAG_DEV_BUILD = 0x1;
  28. }
  29. enum Platform {
  30. PLATFORM_WIN32_X86 = 0x0;
  31. PLATFORM_OSX_X86 = 0x1;
  32. PLATFORM_LINUX_X86 = 0x2;
  33. PLATFORM_IPHONE_ARM = 0x3;
  34. PLATFORM_S60_ARM = 0x4;
  35. PLATFORM_OSX_PPC = 0x5;
  36. PLATFORM_ANDROID_ARM = 0x6;
  37. PLATFORM_WINDOWS_CE_ARM = 0x7;
  38. PLATFORM_LINUX_X86_64 = 0x8;
  39. PLATFORM_OSX_X86_64 = 0x9;
  40. PLATFORM_PALM_ARM = 0xa;
  41. PLATFORM_LINUX_SH = 0xb;
  42. PLATFORM_FREEBSD_X86 = 0xc;
  43. PLATFORM_FREEBSD_X86_64 = 0xd;
  44. PLATFORM_BLACKBERRY_ARM = 0xe;
  45. PLATFORM_SONOS = 0xf;
  46. PLATFORM_LINUX_MIPS = 0x10;
  47. PLATFORM_LINUX_ARM = 0x11;
  48. PLATFORM_LOGITECH_ARM = 0x12;
  49. PLATFORM_LINUX_BLACKFIN = 0x13;
  50. PLATFORM_WP7_ARM = 0x14;
  51. PLATFORM_ONKYO_ARM = 0x15;
  52. PLATFORM_QNXNTO_ARM = 0x16;
  53. PLATFORM_BCO_ARM = 0x17;
  54. }
  55. enum Fingerprint {
  56. FINGERPRINT_GRAIN = 0x0;
  57. FINGERPRINT_HMAC_RIPEMD = 0x1;
  58. }
  59. enum Cryptosuite {
  60. CRYPTO_SUITE_SHANNON = 0x0;
  61. CRYPTO_SUITE_RC4_SHA1_HMAC = 0x1;
  62. }
  63. enum Powscheme {
  64. POW_HASH_CASH = 0x0;
  65. }
  66. message LoginCryptoHelloUnion {
  67. optional LoginCryptoDiffieHellmanHello diffie_hellman = 0xa;
  68. }
  69. message LoginCryptoDiffieHellmanHello {
  70. required bytes gc = 0xa;
  71. required uint32 server_keys_known = 0x14;
  72. }
  73. message FeatureSet {
  74. optional bool autoupdate2 = 0x1;
  75. optional bool current_location = 0x2;
  76. }
  77. message APResponseMessage {
  78. optional APChallenge challenge = 0xa;
  79. optional UpgradeRequiredMessage upgrade = 0x14;
  80. optional APLoginFailed login_failed = 0x1e;
  81. }
  82. message APChallenge {
  83. required LoginCryptoChallengeUnion login_crypto_challenge = 0xa;
  84. required FingerprintChallengeUnion fingerprint_challenge = 0x14;
  85. required PoWChallengeUnion pow_challenge = 0x1e;
  86. required CryptoChallengeUnion crypto_challenge = 0x28;
  87. required bytes server_nonce = 0x32;
  88. optional bytes padding = 0x3c;
  89. }
  90. message LoginCryptoChallengeUnion {
  91. optional LoginCryptoDiffieHellmanChallenge diffie_hellman = 0xa;
  92. }
  93. message LoginCryptoDiffieHellmanChallenge {
  94. required bytes gs = 0xa;
  95. required int32 server_signature_key = 0x14;
  96. required bytes gs_signature = 0x1e;
  97. }
  98. message FingerprintChallengeUnion {
  99. optional FingerprintGrainChallenge grain = 0xa;
  100. optional FingerprintHmacRipemdChallenge hmac_ripemd = 0x14;
  101. }
  102. message FingerprintGrainChallenge {
  103. required bytes kek = 0xa;
  104. }
  105. message FingerprintHmacRipemdChallenge {
  106. required bytes challenge = 0xa;
  107. }
  108. message PoWChallengeUnion {
  109. optional PoWHashCashChallenge hash_cash = 0xa;
  110. }
  111. message PoWHashCashChallenge {
  112. optional bytes prefix = 0xa;
  113. optional int32 length = 0x14;
  114. optional int32 target = 0x1e;
  115. }
  116. message CryptoChallengeUnion {
  117. optional CryptoShannonChallenge shannon = 0xa;
  118. optional CryptoRc4Sha1HmacChallenge rc4_sha1_hmac = 0x14;
  119. }
  120. message CryptoShannonChallenge {
  121. }
  122. message CryptoRc4Sha1HmacChallenge {
  123. }
  124. message UpgradeRequiredMessage {
  125. required bytes upgrade_signed_part = 0xa;
  126. required bytes signature = 0x14;
  127. optional string http_suffix = 0x1e;
  128. }
  129. message APLoginFailed {
  130. required ErrorCode error_code = 0xa;
  131. optional int32 retry_delay = 0x14;
  132. optional int32 expiry = 0x1e;
  133. optional string error_description = 0x28;
  134. }
  135. enum ErrorCode {
  136. ProtocolError = 0x0;
  137. TryAnotherAP = 0x2;
  138. BadConnectionId = 0x5;
  139. TravelRestriction = 0x9;
  140. PremiumAccountRequired = 0xb;
  141. BadCredentials = 0xc;
  142. CouldNotValidateCredentials = 0xd;
  143. AccountExists = 0xe;
  144. ExtraVerificationRequired = 0xf;
  145. InvalidAppKey = 0x10;
  146. ApplicationBanned = 0x11;
  147. }
  148. message ClientResponsePlaintext {
  149. required LoginCryptoResponseUnion login_crypto_response = 0xa;
  150. required PoWResponseUnion pow_response = 0x14;
  151. required CryptoResponseUnion crypto_response = 0x1e;
  152. }
  153. message LoginCryptoResponseUnion {
  154. optional LoginCryptoDiffieHellmanResponse diffie_hellman = 0xa;
  155. }
  156. message LoginCryptoDiffieHellmanResponse {
  157. required bytes hmac = 0xa;
  158. }
  159. message PoWResponseUnion {
  160. optional PoWHashCashResponse hash_cash = 0xa;
  161. }
  162. message PoWHashCashResponse {
  163. required bytes hash_suffix = 0xa;
  164. }
  165. message CryptoResponseUnion {
  166. optional CryptoShannonResponse shannon = 0xa;
  167. optional CryptoRc4Sha1HmacResponse rc4_sha1_hmac = 0x14;
  168. }
  169. message CryptoShannonResponse {
  170. optional int32 dummy = 0x1;
  171. }
  172. message CryptoRc4Sha1HmacResponse {
  173. optional int32 dummy = 0x1;
  174. }