1 |
diff -Nur -x '*.orig' -x '*.rej' e-smith-base-4.18.0/root/etc/e-smith/templates/home/e-smith/ssl.crt mezzanine_patched_e-smith-base-4.18.0/root/etc/e-smith/templates/home/e-smith/ssl.crt |
2 |
--- e-smith-base-4.18.0/root/etc/e-smith/templates/home/e-smith/ssl.crt 2007-10-11 18:57:07.000000000 -0400 |
3 |
+++ mezzanine_patched_e-smith-base-4.18.0/root/etc/e-smith/templates/home/e-smith/ssl.crt 2007-10-11 18:48:06.000000000 -0400 |
4 |
@@ -13,6 +13,13 @@ |
5 |
my $defaultDepartment = $ldap{defaultDepartment}; |
6 |
my $email = "admin\@$DomainName"; |
7 |
|
8 |
+ # crop fields that are too long for X509: |
9 |
+ $defaultCity = substr($defaultCity, 0, 128); |
10 |
+ $defaultCompany = substr($defaultCompany, 0, 64); |
11 |
+ $defaultDepartment = substr($defaultDepartment, 0, 64); |
12 |
+ $email = substr($email, 0, 64); |
13 |
+ $commonName = substr($commonName, 0, 64); |
14 |
+ |
15 |
if ( -f $crt ) |
16 |
{ |
17 |
my $expire = `openssl x509 -enddate -noout -in $crt`; |
18 |
@@ -60,23 +67,6 @@ |
19 |
{ |
20 |
# parent |
21 |
|
22 |
- # anonymous sub to crop a variable to a specified size |
23 |
- my $cropLeft = sub { |
24 |
- my ($var, $len) = @_; |
25 |
- if (length($var) > $len) |
26 |
- { |
27 |
- $var = substr($var, 0, $len); |
28 |
- } |
29 |
- return $var; |
30 |
- }; |
31 |
- |
32 |
- # crop fields that are too long for X509: |
33 |
- $defaultCity = &$cropLeft($defaultCity, 128); |
34 |
- $defaultCompany = &$cropLeft($defaultCompany, 64); |
35 |
- $defaultDepartment = &$cropLeft($defaultDepartment, 64); |
36 |
- $email = &$cropLeft($email, 40); |
37 |
- $commonName = &$cropLeft($commonName, 64); |
38 |
- |
39 |
foreach ( |
40 |
"--", |
41 |
"----", |