summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/format-pem.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/libcrypto/format-pem.pl b/src/lib/libcrypto/format-pem.pl
index 6c689d4978..556178eb30 100644
--- a/src/lib/libcrypto/format-pem.pl
+++ b/src/lib/libcrypto/format-pem.pl
@@ -1,5 +1,5 @@
1#!/usr/bin/perl 1#!/usr/bin/perl
2# $OpenBSD: format-pem.pl,v 1.1 2016/12/15 10:23:21 sthen Exp $ 2# $OpenBSD: format-pem.pl,v 1.2 2018/03/21 15:23:53 sthen Exp $
3# 3#
4# Copyright (c) 2016 Stuart Henderson <sthen@openbsd.org> 4# Copyright (c) 2016 Stuart Henderson <sthen@openbsd.org>
5# 5#
@@ -50,7 +50,11 @@ while(<>) {
50 if ($issuer ne $subj); 50 if ($issuer ne $subj);
51 51
52 my $o = `openssl x509 -in $t -noout -nameopt sep_multiline,use_quote,esc_msb -subject`; 52 my $o = `openssl x509 -in $t -noout -nameopt sep_multiline,use_quote,esc_msb -subject`;
53 $o =~ s/.*O=([^\n]*).*/$1/sm; 53 if ($o =~ /O=/) {
54 $o =~ s/.*O=([^\n]*).*/$1/sm;
55 } else {
56 $o = $subj;
57 }
54 58
55 if (eval {require Date::Parse;1;}) { 59 if (eval {require Date::Parse;1;}) {
56 my $startdate = `openssl x509 -in $t -startdate -noout`; 60 my $startdate = `openssl x509 -in $t -startdate -noout`;