File: 630-recent_libssl.diff

package info (click to toggle)
netkit-telnet-ssl 0.17.41%2Breally0.17-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,800 kB
  • sloc: cpp: 6,952; ansic: 6,724; sh: 182; makefile: 68
file content (81 lines) | stat: -rw-r--r-- 2,686 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Description: Make possible builds with libssl of version 1.1.0.
 Protected access to an opaque structure was made mandatory
 in version 1.1.0 of libssl.
Author: Mats Erik Andersson <debian@gisladisker.se>
Forwarded: not-needed
Last-Update: 2017-01-16

--- a/libtelnet/ssl.c
+++ b/libtelnet/ssl.c
@@ -586,11 +586,11 @@
     char *subject, *issuer;
 #ifdef SSLEAY8
     int depth,error;
-    char *xs;
+    X509 *xs;
 
-    depth=ctx->error_depth;
-    error=ctx->error;
-    xs=(char *)X509_STORE_CTX_get_current_cert(ctx);
+    depth = X509_STORE_CTX_get_error_depth(ctx);
+    error = X509_STORE_CTX_get_error(ctx);
+    xs = X509_STORE_CTX_get_current_cert(ctx);
 
 #endif /* SSLEAY8 */
 
@@ -733,11 +733,11 @@
     char *subject, *issuer, *cnsubj;
 #ifdef SSLEAY8
     int depth,error;
-    char *xs;
+    X509 *xs;
 
-    depth=ctx->error_depth;
-    error=ctx->error;
-    xs=(char *)X509_STORE_CTX_get_current_cert(ctx);
+    depth = X509_STORE_CTX_get_error_depth(ctx);
+    error = X509_STORE_CTX_get_error(ctx);
+    xs = X509_STORE_CTX_get_current_cert(ctx);
 
 #endif /* SSLEAY8 */
 
@@ -817,25 +817,25 @@
     case X509_V_ERR_CERT_NOT_YET_VALID:
       fprintf(stderr,"SSL: Certificate not yet valid\n");
       BIO_printf(bio_err,"notBefore=");
-      ASN1_TIME_print(bio_err,X509_get_notBefore(ctx->current_cert));
+      ASN1_TIME_print(bio_err, X509_get_notBefore((X509 *) xs));
       BIO_printf(bio_err,"\n");
       break;
     case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD:
       fprintf(stderr,"SSL: Error in certificate notBefore field\n");
       BIO_printf(bio_err,"notBefore=");
-      ASN1_TIME_print(bio_err,X509_get_notBefore(ctx->current_cert));
+      ASN1_TIME_print(bio_err, X509_get_notBefore((X509 *) xs));
       BIO_printf(bio_err,"\n");
       break;
     case X509_V_ERR_CERT_HAS_EXPIRED:
       fprintf(stderr,"SSL: Certificate has expired\n");
       BIO_printf(bio_err,"notAfter=");
-      ASN1_TIME_print(bio_err,X509_get_notAfter(ctx->current_cert));
+      ASN1_TIME_print(bio_err, X509_get_notAfter((X509 *) xs));
       BIO_printf(bio_err,"\n");
       break;
     case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD:
       fprintf(stderr,"SSL: Error in certificate notAfter field\n");
       BIO_printf(bio_err,"notAfter=");
-      ASN1_TIME_print(bio_err,X509_get_notAfter(ctx->current_cert));
+      ASN1_TIME_print(bio_err, X509_get_notAfter((X509 *) xs));
       BIO_printf(bio_err,"\n");
       break;
     default:
--- a/telnet/netlink.cc
+++ b/telnet/netlink.cc
@@ -2,6 +2,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>