File: openssl-1.1.patch

package info (click to toggle)
libcrypt-openssl-pkcs12-perl 0.7-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 264 kB
  • ctags: 158
  • sloc: perl: 2,162; makefile: 6
file content (67 lines) | stat: -rw-r--r-- 1,758 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Description: Compatibility with OpenSSL 1.1.0
Bug: https://github.com/dsully/perl-crypt-openssl-pkcs12/issues/8
Bug-Debian: https://bugs.debian.org/828386
Forwarded: https://github.com/dsully/perl-crypt-openssl-pkcs12/pull/10
Author: Christopher Hoskin <christopher.hoskin@gmail.com>
Last-Update: 2016-11-06
--- a/PKCS12.xs
+++ b/PKCS12.xs
@@ -149,18 +149,18 @@
 int dump_certs_pkeys_bag (BIO *bio, PKCS12_SAFEBAG *bag, char *pass, int passlen, int options, char *pempass) {
 
   EVP_PKEY *pkey;
-  PKCS8_PRIV_KEY_INFO *p8;
   X509 *x509;
 
   switch (M_PKCS12_bag_type(bag)) {
 
-    case NID_keyBag:
+    case NID_keyBag: ;
+      const PKCS8_PRIV_KEY_INFO *cp8;
 
       if (options & NOKEYS) return 1;
 
-      p8 = bag->value.keybag;
+      cp8 = PKCS12_SAFEBAG_get0_p8inf(bag);
 
-      if (!(pkey = EVP_PKCS82PKEY (p8))) return 0;
+      if (!(pkey = EVP_PKCS82PKEY (cp8))) return 0;
 
       PEM_write_bio_PrivateKey (bio, pkey, enc, NULL, 0, NULL, pempass);
 
@@ -168,7 +168,8 @@
 
       break;
 
-    case NID_pkcs8ShroudedKeyBag:
+    case NID_pkcs8ShroudedKeyBag: ;
+      PKCS8_PRIV_KEY_INFO *p8;
 
       if (options & NOKEYS) return 1;
 
@@ -192,7 +193,7 @@
 
       if (options & NOCERTS) return 1;
 
-      if (PKCS12_get_attr(bag, NID_localKeyID)) {
+      if (PKCS12_SAFEBAG_get0_attr(bag, NID_localKeyID)) {
 
         if (options & CACERTS) return 1;
 
@@ -203,7 +204,7 @@
 
       if (M_PKCS12_cert_bag_type(bag) != NID_x509Certificate) return 1;
 
-      if (!(x509 = M_PKCS12_certbag2x509(bag))) return 0;
+      if (!(x509 = PKCS12_certbag2x509(bag))) return 0;
 
       PEM_write_bio_X509 (bio, x509);
 
@@ -368,7 +369,6 @@
 
   CRYPTO_cleanup_all_ex_data();
   ERR_free_strings();
-  ERR_remove_state(0);
   EVP_cleanup();
 
 SV*