fix build on big endians and with default unsigned char (like s390(x))

epel9
Dan Horák 14 years ago
parent 5a4c6809d2
commit 0a9fa8920f

@ -0,0 +1,11 @@
diff -up ykpers-1.4.1/tests/test_args_to_config.c.bigendian ykpers-1.4.1/tests/test_args_to_config.c
--- ykpers-1.4.1/tests/test_args_to_config.c.bigendian 2011-04-29 17:09:24.000000000 +0200
+++ ykpers-1.4.1/tests/test_args_to_config.c 2011-04-29 17:09:37.000000000 +0200
@@ -86,6 +86,7 @@ void _check_success(int rc, YKP_CONFIG *
/* insert CRC */
ycfg->crc = ~yubikey_crc16 ((unsigned char *) ycfg,
offsetof(struct config_st, crc));
+ ycfg->crc = yk_endian_swap_16(ycfg->crc);
config_matches_expected = ! memcmp(expected, ycfg, sizeof(*ycfg));
if (! config_matches_expected) {

@ -0,0 +1,12 @@
diff -up ykpers-1.4.1/ykpersonalize.c.getopt ykpers-1.4.1/ykpersonalize.c
--- ykpers-1.4.1/ykpersonalize.c.getopt 2011-04-29 16:05:30.000000000 +0200
+++ ykpers-1.4.1/ykpersonalize.c 2011-04-29 16:05:45.000000000 +0200
@@ -205,7 +205,7 @@ int args_to_config(int argc, char **argv
bool *aesviahash,
int *exit_code)
{
- char c;
+ int c;
const char *aeshash = NULL;
bool new_access_code = false;
bool slot_chosen = false;

@ -1,12 +1,14 @@
Name: ykpers Name: ykpers
Version: 1.4.1 Version: 1.4.1
Release: 1%{?dist} Release: 2%{?dist}
Summary: Yubikey personalization program Summary: Yubikey personalization program
Group: Applications/System Group: Applications/System
License: BSD License: BSD
URL: http://code.google.com/p/yubikey-personalization/ URL: http://code.google.com/p/yubikey-personalization/
Source0: http://yubikey-personalization.googlecode.com/files/%{name}-%{version}.tar.gz Source0: http://yubikey-personalization.googlecode.com/files/%{name}-%{version}.tar.gz
Patch0: %{name}-1.4.1-getopt.patch
Patch1: %{name}-1.4.1-bigendian.patch
%ifnarch s390 s390x %ifnarch s390 s390x
BuildRequires: libusb1-devel BuildRequires: libusb1-devel
@ -30,6 +32,8 @@ use ykpers.
%prep %prep
%setup -q %setup -q
%patch0 -p1 -b .getopt
%patch1 -p1 -b .bigendian
%build %build
%configure --disable-static \ %configure --disable-static \
@ -75,6 +79,9 @@ pwd
%exclude %{_libdir}/libykpers-1.la %exclude %{_libdir}/libykpers-1.la
%changelog %changelog
* Fri Apr 29 2011 - Dan Horák <dan[at]danny.cz> - 1.4.1-2
- fix build on big endians and with default unsigned char (like s390(x))
* Tue Feb 6 2011 - Maxim Burgerhout <wzzrd@fedoraproject.org> - 1.4.1-1 * Tue Feb 6 2011 - Maxim Burgerhout <wzzrd@fedoraproject.org> - 1.4.1-1
- Add support for new features in YubiKey 2.2. - Add support for new features in YubiKey 2.2.
- Stricter argument parsing, to help user avoid configuration surprises. - Stricter argument parsing, to help user avoid configuration surprises.

Loading…
Cancel
Save