View | Details | Raw Unified | Return to bug 257657
Collapse All | Expand All

(-)b/net/socketw/Makefile (-2 / +1 lines)
Lines 1-7 Link Here
1
# Created by: Thibault Payet <monwarez@mailoo.org>
1
# Created by: Thibault Payet <monwarez@mailoo.org>
2
2
3
PORTNAME=	socketw
3
PORTNAME=	socketw
4
PORTVERSION=	3.10.26.20180918
4
DISTVERSION=	3.10.27
5
CATEGORIES=	net
5
CATEGORIES=	net
6
6
7
MAINTAINER=	monwarez@mailoo.org
7
MAINTAINER=	monwarez@mailoo.org
Lines 13-19 USES= cmake ssl:build Link Here
13
13
14
USE_GITHUB=	yes
14
USE_GITHUB=	yes
15
GH_ACCOUNT=	RigsOfRods
15
GH_ACCOUNT=	RigsOfRods
16
GH_TAGNAME=	f8db442
17
16
18
CFLAGS+=	-I${OPENSSLINC}
17
CFLAGS+=	-I${OPENSSLINC}
19
18
(-)b/net/socketw/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1539420870
1
TIMESTAMP = 1628243974
2
SHA256 (RigsOfRods-socketw-3.10.26.20180918-f8db442_GH0.tar.gz) = 94c670bac6f5ec4fa2f37773db43fdb77d9127065af386d08170fb304d5696ec
2
SHA256 (RigsOfRods-socketw-3.10.27_GH0.tar.gz) = 8f25b7ebf85ca12f2c3257e851be2a95819b9ac1ee78884fc4db81c850b5d70e
3
SIZE (RigsOfRods-socketw-3.10.26.20180918-f8db442_GH0.tar.gz) = 49810
3
SIZE (RigsOfRods-socketw-3.10.27_GH0.tar.gz) = 48424
(-)a/net/socketw/files/patch-src_sw__ssl.cxx (-84 lines)
Removed Link Here
1
--- src/sw_ssl.cxx.orig	2018-09-18 09:32:11 UTC
2
+++ src/sw_ssl.cxx
3
@@ -4,7 +4,7 @@
4
 // Started 020316
5
 //
6
 // License: LGPL v2.1+ (see the file LICENSE)
7
-// (c)2002-2003 Anders Lindström
8
+// (c)2002-2003 Anders Lindström
9
 
10
 /***********************************************************************
11
  *  This library is free software; you can redistribute it and/or      *
12
@@ -22,6 +22,7 @@
13
 #include <openssl/x509.h>
14
 #include <openssl/rsa.h>
15
 #include <openssl/evp.h>
16
+#include <cstring>
17
 
18
 using namespace std;
19
 
20
@@ -31,7 +32,25 @@ extern int close(int fd);
21
 extern int fcntl(int fd, int cmd, long arg);
22
 #endif
23
 
24
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
25
 
26
+int X509_get_signature_nid(const X509* peer)
27
+{
28
+    return OBJ_obj2nid(peer->sig_alg->algorithm);
29
+}
30
+int X509_certificate_type(const X509 *, const EVP_PKEY *pubkey)
31
+{
32
+    return pubkey->type;
33
+}
34
+
35
+int SSL_CTX_up_ref(SSL_CTX *ctx)
36
+{
37
+    return ctx->references++;
38
+}
39
+
40
+#endif
41
+
42
+
43
 //====================================================================
44
 //== Helper functions
45
 //====================================================================
46
@@ -557,7 +576,8 @@ bool SWSSLSocket::get_peerCert_info(SWSSLSocket::peerC
47
 		info->version = X509_get_version(peer);
48
 		
49
 		// Signature algorithm
50
-		int nid = OBJ_obj2nid(peer->sig_alg->algorithm);
51
+
52
+		int nid = X509_get_signature_nid(peer);
53
 		if( nid != NID_undef )
54
 			info->sgnAlgorithm = OBJ_nid2sn(nid);
55
 		else
56
@@ -566,7 +586,7 @@ bool SWSSLSocket::get_peerCert_info(SWSSLSocket::peerC
57
 		// Key algorithm
58
 		EVP_PKEY *pkey = X509_get_pubkey(peer);
59
 		if( pkey ){
60
-			info->keyAlgorithm = OBJ_nid2sn(pkey->type);
61
+			info->keyAlgorithm = OBJ_nid2sn(X509_certificate_type(peer, pkey));
62
 			info->keySize = 8 * EVP_PKEY_size(pkey);
63
 		}else{
64
 			info->keyAlgorithm = "";
65
@@ -689,7 +709,8 @@ bool SWSSLSocket::check_cert(SWBaseError *error)
66
 			}
67
 		}
68
 		
69
-		if( !(cert = BuildCertificate("SocketW session cert", NULL, NULL, evp_pkey)) ){
70
+                char certificateName[22] = "SocketW session cert\0";
71
+		if( !(cert = BuildCertificate(certificateName, NULL, NULL, evp_pkey)) ){
72
 			handle_ERRerror(error, fatal, "SWSSLSocket::handle_crypto_data() ");
73
 			return false;
74
 		}
75
@@ -718,7 +739,7 @@ SWBaseSocket* SWSSLSocket::create(int socketdescriptor
76
 	// Copy CTX object pointer
77
 	remoteClass->ctx  = ctx;
78
 	if( ctx )
79
-		ctx->references++;  // We don't want our destructor to delete ctx if still in use
80
+            SSL_CTX_up_ref(ctx);
81
 	
82
 	remoteClass->have_cert = have_cert; // Do CTX have cert loaded?
83
 	
84
- 

Return to bug 257657