~ubuntu-branches/ubuntu/saucy/openvpn/saucy-proposed

« back to all changes in this revision

Viewing changes to easy-rsa/2.0/tmp/revoke-full

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-31 04:55:56 UTC
  • mfrom: (1.1.18) (10.2.16 sid)
  • Revision ID: package-import@ubuntu.com-20111231045556-3fwmrbggevr9iqxd
Tags: 2.2.1-3ubuntu1
* Merge from Debian testing.  Remaining changes:
 + debian/openvpn.init.d:
    - Do not use start-stop-daemon and </dev/null to avoid blocking boot.
    - Show per-VPN result messages.
    - Add "--script-security 2" by default for backwards compatabliity.
  + debian/control: Add lsb-base >= 3.2-14 to allow status_of_proc()
  + debian/update-resolv-conf: Support multiple domains.
  + fix bug where '--script-security 2' would be passed for all
    daemons after the first. (LP: #794916)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# revoke a certificate, regenerate CRL,
 
4
# and verify revocation
 
5
 
 
6
CRL="crl.pem"
 
7
RT="revoke-test.pem"
 
8
 
 
9
if [ $# -ne 1 ]; then
 
10
    echo "usage: revoke-full <cert-name-base>";
 
11
    exit 1
 
12
fi
 
13
 
 
14
if [ "$KEY_DIR" ]; then
 
15
    cd "$KEY_DIR"
 
16
    rm -f "$RT"
 
17
 
 
18
    # set defaults
 
19
    export KEY_CN=""
 
20
    export KEY_OU=""
 
21
    export KEY_NAME=""
 
22
 
 
23
    # revoke key and generate a new CRL
 
24
    $OPENSSL ca -revoke "$1.crt" -config "$KEY_CONFIG"
 
25
 
 
26
    # generate a new CRL -- try to be compatible with
 
27
    # intermediate PKIs
 
28
    $OPENSSL ca -gencrl -out "$CRL" -config "$KEY_CONFIG"
 
29
    if [ -e export-ca.crt ]; then
 
30
        cat export-ca.crt "$CRL" >"$RT"
 
31
    else
 
32
        cat ca.crt "$CRL" >"$RT"
 
33
    fi
 
34
    
 
35
    # verify the revocation
 
36
    $OPENSSL verify -CAfile "$RT" -crl_check "$1.crt"
 
37
else
 
38
    echo 'Please source the vars script first (i.e. "source ./vars")'
 
39
    echo 'Make sure you have edited it to reflect your configuration.'
 
40
fi