Re: Newbie can't get --passphrase option to work

2017-05-13 Thread Dan Kegel
Did you see my walkthrough of all the problems I ran into while
getting gpg to not prompt?

https://lists.gnupg.org/pipermail/gnupg-users/2017-April/058158.html
https://lists.gnupg.org/pipermail/gnupg-users/2017-April/058162.html

That's for Linux, but it might still have a trick you're missing.

___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: Newbie can't get --passphrase option to work

2017-05-13 Thread Kristian Fiskerstrand
On 05/12/2017 04:15 PM, Ryk McDorman wrote:
> I've done a thorough search for a solution for this, but haven't come up with 
> much: a vague reference to a bug in 2.1.x that may have to do with it, and at 
> the end of my day yesterday I came across someone who used the 
> "--pinentry-mode loopback" option. Interestingly, when I add that to my 
> command, it DOES decrypt one file without prompting me, but then inexplicably 
> stops. (My program logic is fine, as without the -pinentry option, it prompts 
> me once for each file and decrypts each file.)  I haven't yet had time to 
> investigate that option; it's my next action but I've literally been working 
> on this for days now and needed to send out a plea for help!

And here you discuss it :p .. yes, pinentry-mode loopback is necessary
for 2.1 use of --passphrase-fd and the likes , in earlier versions of
2.1 this requires allow-pinentry-loopback for the gpg-agent but in
recent versions that is defaulted to on.

Can you provide the information when this argument is used and the
scenario that fails including explicit error messages?

-- 

Kristian Fiskerstrand
Blog: https://blog.sumptuouscapital.com
Twitter: @krifisk

Public OpenPGP keyblock at hkp://pool.sks-keyservers.net
fpr:94CB AFDD 3034 5109 5618 35AA 0B7F 8B60 E3ED FAE3

Amantes sunt amentes
Lovers are lunatics



signature.asc
Description: OpenPGP digital signature
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: Newbie can't get --passphrase option to work

2017-05-13 Thread Kristian Fiskerstrand
On 05/12/2017 04:15 PM, Ryk McDorman wrote:
> I was tasked with automating the decryption (and more) of files, so I've 
> written a PowerShell program that does everything I need it to do, except 
> that I can't get the decryption to decrypt without prompting for our 
> passphrase. I'm using a default installation of GnuPG 2.1.19 on Windows 7 (it 
> may go on a Win Server 2012 box for production). 

look into --pinentry-mode loopback

-- 

Kristian Fiskerstrand
Blog: https://blog.sumptuouscapital.com
Twitter: @krifisk

Public OpenPGP keyblock at hkp://pool.sks-keyservers.net
fpr:94CB AFDD 3034 5109 5618 35AA 0B7F 8B60 E3ED FAE3

Amantes sunt amentes
Lovers are lunatics



signature.asc
Description: OpenPGP digital signature
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Newbie can't get --passphrase option to work

2017-05-13 Thread Ryk McDorman
I was tasked with automating the decryption (and more) of files, so I've 
written a PowerShell program that does everything I need it to do, except that 
I can't get the decryption to decrypt without prompting for our passphrase. I'm 
using a default installation of GnuPG 2.1.19 on Windows 7 (it may go on a Win 
Server 2012 box for production). 

In the program I'm passing the output and input filenames as parameters to a 
one-line batch file consisting of this command:
echo | "C:\Program Files (x86)\gnuPG\bin\gpg.exe" --batch  
--output %1  --passphrase-fd 0 --decrypt %2

I've also tried the -passphrase-file and -passphrase  options 
with the same results: when the program runs I'm prompted to enter the 
passphrase. 

I've done a thorough search for a solution for this, but haven't come up with 
much: a vague reference to a bug in 2.1.x that may have to do with it, and at 
the end of my day yesterday I came across someone who used the "--pinentry-mode 
loopback" option. Interestingly, when I add that to my command, it DOES decrypt 
one file without prompting me, but then inexplicably stops. (My program logic 
is fine, as without the -pinentry option, it prompts me once for each file and 
decrypts each file.)  I haven't yet had time to investigate that option; it's 
my next action but I've literally been working on this for days now and needed 
to send out a plea for help!

