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