mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -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
@ -169,6 +169,14 @@ func main() {
|
||||
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.Write(challenge)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user