Skip to content

Error signing message: supportedAlgos is null #1819

@AndreEckner

Description

@AndreEckner
  • OpenPGP.js version: 6.0.0 & 6.0.1
  • Affected platform (Browser or Node.js version): Browser

I'm doing the openpgp.sign()-example from your Frontpage:

const publicKeyArmored = PortalHelper.getKeyPairs()[0].public;
const privateKeyArmored = PortalHelper.getKeyPairs()[0].private; // decrypted private key

const publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored });
const privateKey = await openpgp.readPrivateKey({ armoredKey: privateKeyArmored });

const unsignedMessage = await openpgp.createCleartextMessage({ text: 'Hello, World!' });
const cleartextMessage = await openpgp.sign({
	message: unsignedMessage, // CleartextMessage or Message object
	signingKeys: privateKey
});

and your getPreferredHashAlgo(...) throws an error: 'Error signing message: supportedAlgos is null'.
The exact same code runs in the older OpenPGP Version 5.11.1.

It dies here, because supportedAlgos is null at this point.
Image

That happens because a few lines above
selfCertification.preferredHashAlgorithms is null, too.
selfCertification.hashAlgorithm is 8, but seems to get ignored.

Image

thie primaryKey has Version = 4 and userID is {}.
config contains the preferredHashAlgorithm = 10.
Yet even if I change it to 8, as seems to have been the standard in 5.11.1, this changes nothing.

Image

Image

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