kidd / org-gcal.el

Org sync with Google Calendar. (active maintained project as of 2019-11-06)
439 stars 47 forks source link

Syncing writes ";;; secret entries"-----BEGIN PGP MESSAGE-----..." to org files #228

Open megodoonch opened 1 year ago

megodoonch commented 1 year ago

I noticed recently that sometimes something like this is written to an org file:

;;; secret entries"-----BEGIN PGP MESSAGE-----

[a key, I guess. A bunch of nonsense.]

"-----END PGP MESSAGE-----

If it matters, I'm also one of the people who is prompted in a dialog box 6 times for a password every couple of hours, and setting the following in .emacs doesn't solve this issue:

(setq epg-pinentry-mode 'loopback)
(setenv "GPG_AGENT_INFO")
(setq-default plstore-cache-passphrase-for-symmetric-encryption t)

I'm using Ubuntu 20.04 and Emacs 26.3.

telotortium commented 1 year ago

Thanks for reporting - I've been very busy recently - I'll try to find time to fix.

megodoonch commented 1 year ago

Update: I think it writes it to the file you were in when you synced, approximately. (I usually sync from the agenda, but I think it writes to the file I was in when I built the agenda.) Today it wrote to *scratch*, opened a file system dialog, and wouldn't continue until I let it save the scratch buffer as a file.

This week I was forced to update from Ubuntu 20 to 22, and my previous trouble with not being able to use plstore seems to be solved with this version of Emacs! But this writing of what I guess is a GPG key to a file happened in both variants. I wonder if it's trying to write to some useful place, where it can look it up again later? And this is why many of us keep having to reauthenticate or re-enter passwords?

megodoonch commented 1 year ago

I just looked in oauth2-auto.plist, and it looks very familiar! I see that there are three public entries, which I think correspond to my three calendars. There is only one secret entry. The first few tokens, before the /, are the same as in the text written to my *scratch* file, and the rest is different. (The public entries only seem to appear here, though.)

;;; public entries -*- mode: plstore -*- 
(("%28%22j[redacted]%40import.calendar.google.com%22%20org-gcal%29%0A" :secret-access-token t :secret-refresh-token t :secret-expiration t)
 ("%28%2[redacted and longer]%40group.calendar.google.com%22%20org-gcal%29%0A" :secret-access-token t :secret-refresh-token t :secret-expiration t)
 ("%28%22[my email]%40gmail.com%22%20org-gcal%29%0A" :secret-access-token t :secret-refresh-token t :secret-expiration t))
;;; secret entries
"-----BEGIN PGP MESSAGE----- 
...