I'm a total GPG newbie here, so, as they say on Reddit "Explain like I'm 5."  
Thanks!

Ryk 

CONFIDENTIALITY NOTICE:

This e-mail contains confidential information and is intended only for the 
individual named. If you are not the named addressee, you should not 
disseminate, distribute or copy this e-mail. Please notify the sender 
immediately if you have received this e-mail by mistake and delete this 
e-mail from your system. E-mail cannot be guaranteed to be secure or 
error-free as information could be intercepted, corrupted, lost, 
destroyed, arrive late or incomplete, or contain viruses. Neither the 
sender nor CoBiz Financial and its subsidiaries accept liability for any 
errors or omissions in the contents of this message which arise as a 
result of e-mail transmission.



___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: Compilation of libgcrypt 1.7.5 on cygwin 64 bit fails

2017-05-13 Thread Jussi Kivilinna
Hello,

On 11.05.2017 12:26, Roger Qiu wrote:
> Hi Gcrypt devs,
> 
> I just tried compiling from source libgcrypt 1.7.5 (and I also tried earlier 
> versions).
> 
> It always comes to this:
> 
> ```
> 
> libtool: link: ranlib .libs/libgcrypt.alibtool: link: rm -fr 
> .libs/libgcrypt.laxlibtool: link: ( cd ".libs" && rm -f "libgcrypt.la" && ln 
> -s "../libgcrypt.la" "libgcrypt.la" )gcc -DHAVE_CONFIG_H -I. -I..
> -I/usr/local/include -g -O2 -Wall -MT mpicalc-mpicalc.o -MD -MP -MF 
> .deps/mpicalc-mpicalc.Tpo -c -o mpicalc-mpicalc.o `test -f 'mpicalc.c' || 
> echo './'`mpicalc.cmv -f .deps/mpicalc-mpicalc.Tpo 
> .deps/mpicalc-mpicalc.Po/bin/sh ../libtool  --tag=CC   --mode=link gcc 
> -I/usr/local/include -g -O2 -Wall   -o mpicalc.exe mpicalc-mpicalc.o 
> libgcrypt.la  -L/usr/local/lib -lgpg-errorlibtool: link: gcc 
> -I/usr/local/include -g -O2 -Wall -o .libs/mpicalc.exe mpicalc-mpicalc.o  
> ./.libs/libgcrypt.a -L/usr/local/lib /usr/local/lib/libgpg-error.a 
> -lintl./.libs/libgcrypt.a(rijndael.o): In function 
> `do_encrypt':/cygdrive/c/Users/CMCDragonkai/.src/libgcrypt-1.7.5/cipher/rijndael.c:747:(.text+0x9f):
>  relocation truncated to fit: R_X86_64_32S against 
> `.rdata'./.libs/libgcrypt.a(rijndael.o): In
> function 
> `do_decrypt':/cygdrive/c/Users/CMCDragonkai/.src/libgcrypt-1.7.5/cipher/rijndael.c:1130:(.text+0x110):
>  relocation truncated to fit: R_X86_64_32S against 
> `.rdata'./.libs/libgcrypt.a(cast5-amd64.o):/cygdrive/c/Users/CMCDragonkai/.src/libgcrypt-1.7.5/cipher/cast5-amd64.S:201:(.text+0x9):
>  relocation truncated to fit: R_X86_64_32S against symbol `_gcry_cast5_s1to4' 
> defined in .rdata section in 
> ./.libs/libgcrypt.a(cast5.o)./.libs/libgcrypt.a(cast5-amd64.o):/cygdrive/c/Users/CMCDragonkai/.src/libgcrypt-1.7.5/cipher/cast5-amd64.S:241:(.text+0x429):
>  relocation truncated to fit: R_X86_64_32S against symbol `_gcry_cast5_s1to4' 
> defined in .rdata section in 
> ./.libs/libgcrypt.a(cast5.o)./.libs/libgcrypt.a(cast5-amd64.o):/cygdrive/c/Users/CMCDragonkai/.src/libgcrypt-1.7.5/cipher/cast5-amd64.S:376:(.text+0x844):
>  relocation truncated to fit: R_X86_64_32S against symbol `_gcry_cast5_s1to4' 
> defined in .rdata section in
> ./.libs/libgcrypt.a(cast5.o)./.libs/libgcrypt.a(cast5-amd64.o):/cygdrive/c/Users/CMCDragonkai/.src/libgcrypt-1.7.5/cipher/cast5-amd64.S:404:(.text+0x177c):
>  relocation truncated to fit: R_X86_64_32S against symbol `_gcry_cast5_s1to4' 
> defined in .rdata section in ./.libs/libgcrypt.a(cast5.o)collect2: error: ld 
> returned 1 exit statusmake[2]: *** [Makefile:712: mpicalc.exe] Error 
> 1make[2]: Leaving directory 
> '/cygdrive/c/Users/CMCDragonkai/.src/libgcrypt-1.7.5/src'make[1]: *** 
> [Makefile:477: all-recursive] Error 1make[1]: Leaving directory 
> '/cygdrive/c/Users/CMCDragonkai/.src/libgcrypt-1.7.5'make: *** [Makefile:408: 
> all] Error 2
> 
> ```
> 
> Please cc me as I am not subscribed to the mailing list.
> 
> All other dependencies of gnupg works on cygwin 64 bit, this is the only one 
> that fails, and thus prevents building gpg2 on Cygwin 64 bit.

