RPC password prompt using pinentry via ASSUAN #284

pull jaromil wants to merge 1 commits into bitcoin:master from jaromil:assuan changing 4 files +210 −9
  1. jaromil commented at 2:07 PM on May 29, 2011: contributor

    A new Pin class is provided to create secure password dialogs using process separation.

    IPC is done via libassuan and the assuan daemon user is standard pinentry (portable qt, gtk2 and ncurses implementations are available)

    Pinentry takes care of memlocking and is the standard for GNUPG.

    The Pin class is designed to be readable and well reusable in other password entry tasks.

    This commit adds optional build dependency from libassuan and optional runtime dependency from a pinentry daemon.

  2. RPC password prompt using pinentry via ASSUAN
    A new class Pin is used to create secure password dialogs using
    process separation.
    
    IPC is done via libassuan and the assuan daemon user is standard
    pinentry (portable qt, gtk2 and ncurses implementations are available)
    
    Pinentry takes care of memlocking and is the standard for GNUPG.
    909ab0acc2
  3. TheBlueMatt commented at 10:56 PM on May 29, 2011: member

    So...this adds the option to specify the rpcuser/pass at runtim instead of via -rpcuser/-rpcpassword. I like this.
    However, why use ASSUAN? Assuan takes care of mlock() and such, but how hard is that, really, to do ourselves? I'm not a huge fan of adding another dependency, though I suppose the fact that it is optional is nice. If we are just using the cli input from assuan, and not all their other wx stuff, how hard would it be to copy/paste the probably 20 relevant lines from assuan, or rewrite them ourselves?

    ASSUAN might be useful for wallet crypto, where the user needs to enter their password via GUI and I have yet to find a way to mlock() the password as the user enters it, but even still, the attack which mlock() protects against is almost never seen in the wild. Assuan is designed to be a secure method of IPC, but in this case it is just used as a password entry library. Assuan might be very useful for something like libbitcoin, but for bitcoin it seems like far over-engineering.

    Maybe Im missing something you can point out?

  4. TheBlueMatt commented at 10:58 PM on May 29, 2011: member

    Maybe assuan also tries to stop keyloggers on Windows, but my short googleing seemed to indicate otherwise.

  5. jaromil commented at 7:21 AM on May 30, 2011: contributor

    It is Pinentry, main reference implementation of an assuan daemon, that tries to stop software keyloggers when started as a separate process, capturing exclusive focus and such. The whole architecture of this system for user input looks very reliable, portable and promising to me. Researching into it gave me quite some satisfaction :^)

    My guess is that, since it is all ported on major platforms, this new small dependency wouldn't be a problem (at least as optional) and can provide a solid platform to develop further on situations that require user input in bitcoin (which is totally lacking ATM); as you can see the Pin class is very simple and well readable.

  6. TheBlueMatt commented at 10:52 AM on May 30, 2011: member

    Its not a question of whether a new dep will cause problems in compiling, but a question of is it necessary? A new dep just means that much more work when compiling and that much more memory used when it has to be loaded.

    I agree assuan looks like a good lib to input password, but again...why? It would be great to have when we move towards libbitcoin, but that is such a long way off I dont see any use in this for some time to come.

  7. jrmithdobbs commented at 9:12 AM on May 31, 2011: contributor

    I definitely see the usefulness of introducing ssh-askpass style support for bitcoind. It makes, for instance, setting a one-time use passphrase for txn creation using your new wallet encryption code much much simpler.

    However, I cannot get this to build cleanly with the version of libassuan in debian stable. What exactly are the build deps?

  8. jaromil commented at 11:53 AM on May 31, 2011: contributor

    on Ubuntu packaged deps are libassuan2-dev and libgpg-error-dev of course you must uncomment USE_ASSUAN in makefile.unix (later that can be --enable-pinentry on autotools)

    just tested compilation on Debian 6.0 and you are right, doesn't works: Debian is stuck to the old libassuan-dev (version 1)

    my approach in this case is include statically and then move strings so that Debian wakes up, which takes time indeed..

  9. jaromil commented at 7:33 AM on June 1, 2011: contributor

    forgot to mention that i'm available to fix this up to work on libassuan 1 or 2, yet before doing that i'd like to know if there is reasonable intention to pull this into mainline or not, just lemme know

  10. jrmithdobbs commented at 6:28 PM on June 2, 2011: contributor

    I know I would like to see it pulled.

  11. jandd commented at 9:15 PM on June 5, 2011: none

    you should add libassuan-dev to the apt-get instructions if this should be pulled

  12. gavinandresen commented at 6:54 PM on June 7, 2011: contributor

    where is the libassuan project homepage? Is it part of something else?

  13. TheBlueMatt commented at 7:26 PM on June 7, 2011: member
  14. jandd commented at 7:44 PM on June 7, 2011: none

    The Debian archive contains a few other packages using libassuan:

    apt-cache rdepends libassuan0
    libassuan0
    Reverse Depends:
      scute
      libassuan0-dbg
      libassuan-dev
      gpgsm
      gnupg2
      gnupg-agent
      dirmngr
    
  15. jaromil commented at 8:45 AM on June 10, 2011: contributor

    yes, ASSUAN is a new, well thought and documented protocol for secure IPC by the fine people coding on GNUPG which will arguably become a de facto standard in future.

    the provision of pinentry-* programs on various platforms makes it extremely convenient to use it to implement password prompt

    my current code uses the ASSUAN-2 API which contains some design improvements over the version 1, although it can be downgraded for full compatibility since debian still has the older library packaged, or detected at compile time once autoconf build is there.

    i can do that but again first i'd like to know if this is a feature you are willing to pull or not, since this is mostly a design issue that can affect future development (which should then arguably stick to these set of dependencies for tasks as password prompt).

  16. gavinandresen commented at 11:18 AM on June 10, 2011: contributor

    I like the feature, but won't pull for two reasons:

    1. I agree with Matt: I think the benefits of the feature is not great enough to justify the pain of adding another dependency.
    2. It is under the GPL license, which is more restrictive than bitcoin's MIT license, and is unacceptable.
  17. gavinandresen closed this on Jun 10, 2011

  18. jaromil commented at 12:14 PM on June 10, 2011: contributor

    re: point 2 - what is under the GNU GPL?

    the code i'm contributing is licensed under the same MIT license as Bitcoin.

    you mean the dependencies? is your intention to avoid any library dependency licensed as GNU GPL?

  19. gavinandresen commented at 1:01 PM on June 10, 2011: contributor

    Yes, we avoid an GPL library dependencies. LGPL is OK.

  20. jrmithdobbs commented at 1:53 PM on June 10, 2011: contributor

    But libassaun is gplv2+ OR lgplv2+ ?

    Actually, I'm wrong. From the README the source is straight up lgplv2. (The rest of the gnupg packages are gplv2+.)

    See COPYING.LIB on how to share, modify and distribute the software itself (LGPLv2.1+) and COPYING for the documentation (GPLv3+).

  21. sipa referenced this in commit 7863d105ea on Aug 4, 2015
  22. sipa referenced this in commit 780d5b3c7b on Aug 23, 2015
  23. TheBlueMatt referenced this in commit a671356e1f on Oct 20, 2015
  24. sipa referenced this in commit 9177950c74 on Oct 21, 2015
  25. sipa referenced this in commit f4787d1caf on Oct 21, 2015
  26. sipa referenced this in commit 6557a8cd46 on Oct 26, 2015
  27. sipa referenced this in commit ea06490d14 on Oct 27, 2015
  28. sipa referenced this in commit 003bb87153 on Nov 5, 2015
  29. sipa referenced this in commit bfd83199c3 on Nov 11, 2015
  30. sipa referenced this in commit b437ea7ec9 on Nov 12, 2015
  31. sipa referenced this in commit 1d84107924 on Nov 12, 2015
  32. sipa referenced this in commit f41ed612dd on Aug 27, 2016
  33. sipa referenced this in commit 2f342da4b9 on Nov 30, 2016
  34. sipa referenced this in commit 634ad51703 on Dec 2, 2016
  35. rebroad referenced this in commit 40ead34fbe on Dec 7, 2016
  36. deadalnix referenced this in commit ff3a5dfc97 on Jan 19, 2017
  37. jamoes referenced this in commit 505fca3d26 on Feb 8, 2017
  38. classesjack referenced this in commit 988ea99d37 on Jan 2, 2018
  39. lateminer referenced this in commit 5f081ba385 on Oct 16, 2019
  40. attilaaf referenced this in commit ff9efc90f8 on Jan 13, 2020
  41. Losangelosgenetics referenced this in commit d7dbc2d1d3 on Mar 12, 2020
  42. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-29 03:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me