Only include certificates with CA flag in TLS cert request
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
#include <credentials/certificates/x509.h>
|
||||||
|
|
||||||
typedef struct private_tls_server_t private_tls_server_t;
|
typedef struct private_tls_server_t private_tls_server_t;
|
||||||
|
|
||||||
@@ -489,6 +490,7 @@ static status_t send_certificate_request(private_tls_server_t *this,
|
|||||||
tls_writer_t *authorities;
|
tls_writer_t *authorities;
|
||||||
enumerator_t *enumerator;
|
enumerator_t *enumerator;
|
||||||
certificate_t *cert;
|
certificate_t *cert;
|
||||||
|
x509_t *x509;
|
||||||
identification_t *id;
|
identification_t *id;
|
||||||
|
|
||||||
/* currently only RSA signatures are supported */
|
/* currently only RSA signatures are supported */
|
||||||
@@ -504,8 +506,12 @@ static status_t send_certificate_request(private_tls_server_t *this,
|
|||||||
CERT_X509, KEY_RSA, NULL, TRUE);
|
CERT_X509, KEY_RSA, NULL, TRUE);
|
||||||
while (enumerator->enumerate(enumerator, &cert))
|
while (enumerator->enumerate(enumerator, &cert))
|
||||||
{
|
{
|
||||||
id = cert->get_subject(cert);
|
x509 = (x509_t*)cert;
|
||||||
authorities->write_data16(authorities, id->get_encoding(id));
|
if (x509->get_flags(x509) & X509_CA)
|
||||||
|
{
|
||||||
|
id = cert->get_subject(cert);
|
||||||
|
authorities->write_data16(authorities, id->get_encoding(id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
enumerator->destroy(enumerator);
|
enumerator->destroy(enumerator);
|
||||||
writer->write_data16(writer, authorities->get_buf(authorities));
|
writer->write_data16(writer, authorities->get_buf(authorities));
|
||||||
|
|||||||
Reference in New Issue
Block a user