keyexchange.proto 5.2 KB

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