mingw-openssl/renew-dummy-cert
Fabiano Fidêncio 3505ea6700 Update the sources accordingly to its native counter part (1.1.1c)
Four patches are not being applied due to failures in the build and/or
applying them:
- openssl-1.1.1-fips.patch
- openssl-1.1.1-fips-post-rand.patch
- openssl-1.1.1-evp-kdf.patch
- openssl-1.1.1-ssh-kdf.patch

Mind that fips related patches were not applied in the previously
version either.

Resolves: rhbz#1740772

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-08-14 17:52:31 +02:00

40 lines
725 B
Bash
Executable File

#!/bin/bash
if [ $# -eq 0 ]; then
echo $"Usage: `basename $0` filename" 1>&2
exit 1
fi
PEM=$1
REQ=`/bin/mktemp /tmp/openssl.XXXXXX`
KEY=`/bin/mktemp /tmp/openssl.XXXXXX`
CRT=`/bin/mktemp /tmp/openssl.XXXXXX`
NEW=${PEM}_
trap "rm -f $REQ $KEY $CRT $NEW" SIGINT
if [ ! -f $PEM ]; then
echo "$PEM: file not found" 1>&2
exit 1
fi
umask 077
OWNER=`ls -l $PEM | awk '{ printf "%s.%s", $3, $4; }'`
openssl rsa -inform pem -in $PEM -out $KEY
openssl x509 -x509toreq -in $PEM -signkey $KEY -out $REQ
openssl x509 -req -in $REQ -signkey $KEY -days 365 \
-extfile /etc/pki/tls/openssl.cnf -extensions v3_ca -out $CRT
(cat $KEY ; echo "" ; cat $CRT) > $NEW
chown $OWNER $NEW
mv -f $NEW $PEM
rm -f $REQ $KEY $CRT
exit 0