diff options
| author | Sam Varshavchik | 2015-04-25 22:49:58 -0400 | 
|---|---|---|
| committer | Sam Varshavchik | 2015-04-25 22:49:58 -0400 | 
| commit | aec32f54c031e00da5cda1c2384d8b63e742f149 (patch) | |
| tree | 2e161fa3565d5d8e01eca7410edfe723b5102ee5 /imap/mkdhparams.in | |
| parent | 4d6b3cbc45d313e763da26f55c56993553edcd0d (diff) | |
| download | courier-libs-aec32f54c031e00da5cda1c2384d8b63e742f149.tar.bz2 | |
Make dhparams compatible with libressl
Diffstat (limited to 'imap/mkdhparams.in')
| -rw-r--r-- | imap/mkdhparams.in | 17 | 
1 files changed, 14 insertions, 3 deletions
| diff --git a/imap/mkdhparams.in b/imap/mkdhparams.in index 89ed1dd..04afcca 100644 --- a/imap/mkdhparams.in +++ b/imap/mkdhparams.in @@ -7,6 +7,12 @@  # Override from the environment +@OPENSSL@ version | grep LibreSSL 1>/dev/null +if test $? = 0 +then +	LIBRESSL=1 +fi +  if test "$TLS_DHPARAMS" = ""  then  	TLS_DHPARAMS="@certsdir@/dhparams.pem" @@ -36,9 +42,14 @@ then  	BITS=2048      fi -    dd if=@RANDOMV@ of=$TLS_DHPARAMS.rand.tmp count=1 2>/dev/null -    @OPENSSL@ dhparam -rand $TLS_DHPARAMS.rand.tmp -outform PEM $BITS >$TLS_DHPARAMS.tmp -    rm -f $TLS_DHPARAMS.rand.tmp +    if test "$LIBRESSL" = 0 +    then +        dd if=@RANDOMV@ of=$TLS_DHPARAMS.rand.tmp count=1 2>/dev/null +        @OPENSSL@ dhparam -rand $TLS_DHPARAMS.rand.tmp -outform PEM $BITS >$TLS_DHPARAMS.tmp +        rm -f $TLS_DHPARAMS.rand.tmp +    else +        @OPENSSL@ dhparam -outform PEM $BITS >$TLS_DHPARAMS.tmp +    fi      mv -f $TLS_DHPARAMS.tmp $TLS_DHPARAMS  else      if test "$BITS" = "" | 
