From: Nikos Mavrogiannopoulos Date: Sat, 30 Mar 2002 09:52:23 +0000 (+0000) Subject: Removed the CRL list parameter from gnutls_certificate_set_x509_trust_*. X-Git-Tag: gnutls_0_4_0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c7f01172f63f62bbbb34ff21bee50b28a71b0aa;p=thirdparty%2Fgnutls.git Removed the CRL list parameter from gnutls_certificate_set_x509_trust_*. --- diff --git a/ChangeLog b/ChangeLog index 8604aa42ba..9ecccf76d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,38 @@ +2002-03-29 12:12 nmav + + * lib/: gnutls_algorithms.c, gnutls_cipher.c, gnutls_cipher_int.c, + gnutls_cipher_int.h, gnutls_compress.c, gnutls_compress_int.c, + gnutls_compress_int.h, gnutls_constate.c, gnutls_handshake.c, + gnutls_hash_int.c, gnutls_hash_int.h, gnutls_int.h, gnutls_kx.c, + gnutls_sig.c, gnutls_srp.c, gnutls_state.c, gnutls_ui.c, + x509_sig_check.c: + + Prefixed with underscore several internal functions. + +2002-03-29 11:38 nmav + + * lib/: auth_cert.c, auth_dhe.c, auth_rsa.c, gnutls_algorithms.c, + gnutls_algorithms.h, gnutls_cert.c, gnutls_cert.h, gnutls_global.c, + gnutls_x509.c: + + removed unneeded functions + +2002-03-29 11:38 nmav + + * src/: cli-gaa.c, cli-gaa.h, cli.c, cli.gaa: + + added crlf option + +2002-03-29 11:16 nmav + + * ChangeLog, doc/TODO, lib/auth_rsa.c, lib/gnutls_int.h, + lib/gnutls_pk.c, lib/gnutls_pk.h, lib/gnutls_sig.c, lib/x509_der.c, + lib/x509_sig_check.c, src/cli.c, src/serv-gaa.c, src/serv-gaa.h, + src/serv.gaa: + + Some cleanups in the certificate authentication. Parameters are + passed together with the length, to avoid abuse. + 2002-03-28 12:46 nmav * lib/: gnutls_x509.c, x509_b64.c: diff --git a/doc/tex/ex1.tex b/doc/tex/ex1.tex index 83bfa5e19c..75bf715b12 100644 --- a/doc/tex/ex1.tex +++ b/doc/tex/ex1.tex @@ -50,7 +50,7 @@ int main() fprintf(stderr, "memory error\n"); exit(1); } - gnutls_certificate_set_x509_trust_file(xcred, CAFILE, CRLFILE, GNUTLS_X509_FMT_PEM); + gnutls_certificate_set_x509_trust_file(xcred, CAFILE, GNUTLS_X509_FMT_PEM); for (t = 0; t < 2; t++) { /* connect 2 times to the server */ diff --git a/doc/tex/ex2.tex b/doc/tex/ex2.tex index ff83ed8078..b0124aaf9c 100644 --- a/doc/tex/ex2.tex +++ b/doc/tex/ex2.tex @@ -42,7 +42,7 @@ int main() } /* set's the trusted cas file */ - gnutls_certificate_set_x509_trust_file(xcred, CAFILE, CRLFILE, GNUTLS_X509_FMT_PEM); + gnutls_certificate_set_x509_trust_file(xcred, CAFILE, GNUTLS_X509_FMT_PEM); /* connects to server */ diff --git a/doc/tex/ex3.tex b/doc/tex/ex3.tex index 4fa7ea4c09..94fdc2d7eb 100644 --- a/doc/tex/ex3.tex +++ b/doc/tex/ex3.tex @@ -52,14 +52,15 @@ int print_info(GNUTLS_STATE state) printf("- Peer's certificate is invalid\n"); if ( status & GNUTLS_CERT_EXPIRED) printf("- Peer's certificate is expired\n"); - if ( status & GNUTLS_CERT_NOT_TRUSTED) - printf("- Peer's certificate is not trusted\n"); - else - printf("- Peer's certificate is trusted\n"); if ( status & GNUTLS_CERT_CORRUPTED) printf("- Peer's certificate is corrupted.\n"); if ( status & GNUTLS_CERT_REVOKED) printf("- Peer's certificate is revoked\n"); + + if ( status & GNUTLS_CERT_NOT_TRUSTED) + printf("- Peer's certificate is not trusted\n"); + else + printf("- Peer's certificate is trusted\n"); } /* Check if we have been using ephemeral Diffie Hellman. diff --git a/doc/tex/serv1.tex b/doc/tex/serv1.tex index e7a9ab3546..ceb3c6bc07 100644 --- a/doc/tex/serv1.tex +++ b/doc/tex/serv1.tex @@ -152,11 +152,13 @@ int main() fprintf(stderr, "memory error\n"); exit(1); } - if (gnutls_certificate_set_x509_trust_file(x509_cred, CAFILE, CRLFILE) < 0) { + if (gnutls_certificate_set_x509_trust_file(x509_cred, CAFILE, + GNUTLS_X509_FMT_PEM) < 0) { fprintf(stderr, "X509 PARSE ERROR\nDid you have ca.pem?\n"); exit(1); } - if (gnutls_certificate_set_x509_key_file(x509_cred, CERTFILE, KEYFILE) < 0) { + if (gnutls_certificate_set_x509_key_file(x509_cred, CERTFILE, KEYFILE, + GNUTLS_X509_FMT_PEM) < 0) { fprintf(stderr, "X509 PARSE ERROR\nDid you have key.pem and cert.pem?\n"); exit(1); } diff --git a/lib/gnutls.h.in.in b/lib/gnutls.h.in.in index 9a7020fe87..6f582d07d9 100644 --- a/lib/gnutls.h.in.in +++ b/lib/gnutls.h.in.in @@ -229,9 +229,9 @@ int gnutls_certificate_allocate_sc( GNUTLS_CERTIFICATE_CREDENTIALS *sc); int gnutls_certificate_set_dh_params(GNUTLS_CERTIFICATE_CREDENTIALS res, GNUTLS_DH_PARAMS); int gnutls_certificate_set_x509_trust_file( GNUTLS_CERTIFICATE_CREDENTIALS res, char* CAFILE, - char* CRLFILE, GNUTLS_X509_CertificateFmt); -int gnutls_certificate_set_x509_trust_mem(GNUTLS_CERTIFICATE_CREDENTIALS res, const gnutls_datum *CA, - const gnutls_datum *CRL, GNUTLS_X509_CertificateFmt); + GNUTLS_X509_CertificateFmt); +int gnutls_certificate_set_x509_trust_mem(GNUTLS_CERTIFICATE_CREDENTIALS res, + const gnutls_datum *CA, GNUTLS_X509_CertificateFmt); int gnutls_certificate_set_x509_key_file( GNUTLS_CERTIFICATE_CREDENTIALS res, char *CERTFILE, char* KEYFILE, GNUTLS_X509_CertificateFmt); diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c index aff90cf076..27fb20d458 100644 --- a/lib/gnutls_x509.c +++ b/lib/gnutls_x509.c @@ -1522,15 +1522,14 @@ opaque *pdata; * gnutls_certificate_set_x509_trust_mem - Used to add trusted CAs in a GNUTLS_CERTIFICATE_CREDENTIALS structure * @res: is an &GNUTLS_CERTIFICATE_CREDENTIALS structure. * @CA: is a list of trusted CAs or a DER certificate - * @CRL: is a list of CRLs (ignored for now) * @type: is DER or PEM * * This function adds the trusted CAs in order to verify client * certificates. This function may be called multiple times. * **/ -int gnutls_certificate_set_x509_trust_mem(GNUTLS_CERTIFICATE_CREDENTIALS res, const gnutls_datum *CA, - const gnutls_datum *CRL, GNUTLS_X509_CertificateFmt type) +int gnutls_certificate_set_x509_trust_mem(GNUTLS_CERTIFICATE_CREDENTIALS res, + const gnutls_datum *CA, GNUTLS_X509_CertificateFmt type) { int ret, ret2; @@ -1547,7 +1546,6 @@ int gnutls_certificate_set_x509_trust_mem(GNUTLS_CERTIFICATE_CREDENTIALS res, co * gnutls_certificate_set_x509_trust_file - Used to add trusted CAs in a GNUTLS_CERTIFICATE_CREDENTIALS structure * @res: is an &GNUTLS_CERTIFICATE_CREDENTIALS structure. * @CAFILE: is a file containing the list of trusted CAs (DER or PEM list) - * @CRLFILE: is a file containing CRLs (ignored for now) * @type: is PEM or DER * * This function sets the trusted CAs in order to verify client @@ -1555,8 +1553,8 @@ int gnutls_certificate_set_x509_trust_mem(GNUTLS_CERTIFICATE_CREDENTIALS res, co * Returns the number of certificate processed. * **/ -int gnutls_certificate_set_x509_trust_file(GNUTLS_CERTIFICATE_CREDENTIALS res, char *CAFILE, - char *CRLFILE, GNUTLS_X509_CertificateFmt type) +int gnutls_certificate_set_x509_trust_file(GNUTLS_CERTIFICATE_CREDENTIALS res, + char *CAFILE, GNUTLS_X509_CertificateFmt type) { int ret, ret2; diff --git a/src/cli.c b/src/cli.c index 72d289e44f..7c2dd4aa01 100644 --- a/src/cli.c +++ b/src/cli.c @@ -172,7 +172,7 @@ int main(int argc, char **argv) if (x509_cafile != NULL) { ret = gnutls_certificate_set_x509_trust_file(xcred, x509_cafile, - x509_crlfile, x509ctype); + x509ctype); if (ret < 0) { fprintf(stderr, "Error setting the x509 trust file\n"); } else { diff --git a/src/serv.c b/src/serv.c index fd6f5109e3..404a6fd5b7 100644 --- a/src/serv.c +++ b/src/serv.c @@ -348,7 +348,7 @@ int main(int argc, char **argv) if (x509_cafile != NULL) { if ((ret=gnutls_certificate_set_x509_trust_file - (cert_cred, x509_cafile, x509_crlfile, x509ctype)) < 0) { + (cert_cred, x509_cafile, x509ctype)) < 0) { fprintf(stderr, "Error reading '%s'\n", x509_cafile); exit(1); } else {