From 4a39fedf1b17146b1d00c82b787c044e275784ad Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Fri, 11 Nov 2005 05:00:16 +0000 Subject: [PATCH] update sa and add simple_ssl --- sa | 1 + simple_ssl | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100755 simple_ssl diff --git a/sa b/sa index fd43d45..a8da86b 100755 --- a/sa +++ b/sa @@ -86,6 +86,7 @@ sub parse_config_file { next if /^#/; my ($repo,$command) = split /\t/,$_,2; $repo =~ s/^\~/$home/; + $command =~ s/^\~/$home/ if defined $command; $$repos{$repo} = $command; } } diff --git a/simple_ssl b/simple_ssl new file mode 100755 index 0000000..831dc42 --- /dev/null +++ b/simple_ssl @@ -0,0 +1,46 @@ +#!/bin/sh + +make_key () { + # Takes one argument, the Distinguished name + # Creates a single signed cert, cert.pem in the current directory + cat -</dev/null 2>&1 +. +. +. +. +. +$1 +. + + +EOF + openssl x509 -in $CACERT -noout -next_serial -out serial >/dev/null 2>&1 + touch database database.attr + cp /usr/lib/ssl/openssl.cnf config + perl -pi -e 's/(database|serial)\s*=.+/$1=$1/' config + openssl ca -config config -policy policy_anything -keyfile $CAKEY -cert $CACERT \ + -out cert.pem -outdir . -notext -days 9000 -batch -infiles key.req > /dev/null 2>&1 + rm -f database database.attr database.old database.attr.old config serial serial.old + rm -f key.req +} + + +if [ -n "$1" -a ! -e $1 ]; then + + cat -</dev/null 2>&1 +. +. +. +. +My CA Key +. + +EOF + +fi; + +CACERT=$1.crt; +CAKEY=$1.key; +make_key $2 +mv key.pem $2.pem +mv cert.pem $2.crt -- 2.39.2