From: Timo Schulz Date: Mon, 4 Feb 2002 21:39:54 +0000 (+0000) Subject: Now OpenPGP uses its own context for DN. X-Git-Tag: gnutls_0_3_90~113 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=549da7d6bdfb634ea8280f32e61dfbbfbd767669;p=thirdparty%2Fgnutls.git Now OpenPGP uses its own context for DN. --- diff --git a/lib/gnutls_openpgp.c b/lib/gnutls_openpgp.c index 84de435fef..ecebc32d81 100644 --- a/lib/gnutls_openpgp.c +++ b/lib/gnutls_openpgp.c @@ -575,7 +575,7 @@ leave: **/ int gnutls_openpgp_extract_certificate_dn( const gnutls_datum *cert, - gnutls_dn *dn ) + gnutls_openpgp_name *dn ) { PKT pkt = NULL; PKT_userid *uid = NULL; @@ -593,8 +593,9 @@ gnutls_openpgp_extract_certificate_dn( const gnutls_datum *cert, { rc = GNUTLS_E_UNKNOWN_ERROR; goto leave; - } - strcpy( dn->common_name, uid->name ); + } + memset(dn, 0, sizeof *dn); + strcpy( dn->name, uid->name ); /* * Extract the email address from the userID string and save it to diff --git a/lib/gnutls_openpgp.h b/lib/gnutls_openpgp.h index 3ceb67c6ef..6f1987a50e 100644 --- a/lib/gnutls_openpgp.h +++ b/lib/gnutls_openpgp.h @@ -6,7 +6,7 @@ int gnutls_certificate_set_openpgp_key_file( char* CERTFILE, char* KEYFILE); int gnutls_openpgp_extract_certificate_dn( const gnutls_datum *cert, - gnutls_dn *dn); + gnutls_openpgp_name *dn); int gnutls_openpgp_extract_certificate_version( const gnutls_datum *cert ); time_t gnutls_openpgp_extract_certificate_activation_time( const gnutls_datum diff --git a/lib/gnutls_ui.h b/lib/gnutls_ui.h index 78a3a0932f..a6346cfd57 100644 --- a/lib/gnutls_ui.h +++ b/lib/gnutls_ui.h @@ -23,6 +23,11 @@ typedef struct { } gnutls_x509_dn; #define gnutls_DN gnutls_x509_dn +typedef struct { + char name[GNUTLS_X509_CN_SIZE]; + char email[GNUTLS_X509_CN_SIZE]; +} gnutls_openpgp_name; + /* For key Usage, test as: * if (st.keyUsage & X509KEY_DIGITAL_SIGNATURE) ... */