]> git.donarmstrong.com Git - ca-certificates.git/blobdiff - mozilla/certdata2pem.rb
Imported Debian version 20060816
[ca-certificates.git] / mozilla / certdata2pem.rb
index 1fc49ea8b7f66614c8e73388651eacd30c68cf15..9ede9d6e4eeb46be9ef3269dc818be919710262c 100644 (file)
@@ -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