Skip to content

Commit

Permalink
Fix reporting authentication failure
Browse files Browse the repository at this point in the history
  • Loading branch information
wtoorop committed Mar 2, 2020
1 parent e17ed39 commit af46e20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/gnutls/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,11 @@ getdns_return_t _getdns_tls_connection_certificate_verify(_getdns_tls_connection
GETDNS_FREE(*conn->mfs, new_cert_list);
}

if (ret != DANE_E_SUCCESS)
if (ret != DANE_E_SUCCESS) {
*errnum = ret;
*errmsg = dane_strerror(ret);
return GETDNS_RETURN_GENERIC_ERROR;
}

if (verify != 0) {
if (verify & DANE_VERIFY_CERT_DIFFERS) {
Expand Down
4 changes: 2 additions & 2 deletions src/stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,8 +1035,8 @@ tls_do_handshake(getdns_upstream *upstream)
: "*Failure*" ));
upstream->tls_auth_state = GETDNS_AUTH_FAILED;
} else {
long verify_errno;
const char* verify_errmsg;
long verify_errno = 0;
const char* verify_errmsg = "Unknown verify error (fix reporting!)";

if (_getdns_tls_connection_certificate_verify(upstream->tls_obj, &verify_errno, &verify_errmsg)) {
upstream->tls_auth_state = GETDNS_AUTH_FAILED;
Expand Down

0 comments on commit af46e20

Please sign in to comment.