From: Steffen Hansen Date: Mon, 10 Jun 2002 17:53:04 +0000 (+0000) Subject: reorder issuer DN also X-Git-Tag: gpgme-1.2.0@1385~958 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=eb2b04e5201357ecc84e6239fc8b609cfbd1aa46;p=gpgme.git reorder issuer DN also --- diff --git a/trunk/gpgmeplug/gpgmeplug.c b/trunk/gpgmeplug/gpgmeplug.c index f448de3..7b1cc94 100644 --- a/trunk/gpgmeplug/gpgmeplug.c +++ b/trunk/gpgmeplug/gpgmeplug.c @@ -2079,6 +2079,7 @@ struct CertificateInfo* nextCertificate( struct CertIterator* it ) const char* s; unsigned long u; char* names[MAX_GPGME_IDX+1]; + struct DnPair *issuer_dn, *tmp_dn; memset( names, 0, sizeof( names ) ); freeInfo( &(it->info) ); @@ -2109,8 +2110,19 @@ struct CertificateInfo* nextCertificate( struct CertIterator* it ) it->info.fingerprint = make_fingerprint( s ); s = gpgme_key_get_string_attr (key, GPGME_ATTR_ISSUER, 0, 0); - it->info.issuer = xstrdup(s); - + if( s ) { + issuer_dn = tmp_dn = parse_dn( s ); + /*it->info.issuer = xstrdup(s);*/ + it->info.issuer = reorder_dn( issuer_dn ); + while( tmp_dn->key ) { + safe_free( (void**)&issuer_dn->key ); + safe_free( (void**)&issuer_dn->value ); + ++tmp_dn; + } + safe_free( (void**)&issuer_dn ); + } else { + it->info.issuer = NULL; + } s = gpgme_key_get_string_attr (key, GPGME_ATTR_CHAINID, 0, 0); it->info.chainid = xstrdup(s);