mirror of
https://github.com/chris2511/xca.git
synced 2026-09-14 11:06:19 +05:00
Merge branch 'master' of git.hohnstaedt.de:/var/cache/git/xca
This commit is contained in:
commit
c9d476bd8e
@ -48,13 +48,18 @@ void pki_x509super::delRefKey(pki_key *ref)
|
||||
|
||||
void pki_x509super::autoIntName()
|
||||
{
|
||||
int nids[] = { NID_commonName, NID_pkcs9_emailAddress,
|
||||
NID_organizationalUnitName, NID_organizationName, NID_undef };
|
||||
int i;
|
||||
x509name subject = getSubject();
|
||||
QString s;
|
||||
|
||||
s = subject.getEntryByNid(NID_commonName);
|
||||
for (i = 0; nids[i] != NID_undef; i++) {
|
||||
s = subject.getEntryByNid(nids[i]);
|
||||
if (!s.isEmpty())
|
||||
break;
|
||||
}
|
||||
if (s.isEmpty())
|
||||
s = subject.getEntryByNid(NID_pkcs9_emailAddress);
|
||||
if (s.isEmpty())
|
||||
s = subject.getEntry(0);
|
||||
s = subject.getEntry(-1);
|
||||
setIntName(s);
|
||||
}
|
||||
|
||||
@ -84,8 +84,8 @@ QString x509name::getEntryTag(int i) const
|
||||
QString s = QObject::tr("Invalid");
|
||||
ASN1_STRING *d;
|
||||
|
||||
if ( i<0 || i>entryCount() )
|
||||
return s;
|
||||
if (i<0 || i>=entryCount())
|
||||
i = entryCount() - 1;
|
||||
d = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(xn,i));
|
||||
|
||||
if (!d)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user