The org-encrypt-entry fails to encrypt an entry, with a wrong-type-argument. I am currently using doom-emacs, and created a corresponding issue (https://github.com/hlissner/doom-emacs/issues/3123), where I was told to report the issue upstream. As hlissner mentioned in the above issue, it seems to be that the issue is the org-encrypt-string function expects epa-file-encrypt-to to be a string, but epa-file-encrypt-to's documentation says 'May either be a string or a list of strings.'. Doom-emacs sets it to a list of strings. Backtrace: Debugger entered--Lisp error: (wrong-type-argument stringp stringp) format-message(stringp) apply(format-message stringp) error(stringp) org-encrypt-entry() funcall-interactively(org-encrypt-entry) call-interactively(org-encrypt-entry record nil) command-execute(org-encrypt-entry record) counsel-M-x-action("org-encrypt-entry") ivy-call() ivy-read("M-x " ("org-encrypt-entry" "doom/toggle-debug-mode" "org-encrypt-entries" "org-decrypt-entry" "cd" "5x5" "amx" "arp" "dbx" "dig" "erc" "ert" "eww" "ftp" "gdb" "irc" "jdb" "man" "mpc" "pdb" "pwd" "rsh" "sdb" "xdb" "calc" "deft" "diff" "dirs" "ffap" "gnus" "grep" "help" "ielm" "info" "life" "lsp!" "mail" "mpuz" "ping" "pong" "talk" "term" "undo" "yank" "zone" "align" "chmod" "debug" "diary" "dired" ...) :predicate #f(compiled-function (x) #<bytecode 0x298e655>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x) counsel-M-x() funcall-interactively(counsel-M-x) call-interactively(counsel-M-x nil nil) command-execute(counsel-M-x) Emacs : GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10) of 2019-08-30 Package: Org mode version 9.4 (nil @ /home/silipwn/.emacs.d/.local/straight/build/org-mode/)
Hello,
silipwn <mail@silipwn.digital> writes:
> The org-encrypt-entry fails to encrypt an entry, with a wrong-type-argument.
> I am currently using doom-emacs, and created a corresponding issue (https://github.com/hlissner/doom-emacs/issues/3123),
> where I was told to report the issue upstream.
> As hlissner mentioned in the above issue, it seems to be that the
> issue is the org-encrypt-string function expects epa-file-encrypt-to
> to be a string, but epa-file-encrypt-to's documentation says 'May
> either be a string or a list of strings.'.
> Doom-emacs sets it to a list of strings.
I am a bit surprised you even reached `epa-file-encrypt-to'. I assume
`org-crypt-key' was nil.
Anyway, I pushed a fix in master. Could you try it?
Thank you.
Regards,
--
Nicolas Goaziou
On 15.05.2020 17:00, Nicolas Goaziou wrote:
>Anyway, I pushed a fix in master. Could you try it?
The current commit, still results in a error. I had a set the
org-crypt-key to nil. It still prompts to use a key.
The current backtrace is similar to this:
Debugger entered--Lisp error: (error "GPG error: \"Encrypt failed\",
\"Unusable public key: 49F84EA6007F964D; Exit\"")
signal(error ("GPG error: \"Encrypt failed\", \"Unusable public key:
49F84EA6007F964D; Exit\""))
error("GPG error: \"Encrypt failed\", \"Unusable public key:
49F84EA6007F964D; Exit\"")
--
Regards,
Silipwn
Never trust an operating system you don't have sources for. ;-)
-- Unknown source
silipwn <mail@silipwn.digital> writes: > The current commit, still results in a error. I had a set the > org-crypt-key to nil. This is not a valid value: `org-crypt-key' must be a string. > It still prompts to use a key. I think setting `org-crypt-key' to nil means: use all keys in your key ring. Some of them are not trusted, others may be invalid. Again, use default empty string if you don't want to set a key and would rather use symmetric encryption. > The current backtrace is similar to this: > > Debugger entered--Lisp error: (error "GPG error: \"Encrypt failed\", > \"Unusable public key: 49F84EA6007F964D; Exit\"") > signal(error ("GPG error: \"Encrypt failed\", \"Unusable public key: > 49F84EA6007F964D; Exit\"")) > error("GPG error: \"Encrypt failed\", \"Unusable public key: > 49F84EA6007F964D; Exit\"") You should check that key in your key ring. It probably has expired and cannot be used for encryption. Regards,
Hello,
On 15.05.2020 21:17, Nicolas Goaziou wrote:
>This is not a valid value: `org-crypt-key' must be a string.
On removing the variable, it works fine. The GPG configuration directly
takes my mail address to get the key.
The other issue was I also had a revoked key with the same email, that
might have been causing an error, mentioned in the earlier mail.
Thanks for the help.
--
Regards,
Silipwn
Hello,
silipwn <mail@silipwn.digital> writes:
> On removing the variable, it works fine. The GPG configuration directly
> takes my mail address to get the key. The other issue was I also had
> a revoked key with the same email, that
> might have been causing an error, mentioned in the earlier mail.
While trying to understand where the (setq org-crypt-key nil) from your
config was coming from, I noticed the manual suggested to do so!
I fixed this discrepancy between the manual and the implementation (aka
a bug). You can now set again org-crypt-key to nil. The difference
between "" and nil is the latter also ignores `epa-file-encrypt-to' if
this happens to be set in the document.
Regards,
--
Nicolas Goaziou