diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2012-05-01 12:12:37 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2012-05-01 12:12:37 +0200 |
commit | 94c1eec169db66bb4ad9d633342aead3b0f35b9f (patch) | |
tree | 969bcb05d5fcbe9e48a4b2ecd83e8fcc22e078f7 /src/libpiano/response.c | |
parent | 2996dda98357643334a334a6fcac05cd0c9065ea (diff) | |
download | pianobar-94c1eec169db66bb4ad9d633342aead3b0f35b9f.tar.gz pianobar-94c1eec169db66bb4ad9d633342aead3b0f35b9f.tar.bz2 pianobar-94c1eec169db66bb4ad9d633342aead3b0f35b9f.zip |
Don’t hardcode passwords
It’s a bad idea to hardcode these, although playback does not work with
non-android login yet.
Diffstat (limited to 'src/libpiano/response.c')
-rw-r--r-- | src/libpiano/response.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libpiano/response.c b/src/libpiano/response.c index 65af76e..4b33248 100644 --- a/src/libpiano/response.c +++ b/src/libpiano/response.c @@ -103,8 +103,9 @@ PianoReturn_t PianoResponse (PianoHandle_t *ph, PianoRequest_t *req) { size_t decryptedSize; ret = PIANO_RET_ERR; - if ((decryptedTimestamp = PianoDecryptString (cryptedTimestamp, - &decryptedSize)) != NULL && decryptedSize > 4) { + if ((decryptedTimestamp = PianoDecryptString (ph->partner.in, + cryptedTimestamp, &decryptedSize)) != NULL && + decryptedSize > 4) { /* skip four bytes garbage(?) at beginning */ timestamp = strtoul (decryptedTimestamp+4, NULL, 0); ph->timeOffset = realTimestamp - timestamp; @@ -112,9 +113,9 @@ PianoReturn_t PianoResponse (PianoHandle_t *ph, PianoRequest_t *req) { } free (decryptedTimestamp); /* get auth token */ - ph->partnerAuthToken = PianoJsonStrdup (result, + ph->partner.authToken = PianoJsonStrdup (result, "partnerAuthToken"); - ph->partnerId = json_object_get_int ( + ph->partner.id = json_object_get_int ( json_object_object_get (result, "partnerId")); ++reqData->step; break; |