~ubuntu-branches/ubuntu/lucid/curl/lucid-security

« back to all changes in this revision

Viewing changes to lib/firefox-db2pem.sh

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2009-04-29 11:10:29 UTC
  • mfrom: (3.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090429111029-2j5eiyokfw2bw049
Tags: 7.19.4-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop build dependencies: stunnel, libdb4.6-dev, libssh2-1-dev
  - Add build-dependency on openssh-server
  - Drop libssh2-1-dev from libcurl4-openssl-dev's Depends.
  - Call automake-1.9 with --add-missing --copy --force
* drop debian/patches/security_CVE-2009-0037.patch 
  - this patch is part of 7.19.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# ***************************************************************************
 
3
# *                                  _   _ ____  _
 
4
# *  Project                     ___| | | |  _ \| |
 
5
# *                             / __| | | | |_) | |
 
6
# *                            | (__| |_| |  _ <| |___
 
7
# *                             \___|\___/|_| \_\_____|
 
8
# *
 
9
# * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
 
10
# *
 
11
# * This software is licensed as described in the file COPYING, which
 
12
# * you should have received as part of this distribution. The terms
 
13
# * are also available at http://curl.haxx.se/docs/copyright.html.
 
14
# *
 
15
# * You may opt to use, copy, modify, merge, publish, distribute and/or sell
 
16
# * copies of the Software, and permit persons to whom the Software is
 
17
# * furnished to do so, under the terms of the COPYING file.
 
18
# *
 
19
# * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 
20
# * KIND, either express or implied.
 
21
# *
 
22
# * $Id: firefox-db2pem.sh,v 1.1 2008-08-23 22:02:41 bagder Exp $
 
23
# ***************************************************************************
 
24
# This shell script creates a fresh ca-bundle.crt file for use with libcurl. 
 
25
# It extracts all ca certs it finds in the local Firefox database and converts
 
26
# them all into PEM format.
 
27
#
 
28
db=`ls -1d $HOME/.mozilla/firefox/*default`  
 
29
out=$1
 
30
 
 
31
if test -z "$out"; then
 
32
  out="ca-bundle.crt" # use a sensible default
 
33
fi
 
34
 
 
35
currentdate=`date`
 
36
 
 
37
cat >$out <<EOF
 
38
##
 
39
## Bundle of CA Root Certificates
 
40
##
 
41
## Converted at: ${currentdate}
 
42
## These were converted from the local Firefox directory by the db2pem script.
 
43
##
 
44
EOF
 
45
 
 
46
 
 
47
certutil -L -h 'Builtin Object Token' -d $db | \
 
48
grep ' *[CcGTPpu]*,[CcGTPpu]*,[CcGTPpu]* *$' | \
 
49
sed -e 's/ *[CcGTPpu]*,[CcGTPpu]*,[CcGTPpu]* *$//' -e 's/\(.*\)/"\1"/' | \
 
50
sort | \
 
51
while read nickname; \
 
52
 do echo $nickname | sed -e "s/Builtin Object Token://g"; \
 
53
eval certutil -d $db -L -n "$nickname" -a ; \
 
54
done >> $out
 
55