about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-11-10 22:46:48 +0000
committerJames Booth <boothj5@gmail.com>2015-11-10 22:46:48 +0000
commit0bb596e14a34cacbe58da3bed62371bc17e53f11 (patch)
tree7afd5b69b9af0732f4d506a1de4544de4acb71d3 /src/xmpp
parentefb732e3c1318b8a3f493a48142a7f35b0a5acd7 (diff)
downloadprofani-tty-0bb596e14a34cacbe58da3bed62371bc17e53f11.tar.gz
Added extra fields to TLSCertificate
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/connection.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c
index dce836bc..dfda571a 100644
--- a/src/xmpp/connection.c
+++ b/src/xmpp/connection.c
@@ -389,12 +389,18 @@ _connection_free_session_data(void)
 static int
 _connection_certfail_cb(xmpp_tlscert_t *xmpptlscert, const char *const errormsg)
 {
+    int version = xmpp_conn_tlscert_version(xmpptlscert);
+    char *serialnumber = xmpp_conn_tlscert_serialnumber(xmpptlscert);
     char *subjectname = xmpp_conn_tlscert_subjectname(xmpptlscert);
-    char *fp = xmpp_conn_tlscert_fp(xmpptlscert);
+    char *issuername = xmpp_conn_tlscert_issuername(xmpptlscert);
+    char *fingerprint = xmpp_conn_tlscert_fingerprint(xmpptlscert);
     char *notbefore = xmpp_conn_tlscert_notbefore(xmpptlscert);
     char *notafter = xmpp_conn_tlscert_notafter(xmpptlscert);
+    char *key_alg = xmpp_conn_tlscert_key_algorithm(xmpptlscert);
+    char *signature_alg = xmpp_conn_tlscert_signature_algorithm(xmpptlscert);
 
-    TLSCertificate *cert = tlscerts_new(fp, subjectname, notbefore, notafter);
+    TLSCertificate *cert = tlscerts_new(fingerprint, version, serialnumber, subjectname, issuername, notbefore,
+        notafter, key_alg, signature_alg);
     int res = sv_ev_certfail(errormsg, cert);
     tlscerts_free(cert);
 
@@ -405,12 +411,18 @@ TLSCertificate*
 jabber_get_tls_peer_cert(void)
 {
     xmpp_tlscert_t *xmpptlscert = xmpp_conn_tls_peer_cert(jabber_conn.conn);
+    int version = xmpp_conn_tlscert_version(xmpptlscert);
+    char *serialnumber = xmpp_conn_tlscert_serialnumber(xmpptlscert);
     char *subjectname = xmpp_conn_tlscert_subjectname(xmpptlscert);
-    char *fp = xmpp_conn_tlscert_fp(xmpptlscert);
+    char *issuername = xmpp_conn_tlscert_issuername(xmpptlscert);
+    char *fingerprint = xmpp_conn_tlscert_fingerprint(xmpptlscert);
     char *notbefore = xmpp_conn_tlscert_notbefore(xmpptlscert);
     char *notafter = xmpp_conn_tlscert_notafter(xmpptlscert);
+    char *key_alg = xmpp_conn_tlscert_key_algorithm(xmpptlscert);
+    char *signature_alg = xmpp_conn_tlscert_signature_algorithm(xmpptlscert);
 
-    TLSCertificate *cert = tlscerts_new(fp, subjectname, notbefore, notafter);
+    TLSCertificate *cert = tlscerts_new(fingerprint, version, serialnumber, subjectname, issuername, notbefore,
+        notafter, key_alg, signature_alg);
 
     xmpp_conn_free_tlscert(jabber_conn.ctx, xmpptlscert);