]> git.proxmox.com Git - libpve-u2f-server-perl.git/commit
publicKey data can contain NUL, base64 encode at source
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 9 Apr 2019 10:39:13 +0000 (12:39 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 9 Apr 2019 10:39:15 +0000 (12:39 +0200)
commit257314d5cede4ab7fa0a7038ea25c083557015a4
treef7301912b20dea396b2e4efb9e8aab73870ff500
parent90360196aa3f13432f143dfd699666382ed3811c
publicKey data can contain NUL, base64 encode at source

One *mustn't* treat the publicKey as common string, it it's
effectively binary data, and thus can contain 0 at any position.

If we pass it to perl via setpv (PV being string), things may get
cutoff and a wrong pubKey may get saved, thus locking an user out as
it cannot get verified anymore!

Use a simple & fast base64 encoding immediately at the source, using
the correct keylength (U2FS_PUBLIC_KEY_LEN) we can use that.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Makefile
U2F.xs
base64.h [new file with mode: 0644]