summaryrefslogtreecommitdiff
path: root/net-misc/tn5250/files/tn5250-0.17.4-duplicate-definition.patch
blob: 39b3ccb45552478ad0862f4a426e8b89603d654f (plain)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
From 66e1a2f80091e9ee9b99156ae23e5faaf9f24fe0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 20 Feb 2017 15:06:36 +0100
Subject: [PATCH 3/4] remove duplicate definition for tn3270_ssl_stream_init()

---
 lib5250/sslstream.c | 93 -----------------------------------------------------
 1 file changed, 93 deletions(-)

diff --git a/lib5250/sslstream.c b/lib5250/sslstream.c
index f4353a9..86d38cf 100644
--- a/lib5250/sslstream.c
+++ b/lib5250/sslstream.c
@@ -477,99 +477,6 @@ int tn5250_ssl_stream_init (Tn5250Stream *This)
    return 0; /* Ok */
 }
 
-/****f* lib5250/tn3270_ssl_stream_init
- * NAME
- *    tn3270_ssl_stream_init
- * SYNOPSIS
- *    ret = tn3270_ssl_stream_init (This);
- * INPUTS
- *    Tn5250Stream *       This       - 
- * DESCRIPTION
- *    DOCUMENT ME!!!
- *****/
-int tn3270_ssl_stream_init (Tn5250Stream *This)
-{
-   int len;
-
-/* initialize SSL library */
-
-   SSL_load_error_strings();
-   SSL_library_init();
-
-/* create a new SSL context */
-
-   This->ssl_context = SSL_CTX_new(SSLv23_client_method());
-   if (This->ssl_context==NULL) {
-        DUMP_ERR_STACK ();
-        return -1;
-   }
-
-/* if a certificate authority file is defined, load it into this context */
-
-   if (This->config!=NULL && tn5250_config_get (This->config, "ssl_ca_file")) {
-        if (SSL_CTX_load_verify_locations(This->ssl_context, 
-                  tn5250_config_get (This->config, "ssl_ca_file"), NULL)<1) {
-            DUMP_ERR_STACK ();
-            return -1;
-        }
-   }
-
-/* if a certificate authority file is defined, load it into this context */
-
-   if (This->config!=NULL && tn5250_config_get (This->config, "ssl_ca_file")) {
-        if (SSL_CTX_load_verify_locations(This->ssl_context, 
-                  tn5250_config_get (This->config, "ssl_ca_file"), NULL)<1) {
-            DUMP_ERR_STACK ();
-            return -1;
-        }
-   }
-
-   This->userdata = NULL;
-
-/* if a PEM passphrase is defined, set things up so that it can be used */
-
-   if (This->config!=NULL && tn5250_config_get (This->config,"ssl_pem_pass")){
-        TN5250_LOG(("SSL: Setting password callback\n"));
-        len = strlen(tn5250_config_get (This->config, "ssl_pem_pass"));
-        This->userdata = malloc(len+1);
-        strncpy(This->userdata,
-                tn5250_config_get (This->config, "ssl_pem_pass"), len);
-        SSL_CTX_set_default_passwd_cb(This->ssl_context,
-                (pem_password_cb *)ssl_stream_passwd_cb);
-        SSL_CTX_set_default_passwd_cb_userdata(This->ssl_context, (void *)This);
-
-   }
-
-/* If a certificate file has been defined, load it into this context as well */
-
-   if (This->config!=NULL && tn5250_config_get (This->config, "ssl_cert_file")){
-        TN5250_LOG(("SSL: Loading certificates from certificate file\n"));
-        if (SSL_CTX_use_certificate_file(This->ssl_context,
-                tn5250_config_get (This->config, "ssl_cert_file"),
-                SSL_FILETYPE_PEM) <= 0) {
-            DUMP_ERR_STACK ();
-            return -1;
-        }
-        TN5250_LOG(("SSL: Loading private keys from certificate file\n"));
-        if (SSL_CTX_use_PrivateKey_file(This->ssl_context,
-                tn5250_config_get (This->config, "ssl_cert_file"),
-                SSL_FILETYPE_PEM) <= 0) {
-            DUMP_ERR_STACK ();
-            return -1;
-        }
-   }
-
-   This->ssl_handle = NULL;
-   This->connect = ssl_stream_connect;
-   This->accept = ssl_stream_accept;
-   This->disconnect = ssl_stream_disconnect;
-   This->handle_receive = ssl_stream_handle_receive;
-   This->send_packet = tn3270_ssl_stream_send_packet;
-   This->destroy = ssl_stream_destroy;
-   This->streamtype = TN3270E_STREAM;
-   return 0; /* Ok */
-}
-
 /****i* lib5250/ssl_stream_connect
  * NAME
  *    ssl_stream_connect
-- 
2.7.4