all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Morgan Willcock <morgan@ice9.digital>
To: Jean Louis <bugs@gnu.support>
Cc: Richard Stallman <rms@gnu.org>,
	  Vivek Das Mohapatra <vivek@etla.org>,
	emacs-devel@gnu.org
Subject: Re: New package for NonGNU ELPA : totp-auth
Date: Thu, 08 Feb 2024 19:15:37 +0000	[thread overview]
Message-ID: <861q9mzs12.fsf@ice9.digital> (raw)
In-Reply-To: <ZcMnU9XXa2vawuOo@lco.syogm.com> (Jean Louis's message of "Wed, 7 Feb 2024 09:46:43 +0300")

Jean Louis <bugs@gnu.support> writes:

> * Richard Stallman <rms@gnu.org> [2024-02-07 06:17]:
>> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
>> [[[ whether defending the US Constitution against all enemies,     ]]]
>> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>> 
>> This is a useful feature, but should it be implemented as a part of
>> Emacs?  Is there / should there be a shell command for this?
>> 
>> Given a shell command for this, do we want it implemented in Emacs
>> too?
>
> I have implemented it this way below, and it works well now for long time already. It uses the external shell command. I would rather use Emacs Lisp for it. It is required at many logins. I did not show more than 3 logins below, and they are also fake keys.
>
> (defvar oath-keys '(digitalocean "31CHLCURYJ5VRDHB" 
> 		    tether "J2AMLDF473VHD517"
> 		    twilio "EB1JS6TJNL1TQCWSNEZJG6IQ4XZGSC4UMI276X3TEODG2VQRTE5A")
>
> (defun call-process-to-string (program &optional infile display &rest args)
>   (with-temp-buffer
>     (apply #'call-process program infile t display args)
>     (buffer-string)))
>
> (defun oath ()
>   "Ask for service and kill OATH result to memory."
>   (interactive)
>   (let* ((key (rcd-choose (map-keys oath-keys) "OATH Service: "))
> 	 (result (call-process-to-string "oathtool" nil nil "-b" "--totp=sha1" (plist-get oath-keys (intern key))))
> 	 (result (string-trim result)))
>     (message result)
>     (kill-new result)))

I imagine this is potentially leaking your keys by making them visible
in the system's process information.

Recent versions of oathtool can read the key from stdin, so any attempt
to create a wrapper should probably be using this feature.

-- 
Morgan Willcock



  reply	other threads:[~2024-02-08 19:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05 15:35 New package for NonGNU ELPA : totp-auth Vivek Das Mohapatra
2024-02-06 10:04 ` Philip Kaludercic
2024-02-06 10:24   ` Po Lu
2024-02-06 10:27     ` Philip Kaludercic
2024-02-07  3:16 ` Richard Stallman
2024-02-07  6:46   ` Jean Louis
2024-02-08 19:15     ` Morgan Willcock [this message]
2024-02-12  9:10       ` Jean Louis
2024-02-14 13:05         ` Jean Louis
2024-02-07  8:23   ` Philip Kaludercic
2024-02-07  8:48   ` Michael Albinus
2024-02-10  3:55     ` Richard Stallman
2024-02-07 11:43   ` Vivek Das Mohapatra
2024-02-10  3:55     ` Richard Stallman
2024-02-07 13:43 ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=861q9mzs12.fsf@ice9.digital \
    --to=morgan@ice9.digital \
    --cc=bugs@gnu.support \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    --cc=vivek@etla.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.