[cpp-sp] branch main updated: Remove keygen scripts.

Scott Cantor cantor.2 at osu.edu
Tue Oct 29 18:09:02 UTC 2024


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=9d74eceddf44225b10eddb488cda352b09121fd1

The following commit(s) were added to refs/heads/main by this push:
     new 9d74eced Remove keygen scripts.
9d74eced is described below

commit 9d74eceddf44225b10eddb488cda352b09121fd1
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Oct 29 14:08:58 2024 -0400

    Remove keygen scripts.
---
 configs/Makefile.am |  11 -----
 configs/keygen.bat  | 115 ----------------------------------------------------
 configs/keygen.sh   |  91 -----------------------------------------
 3 files changed, 217 deletions(-)

diff --git a/configs/Makefile.am b/configs/Makefile.am
index d99b4597..b9b5023e 100644
--- a/configs/Makefile.am
+++ b/configs/Makefile.am
@@ -9,7 +9,6 @@ pkgcachedir = $(localstatedir)/cache/@PACKAGE_NAME@
 pkgsysconfdir = $(sysconfdir)/@PACKAGE_NAME@
 pkgsysconf_DATA = \
 	apache24.config \
-	keygen.sh \
 	seckeygen.sh
 
 # The config files are installed "special".  Unlike the entries in
@@ -84,24 +83,14 @@ install-data-local:	all-data-local
 	done
 
 install-data-hook:
-	chmod +x $(DESTDIR)$(pkgsysconfdir)/keygen.sh
 	chmod +x $(DESTDIR)$(pkgsysconfdir)/seckeygen.sh
-	if test -z "$(NOKEYGEN)"; then \
-		if test ! -f $(DESTDIR)$(pkgsysconfdir)/sp-key.pem; then \
-			cd $(DESTDIR)$(pkgsysconfdir); \
-			/bin/sh ./keygen.sh -b -n sp-signing ; \
-			/bin/sh ./keygen.sh -b -n sp-encrypt ; \
-		fi; \
-	fi
 
 CLEANFILES = \
 	apache24.config
 
 EXTRA_DIST = \
 	apache24.config.in \
-	keygen.bat \
 	seckeygen.bat \
-	keygen.sh \
 	seckeygen.sh \
 	win-shibboleth2.xml \
 	win-native.logger \
