summaryrefslogtreecommitdiffstats
path: root/recipes/openssl
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/openssl')
-rw-r--r--recipes/openssl/openssl/0001-Support-SYSROOT-in-c_rehash.patch66
1 files changed, 32 insertions, 34 deletions
diff --git a/recipes/openssl/openssl/0001-Support-SYSROOT-in-c_rehash.patch b/recipes/openssl/openssl/0001-Support-SYSROOT-in-c_rehash.patch
index 01775eb..9aa9648 100644
--- a/recipes/openssl/openssl/0001-Support-SYSROOT-in-c_rehash.patch
+++ b/recipes/openssl/openssl/0001-Support-SYSROOT-in-c_rehash.patch
@@ -1,4 +1,4 @@
1From 6b833a7767c25b60fb0bb8dcc00484df19946288 Mon Sep 17 00:00:00 2001 1From 9cf8fa1c4dae07a6aff194a3632bc499a813d3f8 Mon Sep 17 00:00:00 2001
2From: Samuli Piippo <samuli.piippo@theqtcompany.com> 2From: Samuli Piippo <samuli.piippo@theqtcompany.com>
3Date: Wed, 9 Sep 2015 13:37:28 +0300 3Date: Wed, 9 Sep 2015 13:37:28 +0300
4Subject: [PATCH] Support SYSROOT in c_rehash 4Subject: [PATCH] Support SYSROOT in c_rehash
@@ -10,39 +10,27 @@ environment variable and use it to locate the actual files during image
10creation. 10creation.
11 11
12Upstream-status: Pending 12Upstream-status: Pending
13
14--- 13---
15 tools/c_rehash.in | 28 ++++++++++++++++++---------- 14 tools/c_rehash.in | 30 +++++++++++++++++-------------
16 1 file changed, 18 insertions(+), 10 deletions(-) 15 1 file changed, 17 insertions(+), 13 deletions(-)
17 16
18diff --git a/tools/c_rehash.in b/tools/c_rehash.in 17diff --git a/tools/c_rehash.in b/tools/c_rehash.in
19index f8d0ce1..e81ec5b 100644 18index 92cb503..f3d2703 100644
20--- a/tools/c_rehash.in 19--- a/tools/c_rehash.in
21+++ b/tools/c_rehash.in 20+++ b/tools/c_rehash.in
22@@ -5,6 +5,7 @@ 21@@ -7,6 +7,7 @@ my $dir;
23 # and add symbolic links to their hash values.
24
25 my $openssl;
26+my $sysroot;
27
28 my $dir;
29 my $prefix; 22 my $prefix;
30@@ -16,6 +17,10 @@ if(defined $ENV{OPENSSL}) {
31 $ENV{OPENSSL} = $openssl;
32 }
33 23
34+if(defined $ENV{SYSROOT}) { 24 my $openssl = $ENV{OPENSSL} || "openssl";
35+ $sysroot = $ENV{SYSROOT}; 25+my $sysroot = $ENV{SYSROOT} || "";
36+}
37+
38 my $pwd; 26 my $pwd;
39 eval "require Cwd"; 27 my $verbose = 0;
40 if (defined(&Cwd::getcwd)) { 28 my $symlink_exists=eval {symlink("",""); 1};
41@@ -76,15 +81,16 @@ sub hash_dir { 29@@ -101,16 +102,17 @@ sub hash_dir {
30 }
42 } 31 }
43 closedir DIR; 32 FILE: foreach $fname (grep {/\.(pem)|(crt)|(cer)|(crl)$/} @flist) {
44 FILE: foreach $fname (grep {/\.pem$/} @flist) { 33+ $fullname = $sysroot . readlink($fname);
45+ $fullname = $sysroot . readlink($fname);
46 # Check to see if certificates and/or CRLs present. 34 # Check to see if certificates and/or CRLs present.
47- my ($cert, $crl) = check_file($fname); 35- my ($cert, $crl) = check_file($fname);
48+ my ($cert, $crl) = check_file($fullname); 36+ my ($cert, $crl) = check_file($fullname);
@@ -53,27 +41,29 @@ index f8d0ce1..e81ec5b 100644
53- link_hash_cert($fname) if($cert); 41- link_hash_cert($fname) if($cert);
54- link_hash_cert_old($fname) if($cert); 42- link_hash_cert_old($fname) if($cert);
55- link_hash_crl($fname) if($crl); 43- link_hash_crl($fname) if($crl);
44- link_hash_crl_old($fname) if($crl);
56+ link_hash_cert($fname, $fullname) if($cert); 45+ link_hash_cert($fname, $fullname) if($cert);
57+ link_hash_cert_old($fname, $fullname) if($cert); 46+ link_hash_cert_old($fname, $fullname) if($cert);
58+ link_hash_crl($fname, $fullname) if($crl); 47+ link_hash_crl($fname, $fullname) if($crl);
48+ link_hash_crl_old($fname, $fullname) if($crl);
59 } 49 }
60 } 50 }
61 51
62@@ -117,9 +123,10 @@ sub check_file { 52@@ -143,9 +145,10 @@ sub check_file {
63 53
64 sub link_hash_cert { 54 sub link_hash_cert {
65 my $fname = $_[0]; 55 my $fname = $_[0];
66- my $hashopt = $_[1] || '-subject_hash'; 56- my $x509hash = $_[1] || '-subject_hash';
67- $fname =~ s/'/'\\''/g; 57- $fname =~ s/'/'\\''/g;
68- my ($hash, $fprint) = `"$openssl" x509 $hashopt -fingerprint -noout -in "$fname"`; 58- my ($hash, $fprint) = `"$openssl" x509 $x509hash -fingerprint -noout -in "$fname"`;
69+ my $fullname = $_[1]; 59+ my $fullname = $_[1];
70+ my $hashopt = $_[2] || '-subject_hash'; 60+ my $x509hash = $_[2] || '-subject_hash';
71+ $fullname =~ s/'/'\\''/g; 61+ $fullname =~ s/'/'\\''/g;
72+ my ($hash, $fprint) = `"$openssl" x509 $hashopt -fingerprint -noout -in "$fullname"`; 62+ my ($hash, $fprint) = `"$openssl" x509 $x509hash -fingerprint -noout -in "$fullname"`;
73 chomp $hash; 63 chomp $hash;
74 chomp $fprint; 64 chomp $fprint;
75 $fprint =~ s/^.*=//; 65 $fprint =~ s/^.*=//;
76@@ -150,15 +157,16 @@ sub link_hash_cert { 66@@ -176,11 +179,11 @@ sub link_hash_cert {
77 } 67 }
78 68
79 sub link_hash_cert_old { 69 sub link_hash_cert_old {
@@ -81,15 +71,23 @@ index f8d0ce1..e81ec5b 100644
81+ link_hash_cert($_[0], $_[1], '-subject_hash_old'); 71+ link_hash_cert($_[0], $_[1], '-subject_hash_old');
82 } 72 }
83 73
84 # Same as above except for a CRL. CRL links are of the form <hash>.r<n> 74 sub link_hash_crl_old {
75- link_hash_crl($_[0], '-hash_old');
76+ link_hash_crl($_[0], $_[1], '-hash_old');
77 }
78
79
80@@ -188,9 +191,10 @@ sub link_hash_crl_old {
85 81
86 sub link_hash_crl { 82 sub link_hash_crl {
87 my $fname = $_[0]; 83 my $fname = $_[0];
84- my $crlhash = $_[1] || "-hash";
88- $fname =~ s/'/'\\''/g; 85- $fname =~ s/'/'\\''/g;
89- my ($hash, $fprint) = `"$openssl" crl -hash -fingerprint -noout -in '$fname'`; 86- my ($hash, $fprint) = `"$openssl" crl $crlhash -fingerprint -noout -in '$fname'`;
90+ my $fullname = $_[1]; 87+ my $fullname = $_[1];
88+ my $crlhash = $_[2] || "-hash";
91+ $fullname =~ s/'/'\\''/g; 89+ $fullname =~ s/'/'\\''/g;
92+ my ($hash, $fprint) = `"$openssl" crl -hash -fingerprint -noout -in '$fullname'`; 90+ my ($hash, $fprint) = `"$openssl" crl $crlhash -fingerprint -noout -in '$fullname'`;
93 chomp $hash; 91 chomp $hash;
94 chomp $fprint; 92 chomp $fprint;
95 $fprint =~ s/^.*=//; 93 $fprint =~ s/^.*=//;