diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-06-30 15:18:19 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-06-30 15:18:19 +0000 |
commit | e55a25f9b7c9c3783cef8bf4a852d59b6b170822 (patch) | |
tree | 51f2d07c4655b3f9fdd2dc84cf21179517bbe21c | |
parent | d2279fcb09f2f8a01aaefd6756370dacc6dbb3d9 (diff) | |
download | gnutls-e55a25f9b7c9c3783cef8bf4a852d59b6b170822.tar.gz |
Made the xml convertion functions more mnemonic. Several other fixes in the core library.
-rw-r--r-- | lib/auth_cert.c | 2 | ||||
-rw-r--r-- | lib/gnutls_cipher.c | 2 | ||||
-rw-r--r-- | lib/gnutls_handshake.c | 4 | ||||
-rw-r--r-- | lib/gnutls_mpi.c | 2 | ||||
-rw-r--r-- | lib/gnutls_mpi.h | 2 | ||||
-rw-r--r-- | lib/gnutls_ui.h | 2 | ||||
-rw-r--r-- | lib/x509_xml.c | 6 | ||||
-rw-r--r-- | libextra/gnutls_openpgp.c | 8 | ||||
-rw-r--r-- | src/common.c | 7 |
9 files changed, 13 insertions, 22 deletions
diff --git a/lib/auth_cert.c b/lib/auth_cert.c index b6f0a0c549..f2c5b7a8c5 100644 --- a/lib/auth_cert.c +++ b/lib/auth_cert.c @@ -1153,7 +1153,7 @@ int _gnutls_proc_cert_client_cert_vrfy(GNUTLS_STATE state, opaque * data, ret = _gnutls_x509_cert2gnutls_cert(&peer_cert, info-> - raw_certificate_list[0], CERT_NO_COPY|CERT_ONLY_PUBKEY); + raw_certificate_list[0], CERT_NO_COPY); break; case GNUTLS_CRT_OPENPGP: if (_E_gnutls_openpgp_cert2gnutls_cert==NULL) { diff --git a/lib/gnutls_cipher.c b/lib/gnutls_cipher.c index 25982edf2e..2740379354 100644 --- a/lib/gnutls_cipher.c +++ b/lib/gnutls_cipher.c @@ -60,7 +60,7 @@ int _gnutls_encrypt(GNUTLS_STATE state, const char* headers, int headers_size, const char *data, size_t data_size, opaque * ciphertext, int ciphertext_size, ContentType type, int random_pad) { - const gnutls_datum plain = { data, data_size }; + const gnutls_datum plain = { (opaque*) data, data_size }; gnutls_datum comp; int ret; int free_comp = 1; diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c index 155985cd3d..c5a3c03bca 100644 --- a/lib/gnutls_handshake.c +++ b/lib/gnutls_handshake.c @@ -814,7 +814,6 @@ static int _gnutls_recv_handshake_header(GNUTLS_STATE state, SSL2_HEADERS); if (ret < 0) { - gnutls_assert(); return (ret < 0) ? ret : GNUTLS_E_UNEXPECTED_PACKET_LENGTH; @@ -962,12 +961,11 @@ int _gnutls_recv_handshake(GNUTLS_STATE state, uint8 ** data, if (ret < 0) { if (ret == GNUTLS_E_UNEXPECTED_HANDSHAKE_PACKET && optional == OPTIONAL_PACKET) { - gnutls_assert(); *datalen = 0; *data = NULL; return 0; /* ok just ignore the packet */ } - gnutls_assert(); + /* gnutls_assert(); */ return ret; } diff --git a/lib/gnutls_mpi.c b/lib/gnutls_mpi.c index f8e6e8c427..62595951bf 100644 --- a/lib/gnutls_mpi.c +++ b/lib/gnutls_mpi.c @@ -54,7 +54,7 @@ int _gnutls_mpi_print_lz( opaque *buffer, size_t *nbytes, const GNUTLS_MPI a ) { * from asn1 structs. Combines the read and mpi_scan * steps. */ -int _gnutls_x509_read_int( ASN1_TYPE node, const char* value, const char* tmpstr, int tmpstr_size, GNUTLS_MPI* ret_mpi) { +int _gnutls_x509_read_int( ASN1_TYPE node, const char* value, char* tmpstr, int tmpstr_size, GNUTLS_MPI* ret_mpi) { int len, result; len = tmpstr_size - 1; diff --git a/lib/gnutls_mpi.h b/lib/gnutls_mpi.h index 2a04816b69..e179168b42 100644 --- a/lib/gnutls_mpi.h +++ b/lib/gnutls_mpi.h @@ -31,7 +31,7 @@ int _gnutls_mpi_scan_pgp( GNUTLS_MPI *ret_mpi, const opaque *buffer, size_t *nby int _gnutls_mpi_print( opaque *buffer, size_t *nbytes, const GNUTLS_MPI a ); int _gnutls_mpi_print_lz( opaque *buffer, size_t *nbytes, const GNUTLS_MPI a ); -int _gnutls_x509_read_int( ASN1_TYPE node, const char* value, const char* tmpstr, int tmpstr_size, MPI* ret_mpi); +int _gnutls_x509_read_int( ASN1_TYPE node, const char* value, char* tmpstr, int tmpstr_size, MPI* ret_mpi); asn1_retCode _gnutls_asn1_create_element(ASN1_TYPE definitions,const char *source_name, ASN1_TYPE *element, const char *dest_name); diff --git a/lib/gnutls_ui.h b/lib/gnutls_ui.h index 83bce69b96..eb0de3e14f 100644 --- a/lib/gnutls_ui.h +++ b/lib/gnutls_ui.h @@ -72,7 +72,7 @@ void gnutls_certificate_server_set_select_function( GNUTLS_STATE, gnutls_certifi void gnutls_certificate_server_set_request( GNUTLS_STATE, GNUTLS_CertificateRequest); /* X.509 certificate handling functions */ -int gnutls_x509_get_certificate_xml(const gnutls_datum * cert, int detail, gnutls_datum* res); +int gnutls_x509_certificate_to_xml(const gnutls_datum * cert, gnutls_datum* res, int detail); int gnutls_x509_extract_dn( const gnutls_datum*, gnutls_x509_dn*); int gnutls_x509_extract_certificate_dn( const gnutls_datum*, gnutls_x509_dn*); diff --git a/lib/x509_xml.c b/lib/x509_xml.c index f327bf9773..62a219e2d4 100644 --- a/lib/x509_xml.c +++ b/lib/x509_xml.c @@ -562,17 +562,17 @@ _gnutls_asn1_get_structure_xml(ASN1_TYPE structure, const char *name, } /** - * gnutls_x509_get_certificate_xml - This function parses an RDN sequence + * gnutls_x509_certificate_to_xml - This function parses an RDN sequence * @cert: should contain a DER encoded certificate - * @detail: The detail level (must be 0 for now) * @res: The datum that will hold the result + * @detail: The detail level (must be 0 for now) * * This function will return the XML structures of the given X.509 certificate. * The XML structures are allocated internaly (with malloc) and stored into res. * Returns a negative error code in case of an error. * **/ -int gnutls_x509_get_certificate_xml(const gnutls_datum * cert, int detail, gnutls_datum* res) +int gnutls_x509_certificate_to_xml(const gnutls_datum * cert, gnutls_datum* res, int detail) { ASN1_TYPE asn1_cert; int result; diff --git a/libextra/gnutls_openpgp.c b/libextra/gnutls_openpgp.c index c4070153d9..c834f1c09f 100644 --- a/libextra/gnutls_openpgp.c +++ b/libextra/gnutls_openpgp.c @@ -1713,17 +1713,17 @@ xml_add_sig( gnutls_datum *xmlkey, int ext, cdkPKT_signature *sig ) } /** - * gnutls_openpgp_get_key_xml - Return a certificate as a XML fragment + * gnutls_openpgp_key_to_xml - Return a certificate as a XML fragment * @cert: the certificate which holds the whole OpenPGP key. - * @ext: extension mode (1/0), 1 means include key signatures and key data. * @xmlkey: he datum struct to store the XML result. + * @ext: extension mode (1/0), 1 means include key signatures and key data. * * This function will return the all OpenPGP key information encapsulated as * a XML string. **/ int -gnutls_openpgp_get_key_xml( const gnutls_datum *cert, int ext, - gnutls_datum *xmlkey ) +gnutls_openpgp_key_to_xml( const gnutls_datum *cert, + gnutls_datum *xmlkey, int ext ) { CDK_KBNODE kb_pk, p; CDK_PACKET *pkt; diff --git a/src/common.c b/src/common.c index a2cda7095d..0238951bfa 100644 --- a/src/common.c +++ b/src/common.c @@ -42,19 +42,12 @@ void print_x509_info(GNUTLS_STATE state) time_t expiret = gnutls_certificate_expiration_time_peers(state); time_t activet = gnutls_certificate_activation_time_peers(state); -// gnutls_datum xml; cert_list = gnutls_certificate_get_peers(state, &cert_list_size); if (cert_list_size <= 0) return; - -//gnutls_x509_get_certificate_xml( &cert_list[0], 0, &xml); -//fprintf(stderr, "%s\n", xml.data); -//return 0; - - printf(" - Certificate info:\n"); printf(" # Certificate is valid since: %s", my_ctime( &activet)); |