Skip to content

fingerprint is null when importing a key on non english GPG version #36

Open

Description

@ValkA

Can be temporarily fixed by adding environment variable LANG=en.

The fingerprint is null because of the following regex in gpg.js which assumes English output:
var keyRegex = /^gpg: key (.*?):/;

Activity

  1. steppefox commented on Feb 26, 2021

    @steppefox

    Well, ideally your server should be set in English. If for some reason, you need any other language set in your system, you can implement a custom import function. Basically:

    • copy paste import function from source code: https://github.com/drudge/node-gpg/blob/master/lib/gpg.js#L248 to your target file
    • Inside of that copy-pasted function, replace spawnGPG(keyStr, defaultArgs, args, function(importError, result) { with gpg.call(keyStr, defaultArgs, function(importError, result) {
    • Change keyRegex to desired one that'll fix your issue
    • Use your custom import function, instead of gpg.import

    Another solution - simply fork the package and fix that keyRegex :D Use your fork instead of the package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions