2015-02-09 22:04:14 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2018-03-17 17:29:09 +01:00
|
|
|
|
2015-02-09 22:04:14 +01:00
|
|
|
#include "conn.h"
|
2018-04-02 01:39:08 +02:00
|
|
|
/*#include "dtls.h"*/
|
|
|
|
#include "dtls_common.h"
|
2015-02-09 22:04:14 +01:00
|
|
|
#include "dtls_gnutls.h"
|
|
|
|
|
|
|
|
struct dtls_ssl_cert dtls_gnutls_get_peers_cert(struct conn * conn,unsigned int n)
|
|
|
|
{
|
|
|
|
struct dtls_gnutls_data *d;
|
|
|
|
const gnutls_datum_t * clist;
|
|
|
|
struct dtls_ssl_cert cert;
|
|
|
|
unsigned int len;
|
2018-03-06 18:28:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
d=(struct dtls_gnutls_data*)conn->dtls_data;
|
|
|
|
|
2015-02-09 22:04:14 +01:00
|
|
|
clist = gnutls_certificate_get_peers(d->session,&len);
|
|
|
|
|
|
|
|
cert.size = clist[n].size;
|
|
|
|
cert.data= clist[n].data;
|
|
|
|
return cert;
|
|
|
|
}
|
|
|
|
|
|
|
|
|