all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Morgan Willcock <morgan@ice9.digital>, emacs-devel@gnu.org
Subject: Re: New package for NonGNU ELPA : totp-auth
Date: Wed, 14 Feb 2024 16:05:30 +0300	[thread overview]
Message-ID: <Zcy6mtCxiW3OQjZp@lco.syogm.com> (raw)
In-Reply-To: <ZcngnbrQMm9mYWxp@lco.syogm.com>

* Jean Louis <bugs@gnu.support> [2024-02-12 23:19]:
> * Morgan Willcock <morgan@ice9.digital> [2024-02-08 22:16]:
> > 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.

I use my command here to to go easier with pipes.

(defun rcd-command-output-from-input (program input &rest args)
  "Return output string from PROGRAM with given INPUT string and optional ARGS."
  (let* ((output (with-temp-buffer
		   (insert input)
		   (apply #'call-process-region nil nil program t '(t nil) nil args)
		   (buffer-string))))
    output))

Then I have modified it to read from input:

(defcustom rcd-oath-keys ()
  "List of OATH keys."
  :type '(alist :key-type string)
  :group 'rcd)

(defun rcd-oath ()
  (interactive)
  (let* ((key (rcd-choose (map-keys rcd-oath-keys) "OATH Service: "))
	 (program "oathtool")
	 (result (rcd-command-output-from-input program (symbol-name (alist-get key rcd-oath-keys nil nil 'equalp)) "-" "-b" "--totp=sha1"))
	 (result (string-trim result)))
    (message result)
    (kill-new result)))

But I am not sure if it can be seen in process list this way. What do
you think?


Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/






  reply	other threads:[~2024-02-14 13:05 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
2024-02-12  9:10       ` Jean Louis
2024-02-14 13:05         ` Jean Louis [this message]
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=Zcy6mtCxiW3OQjZp@lco.syogm.com \
    --to=bugs@gnu.support \
    --cc=emacs-devel@gnu.org \
    --cc=morgan@ice9.digital \
    /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.