Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
Patrick Monnerat
e8be63d8f1 * Mon May 14 2012 Patrick Monnerat <pm@datasphere.ch> 0.9.3-1
- New upstream release.
2012-05-29 16:06:27 +02:00
Patrick Monnerat
9e04adc0a1 * Mon May 7 2012 Patrick Monnerat <pm@datasphere.ch> 0.9.2-1
- New upstream release.
- Patch "french" to update french translation.
2012-05-07 14:10:02 +02:00
Patrick Monnerat
8af1cd627b * Tue Nov 8 2011 Patrick Monnerat <pm@datasphere.ch> 0.9.1-1
- New upstream release: all previous patches included in new code.
2011-11-08 14:19:52 +01:00
10 changed files with 33 additions and 3590 deletions

3
.gitignore vendored
View file

@ -1,3 +1,6 @@
xca-0.8.1.tar.gz
/xca-0.9.0.tar.gz
/README.update
/xca-0.9.1.tar.gz
/xca-0.9.2.tar.gz
/xca-0.9.3.tar.gz

View file

@ -1,2 +0,0 @@
MAKEFILE_COMMON = $(HOME)/.fedora/common.mk
-include $(MAKEFILE_COMMON)

View file

@ -1 +0,0 @@
0.9.0

View file

@ -1,2 +1,2 @@
ff6e23a0aac6a6d9d10b47d3f9856f1a xca-0.9.0.tar.gz
5e08cf8a93f023b1b3836c203bd0a694 xca-0.9.3.tar.gz
113ba37a89fe2de69338fcfe3b773a03 README.update

View file

@ -1,2 +0,0 @@
http://sourceforge.net/project/showfiles.php?group_id=62274
xca-(.*?)\.tar\.

File diff suppressed because it is too large Load diff

View file

