Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPG remove notation piping in input failing due to control character #1

Open
shombando opened this issue Oct 28, 2020 · 0 comments
Open
Labels
help wanted Extra attention is needed

Comments

@shombando
Copy link
Owner

GPG doesn't provide unattended notation manipulation capabilities through the cli to my knowledge. While "interactively" sending the notation information works for GPG during adding a notation. GPG rejects deleting the notation since it has to be sent with a control character and GPG has no knowledge that I'm not trying to add this notation. I've not been able to escape the "-" to sneak it past.

The function called deleteNotation is intended to interact with GPG and edit a key to remove a notation. This function is setup exactly the same addNotationrefactor which works just fine. The relevant snippet is here where removeNotation just prepends a "-" to the notation string:

   removeNotation="-$1"
   {
      echo notation
      echo $removeNotation
      echo save
   } | gpg --command-fd=0 --status-fd=1 --edit-key $fingerPrint

The relevant commit is: 5489d68

Here's the output and error:

gpg (GnuPG) 2.2.19; Copyright (C) 2019 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

[GNUPG:] REMOVED THE KEY INFO THAT IS PRINTED

[GNUPG:] GET_LINE keyedit.prompt
[GNUPG:] GOT_IT
[GNUPG:] GET_LINE keyedit.add_notation
[GNUPG:] GOT_IT
gpg: a notation value must not use any control characters

[GNUPG:] GET_LINE keyedit.prompt
[GNUPG:] GOT_IT
Key not changed so no update needed.

I'm opening this issue to seek help from the community.

[refactor]: after this issue is resolved the idea is to refactor to a single modifyNotation function.

@shombando shombando added the help wanted Extra attention is needed label Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant