session UPDATE reflect wrapper changes
diff --git a/src/session.c b/src/session.c
index f5d1cc8..83f3a8a 100644
--- a/src/session.c
+++ b/src/session.c
@@ -159,12 +159,11 @@
{
int ret = 0;
long len;
- char *bin = NULL, *tmp;
+ unsigned char *bin = NULL, *tmp;
/* decode base64 */
len = nc_base64_decode_wrap(b64, &bin);
if (len == -1) {
- ERR(NULL, "Decoding base64 public key to binary failed.");
ret = -1;
goto cleanup;
}
@@ -173,7 +172,7 @@
tmp = bin;
/* try to parse the supposed SubjectPublicKeyInfo binary data */
- if (!nc_der_to_pubkey_wrap((const unsigned char *)tmp, len)) {
+ if (nc_tls_is_der_subpubkey_wrap(tmp, len)) {
/* success, it's most likely SubjectPublicKeyInfo */
ret = 1;
} else {
@@ -803,8 +802,11 @@
}
nc_tls_ctx_destroy_wrap(&session->ti.tls.ctx);
+ memset(&session->ti.tls.ctx, 0, sizeof session->ti.tls.ctx);
nc_tls_session_destroy_wrap(session->ti.tls.session);
+ session->ti.tls.session = NULL;
nc_tls_config_destroy_wrap(session->ti.tls.config);
+ session->ti.tls.config = NULL;
if (session->side == NC_SERVER) {
// TODO
diff --git a/src/session_p.h b/src/session_p.h
index 16c452b..f8ed263 100644
--- a/src/session_p.h
+++ b/src/session_p.h
@@ -279,7 +279,8 @@
char *referenced_endpt_name; /**< Reference to another endpoint (used for client authentication). */
unsigned int tls_versions; /**< TLS versions */
- char *ciphers; /**< TLS ciphers */
+ void *ciphers; /**< TLS ciphers */
+ uint16_t cipher_count; /**< Number of TLS ciphers */
struct nc_ctn *ctn; /**< Cert-to-name entries */
};