summaryrefslogtreecommitdiff
path: root/mozilla/certdata2pem.rb
diff options
context:
space:
mode:
authorPhilipp Kern <pkern@debian.org>2008-03-19 14:34:12 +0100
committerPhilipp Kern <pkern@debian.org>2008-03-19 14:34:12 +0100
commit13c290277241bd3ce081d4b5c48a1618d0770b61 (patch)
tree7a703a01c61984c291bbf04da841618a2c8c77f5 /mozilla/certdata2pem.rb
parent143a70e8136819ed0ab8f1bc2f7198bde8c12f8d (diff)
downloadca-certificates-13c290277241bd3ce081d4b5c48a1618d0770b61.tar.gz
Imported Debian version 20060816debian/20060816
Diffstat (limited to 'mozilla/certdata2pem.rb')
-rw-r--r--mozilla/certdata2pem.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/mozilla/certdata2pem.rb b/mozilla/certdata2pem.rb
index 1fc49ea..9ede9d6 100644
--- a/mozilla/certdata2pem.rb
+++ b/mozilla/certdata2pem.rb
@@ -2,7 +2,10 @@
while line = $stdin.gets
next if line =~ /^#/
- next if line =~ /^\s*$/
+ if line =~ /^\s*$/
+ fname = nil
+ next
+ end
line.chomp!
if line =~ /CKA_LABEL/
label,type,val = line.split(' ',3)
@@ -12,9 +15,13 @@ while line = $stdin.gets
next
end
if line =~ /CKA_VALUE MULTILINE_OCTAL/
+ if fname.nil?
+ puts "E: unexpected CKA_VALUE MULTILINE_OCTAL"
+ next
+ end
data=''
while line = $stdin.gets
- break if /^END/
+ break if line =~ /^END/
line.chomp!
line.gsub(/\\([0-3][0-7][0-7])/) { data += $1.oct.chr }
end