mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-09-24 14:48:48 -04:00
Fix keepass-cr-recovery
keepass-cr-recovery used the challenge unpadded, add padding as in https://github.com/keepassxreboot/keepassxc/blob/develop/src/keys/drivers/YubiKeyInterfaceUSB.cpp\#L291 https://github.com/keepassxreboot/keepassxc/blob/develop/src/keys/drivers/YubiKeyInterfacePCSC.cpp\#L747 Closes #4744
This commit is contained in:
parent
8f76ea3106
commit
e6a6ba7d63
1 changed files with 8 additions and 0 deletions
|
@ -169,6 +169,14 @@ func main() {
|
||||||
log.Fatalf("couldn't read challenge: %s", err)
|
log.Fatalf("couldn't read challenge: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(challenge) < 64 {
|
||||||
|
padd := make([]byte, 64-len(challenge))
|
||||||
|
for i, _ := range padd {
|
||||||
|
padd[i] = byte(64-len(challenge))
|
||||||
|
}
|
||||||
|
challenge = append(challenge[:], padd[:]...)
|
||||||
|
}
|
||||||
|
|
||||||
mac := hmac.New(sha1.New, secret)
|
mac := hmac.New(sha1.New, secret)
|
||||||
mac.Write(challenge)
|
mac.Write(challenge)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue