Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 445088 Details for
Bug 540622
app-crypt/tinyca: removal (was: fix digest algorithm GUI selection and Add SHA256/384/512 support)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
add SHA256/SHA384/SHA512 digest algorithm support
tinyca-2.0.7.5-sha-256-384-512.patch (text/plain), 7.25 KB, created by
Zentoo
on 2016-09-06 16:24:28 UTC
(
hide
)
Description:
add SHA256/SHA384/SHA512 digest algorithm support
Filename:
MIME Type:
Creator:
Zentoo
Created:
2016-09-06 16:24:28 UTC
Size:
7.25 KB
patch
obsolete
>diff -Naur a/lib/CA.pm b/lib/CA.pm >--- a/lib/CA.pm 2016-09-06 10:52:20.675990599 +0200 >+++ b/lib/CA.pm 2016-09-06 11:48:52.058145365 +0200 >@@ -1062,6 +1062,7 @@ > 'outdir' => $self->{$ca}->{'dir'}."/newcerts/", > 'keyfile' => $self->{$ca}->{'dir'}."/cacert.key", > 'cacertfile' => $self->{$ca}->{'dir'}."/cacert.pem", >+ 'digest' => $opts->{'digest'}, > 'pass' => $opts->{'passwd'}, > 'days' => $opts->{'days'}, > 'parentpw' => $opts->{'parentpw'}, >diff -Naur a/lib/CERT.pm b/lib/CERT.pm >--- a/lib/CERT.pm 2016-09-06 10:52:20.675990599 +0200 >+++ b/lib/CERT.pm 2016-09-06 11:48:52.058145365 +0200 >@@ -480,6 +480,9 @@ > $out = ''; > $out .= "Fingerprint (MD5): $opts->{'parsed'}->{'FINGERPRINTMD5'}\n"; > $out .= "Fingerprint (SHA1): $opts->{'parsed'}->{'FINGERPRINTSHA1'}\n\n"; >+ $out .= "Fingerprint (SHA256): $opts->{'parsed'}->{'FINGERPRINTSHA256'}\n\n"; >+ $out .= "Fingerprint (SHA384): $opts->{'parsed'}->{'FINGERPRINTSHA384'}\n\n"; >+ $out .= "Fingerprint (SHA512): $opts->{'parsed'}->{'FINGERPRINTSHA512'}\n\n"; > } else { > $out = ''; > } >diff -Naur a/lib/GUI/WORDS.pm b/lib/GUI/WORDS.pm >--- a/lib/GUI/WORDS.pm 2016-09-06 10:52:47.364931797 +0200 >+++ b/lib/GUI/WORDS.pm 2016-09-06 11:49:04.408114769 +0200 >@@ -70,6 +70,9 @@ > 'STATUS' => _("Status"), > 'FINGERPRINTMD5' => _("Fingerprint (MD5)"), > 'FINGERPRINTSHA1' => _("Fingerprint (SHA1)"), >+ 'FINGERPRINTSHA256' => _("Fingerprint (SHA256)"), >+ 'FINGERPRINTSHA384' => _("Fingerprint (SHA384)"), >+ 'FINGERPRINTSHA512' => _("Fingerprint (SHA512)"), > _("Not set") => 'none', > _("Ask User") => 'user', > _("critical") => 'critical', >diff -Naur a/lib/GUI/X509_infobox.pm b/lib/GUI/X509_infobox.pm >--- a/lib/GUI/X509_infobox.pm 2016-09-06 10:52:47.364931797 +0200 >+++ b/lib/GUI/X509_infobox.pm 2016-09-06 11:49:04.408114769 +0200 >@@ -90,6 +90,33 @@ > 'center', 0, 0); > $self->{'x509textbox'}->pack_start($self->{'certfingerprintsha1'}, > 0, 0, 0); >+ >+ if(defined($self->{'certfingerprintsha256'})) { >+ $self->{'certfingerprintsha256'}->destroy(); >+ } >+ $self->{'certfingerprintsha256'} = GUI::HELPERS::create_label( >+ _("Fingerprint (SHA256)").": ".$parsed->{'FINGERPRINTSHA256'}, >+ 'center', 0, 0); >+ $self->{'x509textbox'}->pack_start($self->{'certfingerprintsha256'}, >+ 0, 0, 0); >+ >+ if(defined($self->{'certfingerprintsha384'})) { >+ $self->{'certfingerprintsha1'}->destroy(); >+ } >+ $self->{'certfingerprintsha384'} = GUI::HELPERS::create_label( >+ _("Fingerprint (SHA384)").": ".$parsed->{'FINGERPRINTSHA384'}, >+ 'center', 0, 0); >+ $self->{'x509textbox'}->pack_start($self->{'certfingerprintsha384'}, >+ 0, 0, 0); >+ >+ if(defined($self->{'certfingerprintsha512'})) { >+ $self->{'certfingerprintsha512'}->destroy(); >+ } >+ $self->{'certfingerprintsha512'} = GUI::HELPERS::create_label( >+ _("Fingerprint (SHA512)").": ".$parsed->{'FINGERPRINTSHA512'}, >+ 'center', 0, 0); >+ $self->{'x509textbox'}->pack_start($self->{'certfingerprintsha512'}, >+ 0, 0, 0); > } > > if (($mode eq 'cert') || ($mode eq 'cacert')) { >diff -Naur a/lib/GUI.pm b/lib/GUI.pm >--- a/lib/GUI.pm 2016-09-06 10:52:20.675990599 +0200 >+++ b/lib/GUI.pm 2016-09-06 11:48:52.058145365 +0200 >@@ -35,8 +35,10 @@ > 'mdc2' => 'MDC2', > 'md4' => 'MD4', > 'ripemd160' => 'RIPEMD-160', >-# 'sha' => 'SHA', > 'sha1' => 'SHA-1', >+ 'sha256' => 'SHA-256', >+ 'sha384' => 'SHA-384', >+ 'sha512' => 'SHA-512', > ); > > my %bit_lengths = ( >@@ -1060,7 +1062,7 @@ > $piter = $store->append($root); > $store->set($piter, 0 => $t); > >- for my $l (qw(FINGERPRINTMD5 FINGERPRINTSHA1)) { >+ for my $l (qw(FINGERPRINTMD5 FINGERPRINTSHA1 FINGERPRINTSHA256 FINGERPRINTSHA384 FINGERPRINTSHA512)) { > if(defined($parsed->{$l})) { > $citer = $store->append($piter); > $store->set($citer, >@@ -3091,12 +3093,12 @@ > my($previous_key, $value); > > $previous_key = undef; >- for $value (keys %values) { >+ for $value (sort keys %values) { > my $display_name = $values{$value}; > my $key = Gtk2::RadioButton->new($previous_key, $display_name); >- $key->set_active(1) if(defined($$var) && $$var eq $value); > $key->signal_connect('toggled' => > sub{GUI::CALLBACK::toggle_to_var($key, $var, $value)}); >+ $key->set_active(1) if(defined($$var) && $$var eq $value); > $radiobox->add($key); > $previous_key = $key; > } >diff -Naur a/lib/OpenSSL.pm b/lib/OpenSSL.pm >--- a/lib/OpenSSL.pm 2016-09-06 10:52:20.675990599 +0200 >+++ b/lib/OpenSSL.pm 2016-09-06 11:48:52.058145365 +0200 >@@ -675,6 +675,57 @@ > GUI::HELPERS::print_warning($t, $ext); > } > >+ $cmd = "$self->{'bin'} x509 -noout -fingerprint -sha256 -in $file"; >+ $ext = "$cmd\n\n"; >+ $pid = open3($wtfh, $rdfh, $rdfh, $cmd); >+ while(<$rdfh>){ >+ $ext .= $_; >+ ($k, $v) = split(/=/); >+ $tmp->{'FINGERPRINTSHA256'} = $v if($k =~ /SHA256 Fingerprint/i); >+ chomp($tmp->{'FINGERPRINTSHA256'}); >+ } >+ waitpid($pid, 0); >+ $ret = $? >> 8; >+ >+ if($ret) { >+ $t = _("Error reading fingerprint from Certificate"); >+ GUI::HELPERS::print_warning($t, $ext); >+ } >+ >+ $cmd = "$self->{'bin'} x509 -noout -fingerprint -sha384 -in $file"; >+ $ext = "$cmd\n\n"; >+ $pid = open3($wtfh, $rdfh, $rdfh, $cmd); >+ while(<$rdfh>){ >+ $ext .= $_; >+ ($k, $v) = split(/=/); >+ $tmp->{'FINGERPRINTSHA384'} = $v if($k =~ /SHA384 Fingerprint/i); >+ chomp($tmp->{'FINGERPRINTSHA384'}); >+ } >+ waitpid($pid, 0); >+ $ret = $? >> 8; >+ >+ if($ret) { >+ $t = _("Error reading fingerprint from Certificate"); >+ GUI::HELPERS::print_warning($t, $ext); >+ } >+ >+ $cmd = "$self->{'bin'} x509 -noout -fingerprint -sha512 -in $file"; >+ $ext = "$cmd\n\n"; >+ $pid = open3($wtfh, $rdfh, $rdfh, $cmd); >+ while(<$rdfh>){ >+ $ext .= $_; >+ ($k, $v) = split(/=/); >+ $tmp->{'FINGERPRINTSHA512'} = $v if($k =~ /SHA512 Fingerprint/i); >+ chomp($tmp->{'FINGERPRINTSHA512'}); >+ } >+ waitpid($pid, 0); >+ $ret = $? >> 8; >+ >+ if($ret) { >+ $t = _("Error reading fingerprint from Certificate"); >+ GUI::HELPERS::print_warning($t, $ext); >+ } >+ > # get subject in openssl format > $cmd = "$self->{'bin'} x509 -noout -subject -in $file"; > $ext = "$cmd\n\n"; >diff -Naur a/lib/REQ.pm b/lib/REQ.pm >--- a/lib/REQ.pm 2016-09-06 10:52:20.675990599 +0200 >+++ b/lib/REQ.pm 2016-09-06 11:48:52.058145365 +0200 >@@ -426,6 +426,12 @@ > $opts->{'digest'} = "md5"; > } elsif ($opts->{'digest'} =~ /^sha1/) { > $opts->{'digest'} = "sha1"; >+ } elsif ($opts->{'digest'} =~ /^sha256/) { >+ $opts->{'digest'} = "sha256"; >+ } elsif ($opts->{'digest'} =~ /^sha384/) { >+ $opts->{'digest'} = "sha384"; >+ } elsif ($opts->{'digest'} =~ /^sha512/) { >+ $opts->{'digest'} = "sha512"; > } elsif ($opts->{'digest'} =~ /^ripemd160/) { > $opts->{'digest'} = "ripemd160"; > } else {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 540622
:
406668
|
406670
| 445088 |
445094