ftp://ftp.gnutls.org/pub/gnutls/opencdk/
- Documentation:
- view the doc/ directory and the examples in the src/ directory.
+ view the doc/ directory and the examples in the doc/examples directory.
****************************
Current list:
+ Add ability to read PKCS-12 structures (certificate and private key)
-* Allow sending any client certificate. Not only the ones requested.
* Convert documentation to texinfo format
* Audit the code
* Add GPGSM certificate manager support
/*
- * Copyright (C) 2001,2002,2003 Nikos Mavroyanopoulos
+ * Copyright (C) 2001,2002,2003 Nikos Mavroyanopoulos
*
- * This file is part of GNUTLS.
+ * This file is part of GNUTLS.
*
* The GNUTLS library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* of X509 certificates.
*/
if (gnutls_certificate_type_get(session) ==
- GNUTLS_CRT_X509) {
+ GNUTLS_CRT_X509 && issuers_dn_len > 0) {
data = _data;
data_size = _data_size;
}
- } else { /* Other certificate types */
+ } else { /* Other certificate types */
issuers_dn_len = 0;
issuers_dn = NULL;
}
/* put our certificate's issuer and dn into cdn, idn
* Note that the certificates we provide to the callback
* are not all the certificates we have. Only the certificates
- * that are requested by the server (CA matches - and sign
+ * that are requested by the server (certificate type - and sign
* algorithm matches), are provided.
*/
for (j = i = 0; i < cred->ncerts; i++) {
size = CERTTYPE_SIZE + 2; /* 2 for gnutls_certificate_type + 2 for size of rdn_seq
*/
- if (session->security_parameters.cert_type == GNUTLS_CRT_X509)
+ if (session->security_parameters.cert_type == GNUTLS_CRT_X509 &&
+ session->internals.ignore_rdn_sequence == 0)
size += cred->x509_rdn_sequence.size;
(*data) = gnutls_malloc(size);
pdata[2] = DSA_SIGN; /* only these for now */
pdata += CERTTYPE_SIZE;
- if (session->security_parameters.cert_type == GNUTLS_CRT_X509) {
+ if (session->security_parameters.cert_type == GNUTLS_CRT_X509 &&
+ session->internals.ignore_rdn_sequence == 0) {
_gnutls_write_datum16(pdata, cred->x509_rdn_sequence);
pdata += cred->x509_rdn_sequence.size + 2;
}
*/
uint16 extensions_sent[MAX_EXT_TYPES];
uint16 extensions_sent_size;
-
+
/* is 0 if we are to send the whole PGP key, or non zero
* if the fingerprint is to be sent.
*/
* openpgp key. (if the peer sends a fingerprint)
*/
gnutls_openpgp_recv_key_func openpgp_recv_key_func;
+
+ /* If non zero the server will not advertize the CA's he
+ * trusts (do not send an RDN sequence).
+ */
+ int ignore_rdn_sequence;
/* If you add anything here, check _gnutls_handshake_internal_state_clear().
*/
session->internals.pgp_fingerprint = status;
}
+/**
+ * gnutls_certificate_send_x509_rdn_sequence - This function will order gnutls to or not to send the x.509 rdn sequence
+ * @session: is a pointer to a &gnutls_session structure.
+ * @status: is 0 or 1
+ *
+ * If status is non zero, this function will order gnutls not to send the rdnSequence
+ * in the certificate request message. That is the server will not advertize
+ * it's trusted CAs to the peer. If status is zero then the default behaviour will
+ * take effect, which is to advertize the server's trusted CAs.
+ *
+ * This function has no effect in clients, and in authentication methods other than
+ * certificate with X.509 certificates.
+ *
+ **/
+void gnutls_certificate_send_x509_rdn_sequence(gnutls_session session, int status) {
+ session->internals.ignore_rdn_sequence = status;
+}
+
int _gnutls_openpgp_send_fingerprint(gnutls_session session) {
return session->internals.pgp_fingerprint;
}
return 0;
}
-static int generate_rdn_seq( gnutls_certificate_credentials res) {
+static int generate_rdn_seq( gnutls_certificate_credentials res)
+{
gnutls_const_datum tmp;
gnutls_datum _tmp;
int ret;