Compare commits
3 Commits
fix-compil
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8cda0f65c | ||
|
|
649a3b4fca | ||
|
|
a2b3b6b9e2 |
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -111,7 +111,7 @@ jobs:
|
||||
cat test-suite*.log || true
|
||||
|
||||
release-test:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
name: Check if release would work
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
/** handlers **/
|
||||
#if (__STDC_VERSION__ >= 202000L)
|
||||
typedef void* xmpp_void_handler;
|
||||
typedef void *xmpp_void_handler;
|
||||
#else
|
||||
typedef int (*xmpp_void_handler)();
|
||||
#endif
|
||||
|
||||
17
src/tls.c
17
src/tls.c
@@ -74,6 +74,23 @@ xmpp_conn_t *xmpp_tlscert_get_conn(const xmpp_tlscert_t *cert)
|
||||
return cert->conn;
|
||||
}
|
||||
|
||||
/** Get the userdata of a Strophe connection which is assigned to this
|
||||
* certificate.
|
||||
*
|
||||
* @param cert a Strophe TLS certificate object
|
||||
*
|
||||
* @return the userdata of a Strophe connection object where this certificate
|
||||
* originates from
|
||||
*
|
||||
* @ingroup TLS
|
||||
*/
|
||||
void *xmpp_tlscert_get_userdata(const xmpp_tlscert_t *cert)
|
||||
{
|
||||
if (cert->conn == NULL)
|
||||
return NULL;
|
||||
return cert->conn->userdata;
|
||||
}
|
||||
|
||||
/** Get the complete PEM of this certificate.
|
||||
*
|
||||
* @param cert a Strophe TLS certificate object
|
||||
|
||||
@@ -422,6 +422,8 @@ static int _tls_verify(gnutls_session_t session)
|
||||
return -1;
|
||||
}
|
||||
|
||||
tlscert->conn = tls->conn;
|
||||
|
||||
if (tls->conn->certfail_handler(tlscert, (char *)out.data) == 0) {
|
||||
xmpp_tlscert_free(tlscert);
|
||||
gnutls_x509_crt_deinit(cert);
|
||||
|
||||
@@ -540,6 +540,8 @@ static int _tls_verify(int preverify_ok, X509_STORE_CTX *x509_ctx)
|
||||
if (!tlscert)
|
||||
return 0;
|
||||
|
||||
tlscert->conn = conn;
|
||||
|
||||
strophe_debug(conn->ctx, "tls", "preverify_ok:%d\nSubject: %s\nIssuer: %s",
|
||||
preverify_ok, tlscert->elements[XMPP_CERT_SUBJECT],
|
||||
tlscert->elements[XMPP_CERT_ISSUER]);
|
||||
|
||||
@@ -642,6 +642,7 @@ void xmpp_ctx_set_timeout(xmpp_ctx_t *ctx, unsigned long timeout);
|
||||
|
||||
xmpp_ctx_t *xmpp_tlscert_get_ctx(const xmpp_tlscert_t *cert);
|
||||
xmpp_conn_t *xmpp_tlscert_get_conn(const xmpp_tlscert_t *cert);
|
||||
void *xmpp_tlscert_get_userdata(const xmpp_tlscert_t *cert);
|
||||
const char *xmpp_tlscert_get_pem(const xmpp_tlscert_t *cert);
|
||||
const char *xmpp_tlscert_get_dnsname(const xmpp_tlscert_t *cert, size_t n);
|
||||
const char *xmpp_tlscert_get_string(const xmpp_tlscert_t *cert,
|
||||
|
||||
Reference in New Issue
Block a user