@ -1,20 +0,0 @@
diff -Naur xca-0.9.0.orig/lib/main.cpp xca-0.9.0.new/lib/main.cpp
--- xca-0.9.0.orig/lib/main.cpp 2010-08-29 10:28:32.000000000 +0200
+++ xca-0.9.0.new/lib/main.cpp 2011-02-28 13:22:24.083587071 +0100
@@ -40,10 +40,15 @@
locale = QLocale::system().name();
dirs << getPrefix()
+#ifdef XCA_DEFAULT_QT_TRANSLATE
+ << XCA_DEFAULT_QT_TRANSLATE
+#endif
+#ifndef WIN32
<< "/usr/local/share/qt4/translations/"
<< "/usr/share/qt4/translations/"
<< "/usr/share/qt/translations/"
- << ".";
+#endif
+ ;
foreach(QString dir, dirs) {
if (qtTr.load(QString("qt_%1").arg(locale), dir)) {

View file

@ -1,303 +0,0 @@
diff -Naur xca-0.9.0.orig/configure xca-0.9.0.new/configure
--- xca-0.9.0.orig/configure 2010-08-29 10:28:32.000000000 +0200
+++ xca-0.9.0.new/configure 2011-02-28 12:30:48.060564861 +0100
@@ -140,14 +140,12 @@
cat >conftest.c <<EOF
#include <stdio.h>
#include <openssl/opensslv.h>
-//#include <opensc/opensc.h>
+#include <openssl/opensslconf.h>
#include <Qt/qglobal.h>
int main(){
printf("\nThe Versions of the used libraries are:\n\t%s 0x%lxL\n\tQT: %s\n",
-// "\tOpenSC: %s\n",
OPENSSL_VERSION_TEXT, OPENSSL_VERSION_NUMBER, QT_VERSION_STR
-// , sc_get_version()
);
if (QT_VERSION < 0x040300) {
@@ -158,6 +156,12 @@
printf("You need OpenSSL >= 0.9.8 or higher\n");
return 1;
}
+
+#ifdef OPENSSL_NO_EC
+ printf("\n### This OpenSSL installation has no EC cryptography support\n");
+#endif
+
+ puts("\n");
return 0;
}
EOF
diff -Naur xca-0.9.0.orig/lib/pki_evp.cpp xca-0.9.0.new/lib/pki_evp.cpp
--- xca-0.9.0.orig/lib/pki_evp.cpp 2010-08-29 10:28:32.000000000 +0200
+++ xca-0.9.0.new/lib/pki_evp.cpp 2011-02-28 12:25:18.768851651 +0100
@@ -27,9 +27,11 @@
QPixmap *pki_evp::icon[2]= { NULL, NULL };
+#ifndef OPENSSL_NO_EC
EC_builtin_curve *pki_evp::curves = NULL;
size_t pki_evp::num_curves = 0;
unsigned char *pki_evp::curve_flags = NULL;
+#endif
void pki_evp::erasePasswd()
{
@@ -101,7 +103,9 @@
{
RSA *rsakey;
DSA *dsakey;
+#ifndef OPENSSL_NO_EC
EC_KEY *eckey;
+#endif
progress->setMinimum(0);
progress->setMaximum(100);
@@ -122,6 +126,7 @@
if (dsakey)
EVP_PKEY_assign_DSA(key, dsakey);
break;
+#ifndef OPENSSL_NO_EC
case EVP_PKEY_EC:
EC_GROUP *group = EC_GROUP_new_by_curve_name(curve_nid);
if (!group)
@@ -142,6 +147,7 @@
EC_KEY_free(eckey);
EC_GROUP_free(group);
break;
+#endif
}
pki_openssl_error();
encryptKey();
@@ -180,8 +186,10 @@
return key->pkey.rsa->d ? true: false;
case EVP_PKEY_DSA:
return key->pkey.dsa->priv_key ? true: false;
+#ifndef OPENSSL_NO_EC
case EVP_PKEY_EC:
return EC_KEY_get0_private_key(key->pkey.ec) ? true: false;
+#endif
}
return false;
}
@@ -226,6 +234,7 @@
openssl_error(name);
}
+#ifndef OPENSSL_NO_EC
static void search_ec_oid(EC_KEY *ec)
{
const EC_GROUP *ec_group = EC_KEY_get0_group(ec);
@@ -250,6 +259,7 @@
}
}
}
+#endif
void pki_evp::fload(const QString fname)
{
@@ -311,8 +321,10 @@
throw errorEx(tr("Unable to load the private key in file %1. Tried PEM and DER private, public and PKCS#8 key types.").arg(fname));
}
if (pkey){
+#ifndef OPENSSL_NO_EC
if (pkey->type == EVP_PKEY_EC)
search_ec_oid(pkey->pkey.ec);
+#endif
if (key)
EVP_PKEY_free(key);
key = pkey;
@@ -659,7 +671,9 @@
switch (key->type) {
case EVP_PKEY_RSA: md = EVP_sha1(); break;
case EVP_PKEY_DSA: md = EVP_dss1(); break;
+#ifndef OPENSSL_NO_EC
case EVP_PKEY_EC: md = EVP_ecdsa(); break;
+#endif
default: md = NULL; break;
}
return md;
diff -Naur xca-0.9.0.orig/lib/pki_evp.h xca-0.9.0.new/lib/pki_evp.h
--- xca-0.9.0.orig/lib/pki_evp.h 2010-08-29 10:28:32.000000000 +0200
+++ xca-0.9.0.new/lib/pki_evp.h 2011-02-28 12:25:18.769851580 +0100
@@ -37,9 +37,11 @@
static void setOldPasswd(const char *pass);
static QString md5passwd(const char *pass);
static QString sha512passwd(QString pass, QString salt);
+#ifndef OPENSSL_NO_EC
static EC_builtin_curve *curves;
static size_t num_curves;
static unsigned char *curve_flags;
+#endif
void generate(int bits, int type, QProgressBar *progress);
void generate(int bits, int type, QProgressBar *progress,
diff -Naur xca-0.9.0.orig/lib/pki_key.cpp xca-0.9.0.new/lib/pki_key.cpp
--- xca-0.9.0.orig/lib/pki_key.cpp 2010-08-29 10:28:32.000000000 +0200
+++ xca-0.9.0.new/lib/pki_key.cpp 2011-02-28 12:25:18.769851580 +0100
@@ -210,6 +210,7 @@
return QString();
}
+#ifndef OPENSSL_NO_EC
int pki_key::ecParamNid()
{
if (key->type != EVP_PKEY_EC)
@@ -232,6 +233,7 @@
}
return pub;
}
+#endif
bool pki_key::compare(pki_base *ref)
{
diff -Naur xca-0.9.0.orig/lib/pki_scard.cpp xca-0.9.0.new/lib/pki_scard.cpp
--- xca-0.9.0.orig/lib/pki_scard.cpp 2010-08-29 10:28:32.000000000 +0200
+++ xca-0.9.0.new/lib/pki_scard.cpp 2011-02-28 12:36:50.761408182 +0100
@@ -113,6 +113,7 @@
EVP_PKEY_assign_DSA(pkey, dsa);
break;
}
+#ifndef OPENSSL_NO_EC
case CKK_EC: {
EC_KEY *ec = EC_KEY_new();
@@ -137,6 +138,7 @@
EVP_PKEY_assign_EC_KEY(pkey, ec);
break;
}
+#endif
default:
throw errorEx(QString("Unsupported CKA_KEY_TYPE: %1\n").arg(keytype));
}
@@ -368,7 +370,9 @@
switch (mech_list[i]) {
case CKM_MD5_RSA_PKCS: nids << NID_md5; break;
case CKM_DSA_SHA1:
+#ifndef OPENSSL_NO_EC
case CKM_ECDSA_SHA1:
+#endif
case CKM_SHA1_RSA_PKCS: nids << NID_sha1; break;
case CKM_SHA256_RSA_PKCS: nids << NID_sha256; break;
case CKM_SHA384_RSA_PKCS: nids << NID_sha384; break;
@@ -389,8 +393,10 @@
return EVP_sha1();
if (mech_list.contains(CKM_DSA_SHA1))
return EVP_dss1();
+#ifndef OPENSSL_NO_EC
if (mech_list.contains(CKM_ECDSA_SHA1))
return EVP_ecdsa();
+#endif
if (mech_list.contains(CKM_SHA512_RSA_PKCS))
return EVP_sha512();
if (mech_list.contains(CKM_SHA384_RSA_PKCS))
diff -Naur xca-0.9.0.orig/widgets/hashBox.cpp xca-0.9.0.new/widgets/hashBox.cpp
--- xca-0.9.0.orig/widgets/hashBox.cpp 2010-08-29 10:28:32.000000000 +0200
+++ xca-0.9.0.new/widgets/hashBox.cpp 2011-02-28 12:25:18.769851580 +0100
@@ -40,8 +40,10 @@
switch(key_type) {
case EVP_PKEY_DSA:
return EVP_dss1();
+#ifndef OPENSSL_NO_EC
case EVP_PKEY_EC:
return EVP_ecdsa();
+#endif
default:
QString hash = currentText();
for (unsigned i=0; i<ARRAY_SIZE(hashalgos); i++) {
diff -Naur xca-0.9.0.orig/widgets/KeyDetail.cpp xca-0.9.0.new/widgets/KeyDetail.cpp
--- xca-0.9.0.orig/widgets/KeyDetail.cpp 2010-08-29 10:28:32.000000000 +0200
+++ xca-0.9.0.new/widgets/KeyDetail.cpp 2011-02-28 12:25:18.770851497 +0100
@@ -25,6 +25,7 @@
keyDesc->setReadOnly(true);
}
+#ifndef OPENSSL_NO_EC
static QString CurveComment(int nid)
{
for (size_t i=0; i<pki_evp::num_curves; i++) {
@@ -33,6 +34,7 @@
}
return QString();
}
+#endif
void KeyDetail::setKey(pki_key *key)
{
@@ -74,6 +76,7 @@
keyPubEx->setText(key->subprime());
keyModulus->setText(key->pubkey());
break;
+#ifndef OPENSSL_NO_EC
case EVP_PKEY_EC:
nid = key->ecParamNid();
tlModulus->setText(tr("Public key"));
@@ -83,6 +86,7 @@
keyPubEx->setToolTip(CurveComment(nid));
keyModulus->setText(key->ecPubKey());
break;
+#endif
default:
tlHeader->setText(tr("Unknown key"));
}
diff -Naur xca-0.9.0.orig/widgets/MainWindow.cpp xca-0.9.0.new/widgets/MainWindow.cpp
--- xca-0.9.0.orig/widgets/MainWindow.cpp 2010-08-29 10:28:32.000000000 +0200
+++ xca-0.9.0.new/widgets/MainWindow.cpp 2011-02-28 12:39:47.453229550 +0100
@@ -99,6 +99,7 @@
NID_secp521r1
};
+#ifndef OPENSSL_NO_EC
static void init_curves()
{
pki_evp::num_curves = EC_get_builtin_curves(NULL, 0);
@@ -130,6 +131,7 @@
}
}
}
+#endif
void MainWindow::enableTokenMenu(bool enable)
{
@@ -185,7 +187,9 @@
init_images();
homedir = getHomeDir();
+#ifndef OPENSSL_NO_EC
init_curves();
+#endif
#ifdef MDEBUG
CRYPTO_malloc_debug_init();
diff -Naur xca-0.9.0.orig/widgets/NewKey.cpp xca-0.9.0.new/widgets/NewKey.cpp
--- xca-0.9.0.orig/widgets/NewKey.cpp 2010-08-29 10:28:32.000000000 +0200
+++ xca-0.9.0.new/widgets/NewKey.cpp 2011-02-28 12:25:18.770851497 +0100
@@ -24,7 +24,9 @@
static const struct typelist typeList[] = {
{ "RSA", EVP_PKEY_RSA },
{ "DSA", EVP_PKEY_DSA },
+#ifndef OPENSSL_NO_EC
{ "EC", EVP_PKEY_EC },
+#endif
};
class keyListItem
@@ -98,6 +100,7 @@
keytypes << gk;
}
+#ifndef OPENSSL_NO_EC
for (i = 0; i<pki_evp::num_curves; i++) {
const char *desc = pki_evp::curves[i].comment;
const char *sn = OBJ_nid2sn(pki_evp::curves[i].nid);
@@ -115,6 +118,8 @@
}
curveBox->addItems(curve_x962);
curveBox->addItems(curve_other);
+#endif
+
keyLength->setCurrentIndex(0);
keyDesc->setFocus();
if (pkcs11::loaded()) try {

12
xca-0.9.3-french.patch Normal file
View file

@ -0,0 +1,12 @@
diff -Naur xca-0.9.3.orig/lang/fr.po xca-0.9.3.new/lang/fr.po
--- xca-0.9.3.orig/lang/fr.po 2012-05-12 11:37:14.000000000 +0200
+++ xca-0.9.3.new/lang/fr.po 2012-05-14 14:33:27.386075980 +0200
@@ -1883,7 +1883,7 @@
#: PwDialog#2
msgid ""
-"The password is parsed as 2-digit hex code. It must have an equal number of "
+"The password is parsed as 2-digit hex code. It must have an even number of "
"digits (0-9 and a-f)"
msgstr ""
"Le mot de passe doit être exprimé sous forme d'une suite de chiffres "

View file

@ -2,17 +2,15 @@
Summary: Graphical X.509 certificate management tool
Name: xca
Version: 0.9.0
Release: %release_func 2
Version: 0.9.3
Release: %release_func 1
License: BSD
Group: Applications/Productivity
URL: http://www.hohnstaedt.de/xca.html
Source0: http://downloads.sourceforge.net/sourceforge/xca/%{name}-%{version}.tar.gz
Source1: README.update
Patch1: xca-0.9.0-locale.patch
Patch2: xca-0.9.0-noec.patch
Patch3: xca-0.9.0-french.patch
Patch1: xca-0.9.3-french.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: qt4-devel openssl-devel
BuildRequires: xdg-utils
@ -41,9 +39,8 @@ format, portable across operating systems.
%prep
%setup -q
%patch1 -p 1 -b .locale
%patch2 -p 1 -b .noec
%patch3 -p 1 -b .french
%patch1 -p 1 -b .french
mkdir -p _tmp_root/usr
ln -s "/usr/%{_lib}" _tmp_root/usr/lib
@ -52,8 +49,6 @@ ln -s "%{_includedir}/Qt" _tmp_root/include
install -p -m 644 "%{SOURCE1}" ./
sed -i -e 's!^Exec=.*!\0 %%F!' misc/xca.desktop
%build
#test -n "${QTDIR}" || . "%{_sysconfdir}/profile.d/qt.sh"
@ -79,7 +74,7 @@ mv AUTHORS.utf8 AUTHORS
rm -rf "${RPM_BUILD_ROOT}"
make destdir="${RPM_BUILD_ROOT}" mandir=share/man install
make destdir="${RPM_BUILD_ROOT}" mandir=share/man install -C misc TOPDIR=..
make destdir="${RPM_BUILD_ROOT}" mandir=share/man install.misc
# HACK: check whether workarounds below are still necessary
if test ! -e "${RPM_BUILD_ROOT}%{_datadir}/xca/crl.png"
@ -139,6 +134,7 @@ gtk-update-icon-cache "%{_datadir}/icons/hicolor" &> /dev/null || :
%lang(es) %{_datadir}/xca/xca_es.qm
%lang(fr) %{_datadir}/xca/xca_fr.qm
%lang(ru) %{_datadir}/xca/xca_ru.qm
%lang(tr) %{_datadir}/xca/xca_tr.qm
%{_datadir}/pixmaps/*.xpm
%{_datadir}/icons/*/*/*/*.png
%{_datadir}/mime/packages/%{name}.*
@ -147,6 +143,16 @@ gtk-update-icon-cache "%{_datadir}/icons/hicolor" &> /dev/null || :
%changelog
* Mon May 14 2012 Patrick Monnerat <pm@datasphere.ch> 0.9.3-1
- New upstream release.
* Mon May 7 2012 Patrick Monnerat <pm@datasphere.ch> 0.9.2-1
- New upstream release.
- Patch "french" to update french translation.
* Tue Nov 8 2011 Patrick Monnerat <pm@datasphere.ch> 0.9.1-1
- New upstream release: all previous patches included in new code.
* Mon Feb 28 2011 Patrick Monnerat <pm@datasphere.ch> 0.9.0-2
- Fix Exec parameter in desktop file.