3 Commits

Author SHA1 Message Date
Dmitry Podgorny
2d5424bcff Release libstrophe-0.10.1 2020-12-24 16:04:21 +02:00
Dmitry Podgorny
5792d52461 doxygen: set correct version number 2020-12-19 02:33:14 +02:00
Dmitry Podgorny
09229e2cd5 conn: remove extra ; symbol 2020-10-07 20:18:20 +03:00
8 changed files with 6 additions and 50 deletions

View File

@@ -1,5 +1,6 @@
0.10.1
- Fixed compilation error when LibreSSL is used
- Fixed crash when NULL is provided as password
0.10.0
- Coding style has been unified

View File

@@ -38,7 +38,7 @@ PROJECT_NAME = Strophe
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 0.9
PROJECT_NUMBER = 0.10
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@@ -1,4 +1,4 @@
AC_INIT([libstrophe], [0.10.0], [jack@metajack.im])
AC_INIT([libstrophe], [0.10.1], [jack@metajack.im])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign])
LT_INIT([dlopen])

View File

@@ -49,7 +49,6 @@ int main(int argc, char **argv)
xmpp_conn_t *conn;
xmpp_log_t *log;
char *jid, *pass, *host = NULL;
const char *cafile = NULL;
long flags = 0;
int tcp_keepalive = 0;
int i;
@@ -68,15 +67,12 @@ int main(int argc, char **argv)
flags |= XMPP_CONN_FLAG_LEGACY_AUTH;
else if (strcmp(argv[i], "--tcp-keepalive") == 0)
tcp_keepalive = 1;
else if (strncmp(argv[i], "--cafile=", strlen("--cafile=")) == 0)
cafile = argv[i] + strlen("--cafile=");
else
break;
}
if ((argc - i) < 2 || (argc - i) > 3) {
fprintf(stderr, "Usage: basic [options] <jid> <pass> [<host>]\n\n"
"Options:\n"
" --cafile=<PATH> CAfile for cert verification.\n"
" --disable-tls Disable TLS.\n"
" --mandatory-tls Deny plaintext connection.\n"
" --trust-tls Trust TLS certificate.\n"
@@ -115,10 +111,6 @@ int main(int argc, char **argv)
if (tcp_keepalive)
xmpp_conn_set_keepalive(conn, KA_TIMEOUT, KA_INTERVAL);
/* add external CAfile if needed */
if (cafile)
xmpp_conn_tls_cafile(conn, cafile);
/* setup authentication information */
xmpp_conn_set_jid(conn, jid);
xmpp_conn_set_pass(conn, pass);

View File

@@ -171,7 +171,6 @@ struct _xmpp_conn_t {
int ka_interval; /* TCP keepalive interval */
tls_t *tls;
char *tls_cafile;
int tls_support;
int tls_disabled;
int tls_mandatory;

View File

@@ -137,7 +137,6 @@ xmpp_conn_t *xmpp_conn_new(xmpp_ctx_t *const ctx)
conn->bound_jid = NULL;
conn->is_raw = 0;
conn->tls_cafile = NULL;
conn->tls_support = 0;
conn->tls_disabled = 0;
conn->tls_mandatory = 0;
@@ -339,8 +338,6 @@ int xmpp_conn_release(xmpp_conn_t *const conn)
xmpp_free(ctx, conn->pass);
if (conn->lang)
xmpp_free(ctx, conn->lang);
if (conn->tls_cafile)
xmpp_free(ctx, conn->tls_cafile);
xmpp_free(ctx, conn);
released = 1;
}
@@ -689,28 +686,6 @@ int xmpp_conn_tls_start(xmpp_conn_t *const conn)
return conn_tls_start(conn);
}
/** Set external CAfile which will be used for TLS cert verification.
*
* @return XMPP_EOK (0) on success a number less than 0 on failure
*
* @ingroup Connections
*/
int xmpp_conn_tls_cafile(xmpp_conn_t *const conn, const char *cafile)
{
FILE *f;
f = fopen(cafile, "r");
if (f == NULL) {
xmpp_debug(conn->ctx, "conn", "CAfile '%s' is not readable. errno=%d",
cafile, errno);
return XMPP_EINVOP;
}
fclose(f);
conn->tls_cafile = xmpp_strdup(conn->ctx, cafile);
return conn->tls_cafile == NULL ? XMPP_EMEM : XMPP_EOK;
}
/** Cleanly disconnect the connection.
* This function is only called by the stream parser when </stream:stream>
* is received, and it not intended to be called by code outside of Strophe.
@@ -940,10 +915,6 @@ int conn_tls_start(xmpp_conn_t *const conn)
}
if (conn->tls != NULL) {
if (conn->tls_cafile != NULL) {
(void)tls_set_credentials(conn->tls, conn->tls_cafile);
}
if (tls_start(conn->tls)) {
conn->secured = 1;
} else {
@@ -980,7 +951,6 @@ long xmpp_conn_get_flags(const xmpp_conn_t *const conn)
XMPP_CONN_FLAG_LEGACY_SSL * conn->tls_legacy_ssl |
XMPP_CONN_FLAG_TRUST_TLS * conn->tls_trust |
XMPP_CONN_FLAG_LEGACY_AUTH * conn->auth_legacy_enabled;
;
return flags;
}

View File

@@ -318,14 +318,9 @@ void tls_free(tls_t *tls)
int tls_set_credentials(tls_t *tls, const char *cafilename)
{
int ret;
ret = SSL_CTX_load_verify_locations(tls->ssl_ctx, cafilename, NULL);
if (ret != 1) {
xmpp_error(tls->ctx, "tls", "Failed to process CAfile: %s", cafilename);
_tls_log_error(tls->ctx);
}
return ret;
UNUSED(tls);
UNUSED(cafilename);
return -1;
}
int tls_start(tls_t *tls)

View File

@@ -271,7 +271,6 @@ int xmpp_conn_open_stream(xmpp_conn_t *const conn,
char **attributes,
size_t attributes_len);
int xmpp_conn_tls_start(xmpp_conn_t *const conn);
int xmpp_conn_tls_cafile(xmpp_conn_t *const conn, const char *cafile);
void xmpp_disconnect(xmpp_conn_t *const conn);