Template changing when creating certificates repaired

Import of Templates fixed.
This commit is contained in:
chris2511 2003-08-04 23:40:39 +00:00
parent d3e8c3f8dc
commit ea3775c71f
6 changed files with 31 additions and 9 deletions

View File

@ -115,7 +115,7 @@ pki_key::pki_key(const QString fname, pem_password_cb *cb, int type )
{
init();
pass_info p(XCA_TITLE, tr("Please enter the password to decrypt the RSA key.")
+ "'" + fname + "'");
+ "\n'" + fname + "'");
key = EVP_PKEY_new();
key->type = EVP_PKEY_type(type);
FILE *fp = fopen(fname.latin1(), "r");
@ -141,7 +141,8 @@ pki_key::pki_key(const QString fname, pem_password_cb *cb, int type )
ign_openssl_error();
rewind(fp);
p.setTitle(tr("Password for PKCS#8 private key"));
p.setDescription(tr("Please enter the password to decrypt the PKCS#8 private key."));
p.setDescription(tr("Please enter the password to decrypt the PKCS#8 private key.")
+ "\n'" + fname + "'");
d2i_PKCS8PrivateKey_fp(fp, &key, cb, &p);
}
else {

View File

@ -77,7 +77,7 @@ pki_pkcs12::pki_pkcs12(const QString fname, pem_password_cb *cb)
class_name="pki_pkcs12";
certstack = sk_X509_new_null();
pass_info p(XCA_TITLE, tr("Please enter the password to decrypt the PKCS#12 file.")
+ "'" + fname + "'");
+ "\n'" + fname + "'");
fp = fopen(fname, "rb");
if (fp) {
PKCS12 *pkcs12 = d2i_PKCS12_fp(fp, NULL);

View File

@ -272,7 +272,7 @@ void pki_temp::loadTemp(QString fname)
}
if (fread(&size, sizeof(size), 1, fp) != 1)
openssl_error(tr("Template file content error"));
if (size > 65535)
if (size > 65535 || size < 0)
openssl_error(tr("Template file content error"));
p = (unsigned char *)OPENSSL_malloc(size);
if (fread(p, 1, size, fp) != size) {

View File

@ -12,7 +12,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>820</width>
<width>816</width>
<height>534</height>
</rect>
</property>
@ -163,6 +163,10 @@
<name>name</name>
<cstring>PushButton33</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string>Change password</string>

View File

@ -11,7 +11,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>579</width>
<width>567</width>
<height>590</height>
</rect>
</property>
@ -2550,7 +2550,7 @@ URI:http://www.my.com/my.crl, URI:http://www.oth.com/my.crl</string>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
<enum>Minimum</enum>
</property>
<property>
<name>sizeHint</name>
@ -2813,7 +2813,7 @@ URI:http://www.my.com/my.crl, URI:http://www.oth.com/my.crl</string>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
<enum>Minimum</enum>
</property>
<property>
<name>sizeHint</name>

View File

@ -487,7 +487,19 @@ void NewX509::showPage(QWidget *page)
}
if (page == page7) {
v3Extensions->setText(createRequestText());
QString issn, subn;
subn = getX509name().oneLine();
pki_x509 *issuer = getSelectedSigner();
if (issuer)
issn = issuer->getSubject().oneLine();
else
issn = subn;
subn = "<p><b>Subject:</b> " + subn;
issn = "<p><b>Issuer:</b> " + issn;
if (!appropriate(page1)) issn = "";
v3Extensions->setText( subn + issn + "<p>" + createRequestText() );
}
if (page == page4) {
@ -548,6 +560,7 @@ void NewX509::templateChanged(QString tempname)
}
}
#endif
templateChanged();
}
@ -657,6 +670,10 @@ x509name NewX509::getX509name()
void NewX509::setX509name(const x509name &n)
{
int j;
extDNlist->clear();
for ( j = 0; j<EXPLICIT_NAME_CNT; j++) {
name_ptr[j]->setText("");
}
for ( int i=0; i< n.entryCount(); i++) {
int nid = n.nid(i);
QStringList sl = n.entryList(i);