Skip to content

Bug: import / set prv.key allows 00 and FF prefix public keys #1481

@Beanow

Description

@Beanow

Public keys with 0x00 or 0xFF are reserved according to the keygen loop.

while (count < 10 && (self_id.pub_key[0] == 0x00 || self_id.pub_key[0] == 0xFF)) { // reserved id hashes

while (count < 10 && (the_mesh.self_id.pub_key[0] == 0x00 || the_mesh.self_id.pub_key[0] == 0xFF)) { // reserved id hashes

etc.

However when using set prv.key or "Import Private Key" for companions, it will accept a private key that produces an invalid public key.
Here are some example keypairs to test:

pub: FF00CFB4E51CF52DE6637520A7249C6750B6D6F6559BE0E81E545260F1C41A47
prv: 906BA4A632E42F0E186DCB5F51CE527D75B485A5EDFFBF9A2EBB248757DE2174339D1AE5D2C5F12D141EE4ABE78D3CAD8BFB744E8ED1CFE8089B7DEC7C74C3BD
pub: 00FFF43904E75DADC39C742917C927C4660431A89EA8206D91F0708D26C6A0D6
prv: B0EBF2C68FA8BEDD0B66AB4F1CAFDF78A6C81EEE6EC5F3A7696B9D4F22B7C86EEA0352AC5ADF31647AD6499F240F05A63F7F573418C22B13B0B4A6CEB6327708

⚠️ don't use these for any private messaging now that I've posted them here!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions