From ea3775c71fcccf095345292d7ed02b5ea7bbcf93 Mon Sep 17 00:00:00 2001 From: chris2511 Date: Mon, 4 Aug 2003 23:40:39 +0000 Subject: [PATCH] Template changing when creating certificates repaired Import of Templates fixed. --- lib/pki_key.cpp | 5 +++-- lib/pki_pkcs12.cpp | 2 +- lib/pki_temp.cpp | 2 +- ui/MainWindow.ui | 6 +++++- ui/NewX509.ui | 6 +++--- widgets/NewX509.cpp | 19 ++++++++++++++++++- 6 files changed, 31 insertions(+), 9 deletions(-) diff --git a/lib/pki_key.cpp b/lib/pki_key.cpp index 0fa20d2c..d8df5ee9 100644 --- a/lib/pki_key.cpp +++ b/lib/pki_key.cpp @@ -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 { diff --git a/lib/pki_pkcs12.cpp b/lib/pki_pkcs12.cpp index ce7c924f..1fbdde39 100644 --- a/lib/pki_pkcs12.cpp +++ b/lib/pki_pkcs12.cpp @@ -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); diff --git a/lib/pki_temp.cpp b/lib/pki_temp.cpp index 967d3a88..e5b0bf41 100644 --- a/lib/pki_temp.cpp +++ b/lib/pki_temp.cpp @@ -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) { diff --git a/ui/MainWindow.ui b/ui/MainWindow.ui index 6779d36b..b1a735aa 100644 --- a/ui/MainWindow.ui +++ b/ui/MainWindow.ui @@ -12,7 +12,7 @@ 0 0 - 820 + 816 534 @@ -163,6 +163,10 @@ name PushButton33 + + enabled + false + text Change password diff --git a/ui/NewX509.ui b/ui/NewX509.ui index 3e50bf17..c6e91c0f 100644 --- a/ui/NewX509.ui +++ b/ui/NewX509.ui @@ -11,7 +11,7 @@ 0 0 - 579 + 567 590 @@ -2550,7 +2550,7 @@ URI:http://www.my.com/my.crl, URI:http://www.oth.com/my.crl sizeType - Expanding + Minimum sizeHint @@ -2813,7 +2813,7 @@ URI:http://www.my.com/my.crl, URI:http://www.oth.com/my.crl sizeType - Expanding + Minimum sizeHint diff --git a/widgets/NewX509.cpp b/widgets/NewX509.cpp index 40ee0868..9d688761 100644 --- a/widgets/NewX509.cpp +++ b/widgets/NewX509.cpp @@ -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 = "

Subject: " + subn; + issn = "

Issuer: " + issn; + if (!appropriate(page1)) issn = ""; + + v3Extensions->setText( subn + issn + "

" + 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; jsetText(""); + } for ( int i=0; i< n.entryCount(); i++) { int nid = n.nid(i); QStringList sl = n.entryList(i);