Blame SOURCES/librelp-1.10.0-crypto-compliance.patch

2781d7
diff -up librelp-1.10.0/src/tcp.c.crypto-compliance librelp-1.10.0/src/tcp.c
2781d7
--- librelp-1.10.0/src/tcp.c.crypto-compliance	2021-02-16 09:07:24.000000000 +0100
2781d7
+++ librelp-1.10.0/src/tcp.c	2021-08-17 10:13:53.368936612 +0200
2781d7
@@ -1155,32 +1155,8 @@ static relpRetVal LIBRELP_ATTR_NONNULL()
2781d7
 relpTcpTLSSetPrio_gtls(relpTcp_t *const pThis)
2781d7
 {
2781d7
 	int r;
2781d7
-	char pristringBuf[4096];
2781d7
-	char *pristring;
2781d7
 	ENTER_RELPFUNC;
2781d7
-	/* Set default priority string (in simple cases where the user does not care...) */
2781d7
-	if(pThis->pristring == NULL) {
2781d7
-		if (pThis->authmode == eRelpAuthMode_None) {
2781d7
-			if(pThis->bEnableTLSZip) {
2781d7
-				strncpy(pristringBuf, "NORMAL:+ANON-DH:+COMP-ALL", sizeof(pristringBuf));
2781d7
-			} else {
2781d7
-				strncpy(pristringBuf, "NORMAL:+ANON-DH:+COMP-NULL", sizeof(pristringBuf));
2781d7
-			}
2781d7
-			pristringBuf[sizeof(pristringBuf)-1] = '\0';
2781d7
-			pristring = pristringBuf;
2781d7
-			r = gnutls_priority_set_direct(pThis->session, pristring, NULL);
2781d7
-		} else {
2781d7
-			r = gnutls_set_default_priority(pThis->session);
2781d7
-			strncpy(pristringBuf, "to recommended system default", sizeof(pristringBuf));
2781d7
-			pristringBuf[sizeof(pristringBuf)-1] = '\0';
2781d7
-			pristring = pristringBuf;
2781d7
-		}
2781d7
-
2781d7
-	} else {
2781d7
-		pristring = pThis->pristring;
2781d7
-		r = gnutls_priority_set_direct(pThis->session, pristring, NULL);
2781d7
-	}
2781d7
-
2781d7
+	r = gnutls_set_default_priority(pThis->session);
2781d7
 	if(r == GNUTLS_E_INVALID_REQUEST) {
2781d7
 		ABORT_FINALIZE(RELP_RET_INVLD_TLS_PRIO);
2781d7
 	} else if(r != GNUTLS_E_SUCCESS) {
2781d7
@@ -1188,7 +1164,7 @@ relpTcpTLSSetPrio_gtls(relpTcp_t *const
2781d7
 	}
2781d7
 
2781d7
 finalize_it:
2781d7
-	pThis->pEngine->dbgprint((char*)"relpTcpTLSSetPrio_gtls: Setting ciphers '%s' iRet=%d\n", pristring, iRet);
2781d7
+	pThis->pEngine->dbgprint((char*)"relpTcpTLSSetPrio_gtls: Setting ciphers to system default iRet=%d\n", iRet);
2781d7
 
2781d7
 	if(iRet != RELP_RET_OK) {
2781d7
 		chkGnutlsCode(pThis, "Failed to set GnuTLS priority", iRet, r);
2781d7
@@ -1207,38 +1183,15 @@ relpTcpTLSSetPrio_gtls(LIBRELP_ATTR_UNUS
2781d7
 static relpRetVal LIBRELP_ATTR_NONNULL()
2781d7
 relpTcpTLSSetPrio_ossl(relpTcp_t *const pThis)
2781d7
 {
2781d7
-	char pristringBuf[4096];
2781d7
-	char *pristring;
2781d7
 	ENTER_RELPFUNC;
2781d7
-	/* Compute priority string (in simple cases where the user does not care...) */
2781d7
-	if(pThis->pristring == NULL) {
2781d7
-		if (pThis->authmode == eRelpAuthMode_None) {
2781d7
-			#if OPENSSL_VERSION_NUMBER >= 0x10100000L \
2781d7
-				&& !defined(LIBRESSL_VERSION_NUMBER)
2781d7
-			 /* NOTE: do never use: +eNULL, it DISABLES encryption! */
2781d7
-			strncpy(pristringBuf, "ALL:+COMPLEMENTOFDEFAULT:+ADH:+ECDH:+aNULL@SECLEVEL=0",
2781d7
-				sizeof(pristringBuf));
2781d7
-			#else
2781d7
-			strncpy(pristringBuf, "ALL:+COMPLEMENTOFDEFAULT:+ADH:+ECDH:+aNULL",
2781d7
-				sizeof(pristringBuf));
2781d7
-			#endif
2781d7
-		} else {
2781d7
-			strncpy(pristringBuf, "DEFAULT", sizeof(pristringBuf));
2781d7
-		}
2781d7
-		pristringBuf[sizeof(pristringBuf)-1] = '\0';
2781d7
-		pristring = pristringBuf;
2781d7
-	} else {
2781d7
-		/* We use custom CipherString if used sets it by SslConfCmd */
2781d7
-		pristring = pThis->pristring;
2781d7
-	}
2781d7
 
2781d7
-	if ( SSL_set_cipher_list(pThis->ssl, pristring) == 0 ){
2781d7
-		pThis->pEngine->dbgprint((char*)"relpTcpTLSSetPrio_ossl: Error setting ciphers '%s'\n", pristring);
2781d7
+	if (SSL_set_cipher_list(pThis->ssl, "PROFILE=SYSTEM") == 0){
2781d7
+		pThis->pEngine->dbgprint((char*)"relpTcpTLSSetPrio_ossl: Error setting ciphers to system default\n");
2781d7
 		ABORT_FINALIZE(RELP_RET_ERR_TLS_SETUP);
2781d7
 	}
2781d7
 
2781d7
 finalize_it:
2781d7
-	pThis->pEngine->dbgprint((char*)"relpTcpTLSSetPrio_ossl: Setting ciphers '%s' iRet=%d\n", pristring, iRet);
2781d7
+	pThis->pEngine->dbgprint((char*)"relpTcpTLSSetPrio_ossl: Setting ciphers to system default iRet=%d\n", iRet);
2781d7
 	LEAVE_RELPFUNC;
2781d7
 }
2781d7
 #else