#ifndef SESSION_H #define SESSION_H #include #include #include #include #include #include #include "Utils.h" #include "stdlib.h" #include "ShannonConnection.h" #include "LoginBlob.h" #include "ApResolve.h" #include "PlainConnection.h" #include "Packet.h" #include "ConstantParameters.h" #include "Crypto.h" #include "NanoPBHelper.h" #include "protobuf/authentication.pb.h" #include "protobuf/keyexchange.pb.h" #define SPOTIFY_VERSION 0x10800000000 #define LOGIN_REQUEST_COMMAND 0xAB #define AUTH_SUCCESSFUL_COMMAND 0xAC #define AUTH_DECLINED_COMMAND 0xAD class Session { private: ClientResponseEncrypted authRequest; ClientResponsePlaintext clientResPlaintext; ClientHello clientHello; APResponseMessage apResponse; std::shared_ptr conn; std::unique_ptr crypto; std::vector sendClientHelloRequest(); void processAPHelloResponse(std::vector &helloPacket); public: Session(); ~Session(); std::shared_ptr shanConn; std::shared_ptr authBlob; void connect(std::unique_ptr connection); void connectWithRandomAp(); void close(); std::vector authenticate(std::shared_ptr blob); }; #endif