summaryrefslogtreecommitdiff
path: root/ekusub.sh
diff options
context:
space:
mode:
authorU-Z690-A\user <jrayhawk@omgwallhack.org>2022-06-29 20:26:01 -0700
committerU-Z690-A\user <jrayhawk@omgwallhack.org>2022-06-29 20:26:01 -0700
commit585568aa8b851d153fbec0a46769b8f12e1df7f4 (patch)
treefc4d8daee10acdd48f33de0221a4dd31773f5289 /ekusub.sh
parent40e0db376ea51384fc2dbb7feb86d6d83408fe9f (diff)
downloadcash-585568aa8b851d153fbec0a46769b8f12e1df7f4.tar.gz
cash-585568aa8b851d153fbec0a46769b8f12e1df7f4.zip
extendedKeyUsage: decommission ekusub.sh and use environment variables insteadHEADmaster
ekusub.sh has additionally been generalized into inimodify.sh in case I ever need it in the future for anything else.
Diffstat (limited to 'ekusub.sh')
-rwxr-xr-xekusub.sh32
1 files changed, 0 insertions, 32 deletions
diff --git a/ekusub.sh b/ekusub.sh
deleted file mode 100755
index bf1546d..0000000
--- a/ekusub.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-# Dynamically substitutes extendedKeyUsage in usr_cert in an openssl config file
-# ./ekusub.sh "clientAuth, serverAuth"
-#requires bash 4.0 regexes
-
-set -e
-[ -n "$1" ] || cat # pass through
-
-IFS=$'\n'
-CA_STANZA=0
-EKU_MODIFIED=0
-while read line; do
- if [[ "$line" =~ ^\ *\[\ *usr_cert\ *\] ]]; then
- CA_STANZA=1
- echo "$line"
- elif [ $CA_STANZA == 1 ] && [[ "$line" =~ ^\ *extendedKeyUsage\ *= ]]; then
- echo -n "$line"
- echo ", $1"
- EKU_MODIFIED=1
- elif [ $CA_STANZA == 1 ] && [[ "$line" =~ ^\ *\[\ .+\ \] ]]; then
- if [ $EKU_MODIFIED == 0 ]; then
- echo "extendedKeyUsage = $1"
- echo
- EKU_MODIFIED=1
- fi
- CA_STANZA=0
- echo "$line"
- else
- echo "$line"
- fi
-
-done