emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: org-encrypt-entry fails  [9.4 (nil @ /home/silipwn/.emacs.d/.local/straight/build/org-mode/)]
@ 2020-05-15  2:56 silipwn
  2020-05-15 15:00 ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: silipwn @ 2020-05-15  2:56 UTC (permalink / raw)
  To: emacs-orgmode

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/)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug: org-encrypt-entry fails [9.4 (nil @ /home/silipwn/.emacs.d/.local/straight/build/org-mode/)]
  2020-05-15  2:56 Bug: org-encrypt-entry fails [9.4 (nil @ /home/silipwn/.emacs.d/.local/straight/build/org-mode/)] silipwn
@ 2020-05-15 15:00 ` Nicolas Goaziou
  2020-05-15 16:46   ` silipwn
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2020-05-15 15:00 UTC (permalink / raw)
  To: silipwn; +Cc: emacs-orgmode

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug: org-encrypt-entry fails  [9.4 (nil @ /home/silipwn/.emacs.d/.local/straight/build/org-mode/)]
  2020-05-15 15:00 ` Nicolas Goaziou
@ 2020-05-15 16:46   ` silipwn
  2020-05-15 19:17     ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: silipwn @ 2020-05-15 16:46 UTC (permalink / raw)
  To: emacs-orgmode

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug: org-encrypt-entry fails [9.4 (nil @ /home/silipwn/.emacs.d/.local/straight/build/org-mode/)]
  2020-05-15 16:46   ` silipwn
@ 2020-05-15 19:17     ` Nicolas Goaziou
  2020-05-16  3:31       ` [Solved]: " silipwn
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2020-05-15 19:17 UTC (permalink / raw)
  To: silipwn; +Cc: emacs-orgmode

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,


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Solved]: Bug: org-encrypt-entry fails  [9.4 (nil @ /home/silipwn/.emacs.d/.local/straight/build/org-mode/)]
  2020-05-15 19:17     ` Nicolas Goaziou
@ 2020-05-16  3:31       ` silipwn
  2020-05-18 13:46         ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: silipwn @ 2020-05-16  3:31 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Solved]: Bug: org-encrypt-entry fails [9.4 (nil @ /home/silipwn/.emacs.d/.local/straight/build/org-mode/)]
  2020-05-16  3:31       ` [Solved]: " silipwn
@ 2020-05-18 13:46         ` Nicolas Goaziou
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2020-05-18 13:46 UTC (permalink / raw)
  To: silipwn; +Cc: emacs-orgmode

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-18 13:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-15  2:56 Bug: org-encrypt-entry fails [9.4 (nil @ /home/silipwn/.emacs.d/.local/straight/build/org-mode/)] silipwn
2020-05-15 15:00 ` Nicolas Goaziou
2020-05-15 16:46   ` silipwn
2020-05-15 19:17     ` Nicolas Goaziou
2020-05-16  3:31       ` [Solved]: " silipwn
2020-05-18 13:46         ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).