~james-page/ubuntu/saucy/openvswitch/1.12-snapshot

« back to all changes in this revision

Viewing changes to utilities/ovs-pki.in

  • Committer: James Page
  • Date: 2013-08-21 10:16:57 UTC
  • mfrom: (1.1.20)
  • Revision ID: james.page@canonical.com-20130821101657-3o0z0qeiv5zkwlzi
New upstream snapshot

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
2
 
3
 
# Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
 
3
# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
4
4
#
5
5
# Licensed under the Apache License, Version 2.0 (the "License");
6
6
# you may not use this file except in compliance with the License.
27
27
 
28
28
# OS-specific compatibility routines
29
29
case $(uname -s) in
30
 
FreeBSD)
 
30
FreeBSD|NetBSD)
31
31
    file_mod_epoch()
32
32
    {
33
33
        stat -r "$1" | awk '{print $10}'
272
272
serial         = $dir/serial           # serial no file
273
273
private_key    = $dir/private/cakey.pem# CA private key
274
274
RANDFILE       = $dir/private/.rand    # random number file
275
 
default_days   = 365                   # how long to certify for
 
275
default_days   = 3650                  # how long to certify for
276
276
default_crl_days= 30                   # how long before next CRL
277
277
default_md     = md5                   # md to use
278
278
policy         = policy                # default policy
303
303
            -newkey $newkey -keyout private/cakey.pem -out careq.pem \
304
304
            1>&3 2>&3
305
305
        openssl ca -config ca.cnf -create_serial -out cacert.pem \
306
 
            -days 2191 -batch -keyfile private/cakey.pem -selfsign \
 
306
            -days 3650 -batch -keyfile private/cakey.pem -selfsign \
307
307
            -infiles careq.pem 1>&3 2>&3
308
308
        chmod 0700 private/cakey.pem
309
309
 
514
514
    # Create both the private key and certificate with restricted permissions.
515
515
    (umask 077 && \
516
516
     openssl x509 -in "$arg1-req.pem" -out "$arg1-cert.pem.tmp" \
517
 
        -signkey "$arg1-privkey.pem" -req -days 2191 -text) 2>&3 || exit $?
 
517
        -signkey "$arg1-privkey.pem" -req -days 3650 -text) 2>&3 || exit $?
518
518
 
519
519
    # Reset the permissions on the certificate to the user's default.
520
520
    cat "$arg1-cert.pem.tmp" > "$arg1-cert.pem"