Does attached patch solve the problem? Patch is made on top of libgcrypt 
development branch, but I think it should apply to 1.7.5 too.

-Jussi

Fix building on 64-bit cygwin

From: Jussi Kivilinna 

* cipher/cast5-amd64.S [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS]
(GET_EXTERN_POINTER): Load 64-bit address instead of 32-bit.
* cipher/rijndael.c (do_encrypt, do_decrypt)
[USE_AMD64_ASM && !HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS]: Load
table pointer through register instead of generic reference.
--

Signed-off-by: Jussi Kivilinna 
---
 cipher/cast5-amd64.S |2 +-
 cipher/rijndael.c|4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cipher/cast5-amd64.S b/cipher/cast5-amd64.S
index a5f078e3..608fb64e 100644
--- a/cipher/cast5-amd64.S
+++ b/cipher/cast5-amd64.S
@@ -24,7 +24,7 @@
  defined(HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS)) && defined(USE_CAST5)
 
 #if defined(HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS) || !defined(__PIC__)
-#  define GET_EXTERN_POINTER(name, reg) leaq name, reg
+#  define GET_EXTERN_POINTER(name, reg) movabsq $name, reg
 #else
 #  define GET_EXTERN_POINTER(name, reg) movq name@GOTPCREL(%rip), reg
 #endif
diff --git a/cipher/rijndael.c b/cipher/rijndael.c
index 66ea0f3a..8637195a 100644
--- a/cipher/rijndael.c
+++ b/cipher/rijndael.c
@@ -752,7 +752,7 @@ do_encrypt (const RIJNDAEL_context *ctx,
   "+d" (ax),
   "+c" (rounds)
 : "0" (_gcry_aes_amd64_encrypt_block),
-  [encT] "g" (encT)
+  [encT] "r" (encT)
 : "cc", "memory", "r8", "r9", "r10", "r11");
   return ret;
 # endif /* HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS */
@@ -1135,7 +1135,7 @@ do_decrypt (const RIJNDAEL_context *ctx, unsigned char *bx,
   "+d" (ax),
   "+c" (rounds)
 : "0" (_gcry_aes_amd64_decrypt_block),