Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified GnuTLS priority according to standard crypto-policy guideline #171

Merged
merged 1 commit into from
Apr 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions src/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,20 +1136,29 @@ relpTcpTLSSetPrio_gtls(relpTcp_t *const pThis)
char pristringBuf[4096];
char *pristring;
ENTER_RELPFUNC;
/* Compute priority string (in simple cases where the user does not care...) */
/* Set default priority string (in simple cases where the user does not care...) */
if(pThis->pristring == NULL) {
if(pThis->bEnableTLSZip) {
strncpy(pristringBuf, "NORMAL:+ANON-DH:+COMP-ALL", sizeof(pristringBuf));
} else {
strncpy(pristringBuf, "NORMAL:+ANON-DH:+COMP-NULL", sizeof(pristringBuf));
if (pThis->authmode == eRelpAuthMode_None) {
if(pThis->bEnableTLSZip) {
strncpy(pristringBuf, "NORMAL:+ANON-DH:+COMP-ALL", sizeof(pristringBuf));
} else {
strncpy(pristringBuf, "NORMAL:+ANON-DH:+COMP-NULL", sizeof(pristringBuf));
}
pristringBuf[sizeof(pristringBuf)-1] = '\0';
pristring = pristringBuf;
pristringBuf[sizeof(pristringBuf)-1] = '\0';
pristring = pristringBuf;
r = gnutls_priority_set_direct(pThis->session, pristring, NULL);
} else {
r = gnutls_set_default_priority(pThis->session);
strncpy(pristringBuf, "to recommended system default", sizeof(pristringBuf));
pristringBuf[sizeof(pristringBuf)-1] = '\0';
pristring = pristringBuf;
}

} else {
pristring = pThis->pristring;
r = gnutls_priority_set_direct(pThis->session, pristring, NULL);
}

r = gnutls_priority_set_direct(pThis->session, pristring, NULL);
if(r == GNUTLS_E_INVALID_REQUEST) {
ABORT_FINALIZE(RELP_RET_INVLD_TLS_PRIO);
} else if(r != GNUTLS_E_SUCCESS) {
Expand Down