u2f: new perl bindings encode public key for us

as it was binary data, which can contain everything, including '\0',
and this was cut off, making it impossible to login after
registration, as a borked publicKey got saved in tfa.cfg

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-04-09 12:44:23 +02:00
parent 4473c96caf
commit eb25cbafc3

View File

@ -589,7 +589,7 @@ __PACKAGE__->register_method ({
my ($keyHandle, $publicKey) = $u2f->registration_verify($response);
PVE::AccessControl::user_set_tfa($userid, $realm, 'u2f', {
keyHandle => $keyHandle,
publicKey => encode_base64($publicKey, ''),
publicKey => $publicKey, # already base64 encoded
});
} else {
die "invalid action: $action\n";