diff --git a/configs/keygen.bat b/configs/keygen.bat
deleted file mode 100644
index 53a7fe16..00000000
--- a/configs/keygen.bat
+++ /dev/null
@@ -1,115 +0,0 @@
- at echo off
-setlocal
-
-set DAYS=
-set YEARS=
-set FQDN=
-set ENTITYID=
-set TEMP_DOMAIN_NAME=
-set PARAM=
-set PREFIX=
-set OUT=%~dp0
-
-:opt_start
-set PARAM=%1
-
-if not defined PARAM goto opt_end
-if %1==-o goto opt_out
-if %1==-n goto opt_prefix
-if %1==-h goto opt_fqdn
-if %1==-e goto opt_entityid
-if %1==-y goto opt_years
-if %1==-f goto opt_force
-goto usage
-:opt_end
-
-if not defined PREFIX set PREFIX=sp
-
-if exist "%OUT%\%PREFIX%-key.pem" goto protect
-if exist "%OUT%\%PREFIX%-cert.pem" goto protect
-
-if not defined YEARS set YEARS=10
-set /a DAYS=%YEARS%*365
-
-if not defined FQDN goto guess_fqdn
-
-:generate
-set PATH=%PATH%;%ProgramFiles%\Shibboleth\SP\lib\
-set CNF="%OUT%\%PREFIX%-cert.cnf"
-echo # OpenSSL configuration file for creating keypair       >%CNF%
-echo [req]                                                   >>%CNF%
-echo prompt=no                                               >>%CNF%
-echo default_bits=3072                                       >>%CNF%
-echo encrypt_key=no                                          >>%CNF%
-echo default_md=sha256                                       >>%CNF%
-echo distinguished_name=dn                                   >>%CNF%
-echo # PrintableStrings only                                 >>%CNF%
-echo string_mask=MASK:0002                                   >>%CNF%
-echo x509_extensions=ext                                     >>%CNF%
-echo [dn]                                                    >>%CNF%
-echo CN=%FQDN%                                               >>%CNF%
-echo [ext]                                                   >>%CNF%
-if defined ENTITYID (echo subjectAltName=DNS:%FQDN%,URI:%ENTITYID% >>%CNF%) else (echo subjectAltName=DNS:%FQDN% >>%CNF%)
-echo subjectKeyIdentifier=hash                               >>%CNF%
-openssl.exe req -config %CNF% -new -x509 -days %DAYS% -keyout "%OUT%\%PREFIX%-key.pem" -out "%OUT%\%PREFIX%-cert.pem"
-del %CNF%
-exit /b
-
-:protect
-echo The files %OUT%\%PREFIX%-key.pem and/or %OUT%\%PREFIX%-cert.pem already exist!
-echo Use -f option to force recreation of keypair.
-exit /b
-
-:opt_out
-set OUT=%2
-shift
-shift
-goto opt_start
-
-:opt_prefix
-set PREFIX=%2
-shift
-shift
-goto opt_start
-
-:opt_force
-if exist "%OUT%\%PREFIX%-key.pem" del "%OUT%\%PREFIX%-key.pem"
-if exist "%OUT%\%PREFIX%-cert.pem" del "%OUT%\%PREFIX%-cert.pem"
-shift
-goto opt_start
-
-:opt_fqdn
-set FQDN=%2
-shift
-shift
-goto opt_start
-
-:opt_entityid
-set ENTITYID=%2
-shift
-shift
-goto opt_start
-
-:opt_years
-set YEARS=%2
-shift
-shift
-goto opt_start
-
-:usage
-echo usage: keygen [-h hostname for cert] [-y years to issue cert] [-e entityID to embed in cert] [-n filename prefix] [-o output dir]
-exit /b
-
-:guess_fqdn
-for /F "tokens=2 delims=:" %%i in ('"ipconfig /all | findstr /c:"Primary DNS Suffix" /c:"Primary Dns Suffix""') do set TEMP_DOMAIN_NAME=%%i
-if defined TEMP_DOMAIN_NAME set FQDN=%TEMP_DOMAIN_NAME: =%
-set TEMP_DOMAIN_NAME=
-if defined USERDNSDOMAIN set FQDN=%USERDNSDOMAIN%
-
-for /F %%i in ('hostname') do set HOST=%%i
-if defined FQDN (set FQDN=%HOST%.%FQDN%) else (set FQDN=%HOST%)
-
-echo >"%FQDN%"
-for /F %%i in ('dir /b/l %FQDN%') do set FQDN=%%i
-del %FQDN%
-goto generate
diff --git a/configs/keygen.sh b/configs/keygen.sh
deleted file mode 100755
index b5378fd3..00000000
--- a/configs/keygen.sh
+++ /dev/null
@@ -1,91 +0,0 @@
-#! /bin/sh
-
-while getopts n:h:u:g:o:e:y:bf c
-     do
-         case $c in
-           u)         USER=$OPTARG;;
-           g)         GROUP=$OPTARG;;
-           o)         OUT=$OPTARG;;
-           b)         BATCH=1;;
-           f)         FORCE=1;;
-           h)         FQDN=$OPTARG;;
-           e)         ENTITYID=$OPTARG;;
-           y)         YEARS=$OPTARG;;
-		   n)         PREFIX=$OPTARG;;
-		   \?)        echo "keygen [-o output directory (default .)] [-u username to own keypair] [-g owning groupname] [-h hostname for cert] [-y years to issue cert] [-e entityID to embed in cert] [-n filename prefix (default 'sp')]"
-                      exit 1;;
-         esac
-     done
-     
-if [ -z "$OUT" ] ; then
-    OUT=.
-fi
-
-if [ -z "$PREFIX" ]; then
-	PREFIX="sp"
-fi
-
-if [ -n "$FORCE" ] ; then
-    rm $OUT/${PREFIX}-key.pem $OUT/${PREFIX}-cert.pem
-fi
-
-if  [ -s $OUT/${PREFIX}-key.pem -o -s $OUT/${PREFIX}-cert.pem ] ; then
-    if [ -z "$BATCH" ] ; then  
-        echo The files $OUT/${PREFIX}-key.pem and/or $OUT/${PREFIX}-cert.pem already exist!
-        echo Use -f option to force recreation of keypair.
-        exit 2
-    fi
-    exit 0
-fi
-
-if [ -z "$FQDN" ] ; then
-    FQDN=`hostname`
-fi
-
-if [ -z "$YEARS" ] ; then
-    YEARS=10
-fi
-
-DAYS=`expr $YEARS \* 365`
-
-if [ -z "$ENTITYID" ] ; then
-    ALTNAME=DNS:$FQDN
-else
-    ALTNAME=DNS:$FQDN,URI:$ENTITYID
-fi
-
-SSLCNF=$OUT/${PREFIX}-cert.cnf
-cat >$SSLCNF <<EOF
-# OpenSSL configuration file for creating keypair
-[req]
-prompt=no
-default_bits=3072
-encrypt_key=no
-default_md=sha256
-distinguished_name=dn
-# PrintableStrings only
-string_mask=MASK:0002
-x509_extensions=ext
-[dn]
-CN=$FQDN
-[ext]
-subjectAltName=$ALTNAME
-subjectKeyIdentifier=hash
-EOF
-
-touch $OUT/${PREFIX}-key.pem
-chmod 600 $OUT/${PREFIX}-key.pem
-if [ -z "$BATCH" ] ; then
-    openssl req -config $SSLCNF -new -x509 -days $DAYS -keyout $OUT/${PREFIX}-key.pem -out $OUT/${PREFIX}-cert.pem
-else
-    openssl req -config $SSLCNF -new -x509 -days $DAYS -keyout $OUT/${PREFIX}-key.pem -out $OUT/${PREFIX}-cert.pem 2> /dev/null
-fi
-rm $SSLCNF
-
-if  [ -s $OUT/${PREFIX}-key.pem -a -n "$USER" ] ; then
-    chown $USER $OUT/${PREFIX}-key.pem $OUT/${PREFIX}-cert.pem
-fi
-
-if  [ -s $OUT/${PREFIX}-key.pem -a -n "$GROUP" ] ; then
-    chgrp $GROUP $OUT/${PREFIX}-key.pem $OUT/${PREFIX}-cert.pem
-fi

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list