keyexchange.proto 6.6 KB

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