Skip to content

Commit

Permalink
Merge branch DavidSouthgate:pr
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenisanerd committed Mar 9, 2023
2 parents c95fb93 + ec27659 commit bb54321
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile.am
Expand Up @@ -86,6 +86,7 @@ TESTS = tests/export-android-v2.pipe \
tests/export-v3-sdtid.pipe \
tests/tokencode-v2.pipe \
tests/tokencode-v3.pipe \
tests/tokencode-v4.pipe \
tests/tokencode-sdtid.pipe \
tests/mac-align.pipe

Expand Down
4 changes: 3 additions & 1 deletion src/securid.c
Expand Up @@ -491,7 +491,7 @@ static void v3_derive_key(const char *pass, const char *devid, const uint8_t *sa
memcpy(&buf0[pass_len + V3_DEVID_CHARS + 16], salt, V3_NONCE_BYTES);

/* for v3 yup, the PBKDF2 password is really "every 2nd byte of the input"
* for v3 we need to use full buffer */
* for v4 we need to use full buffer */
if (version == 3) {
for (i = 1; i < buf_len; i += 2)
buf1[i >> 1] = buf0[i];
Expand Down Expand Up @@ -536,6 +536,8 @@ static int v3_decode_token(const char *in, struct securid_token *t)
return ERR_GENERAL;
}

t->version = t->v3->version;

/* more flags will get populated later when we decrypt the payload */
t->flags = t->v3->password_locked ? FL_PASSPROT : 0;
t->flags |= t->v3->devid_locked ? FL_SNPROT : 0;
Expand Down
1 change: 1 addition & 0 deletions tests/tokencode-v4.pipe
@@ -0,0 +1 @@
$STOKEN tokencode --token 'com.rsa.securid://ctf?ctfData=BAABaKfqKwgEkWDGEgaxp2ZGloQ7dDw2A8PglNlhP8qCBhtop%2BorCASRYMYSBrGnZkaWhDt0PDYDw%2BCU2WE%2FyoIGGznAfd6pVLcjsDtpKoG5APTUrXL51Bdnf%2FCDvZanmNEGhzDCbsDsFTFyLgKzdht0X1tKt23tFwP%2FDYg9xDS1HvS8Jy3QfT04PFNm%2BdCUUZyMIoTzdFT01msNHtrRxePWU7cB32CE48U%2BKlbW4hPyhphJhkg5qxUA38cD05J1s44hI3FTjaq%2FAhAKAQWsDy7TZE6qtU5f6cYIzdr5PKILhTyCeXRxiYuLinAkXEHWm%2F%2FrFKyroQpn%2FVYAA3NLS59HWBQwWyS2kzhtlzJh%2BI25IMhdhLvVdXdjuNzRxkwjc74z' --use-time 1650391605 --pin 1234 --devid 'd82c-467c-56fb-2058-edf8-add6'
1 change: 1 addition & 0 deletions tests/tokencode-v4.ref
@@ -0,0 +1 @@
891523

0 comments on commit bb54321

Please sign in to comment.