diff options
| -rw-r--r-- | meta/recipes-core/dropbear/dropbear-2013.58/0007-dropbear-fix-for-x32-abi.patch | 140 | ||||
| -rw-r--r-- | meta/recipes-core/dropbear/dropbear.inc | 3 |
2 files changed, 142 insertions, 1 deletions
diff --git a/meta/recipes-core/dropbear/dropbear-2013.58/0007-dropbear-fix-for-x32-abi.patch b/meta/recipes-core/dropbear/dropbear-2013.58/0007-dropbear-fix-for-x32-abi.patch new file mode 100644 index 0000000000..b4501211c3 --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear-2013.58/0007-dropbear-fix-for-x32-abi.patch | |||
| @@ -0,0 +1,140 @@ | |||
| 1 | Upstream-Status: Pending | ||
| 2 | |||
| 3 | The dropbearkey utility built in x32 abi format, when generating ssh | ||
| 4 | keys, was getting lost in the infinite loop. | ||
| 5 | |||
| 6 | This patch fixes the issue by fixing types of variables and | ||
| 7 | parameters of functions used in the code, which were getting | ||
| 8 | undesired size, when compiled with the x32 abi toolchain. | ||
| 9 | |||
| 10 | 2013/05/23 | ||
| 11 | Received this fix from H J Lu. | ||
| 12 | |||
| 13 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
| 14 | |||
| 15 | # HG changeset patch | ||
| 16 | # User H.J. Lu <hjl.tools@gmail.com> | ||
| 17 | # Date 1369344079 25200 | ||
| 18 | # Node ID a10a1c46b857cc8a3923c3bb6d1504aa25b6052f | ||
| 19 | # Parent e76614145aea67f66e4a4257685c771efba21aa1 | ||
| 20 | Typdef mp_digit to unsigned long long for MP_64BIT | ||
| 21 | |||
| 22 | When GCC is used with MP_64BIT, we should typedef mp_digit to unsigned | ||
| 23 | long long instead of unsigned long since for x32, unsigned long is | ||
| 24 | 32-bit and unsigned long long is 64-bit and it is safe to use unsigned | ||
| 25 | long long for 64-bit integer with GCC. | ||
| 26 | |||
| 27 | diff -r e76614145aea -r a10a1c46b857 libtommath/tommath.h | ||
| 28 | --- a/libtommath/tommath.h Thu Apr 18 22:57:47 2013 +0800 | ||
| 29 | +++ b/libtommath/tommath.h Thu May 23 14:21:19 2013 -0700 | ||
| 30 | @@ -73,7 +73,7 @@ | ||
| 31 | typedef signed long long long64; | ||
| 32 | #endif | ||
| 33 | |||
| 34 | - typedef unsigned long mp_digit; | ||
| 35 | + typedef unsigned long long mp_digit; | ||
| 36 | typedef unsigned long mp_word __attribute__ ((mode(TI))); | ||
| 37 | |||
| 38 | #define DIGIT_BIT 60 | ||
| 39 | # HG changeset patch | ||
| 40 | # User H.J. Lu <hjl.tools@gmail.com> | ||
| 41 | # Date 1369344241 25200 | ||
| 42 | # Node ID c7555a4cb7ded3a88409ba85f4027baa7af5f536 | ||
| 43 | # Parent a10a1c46b857cc8a3923c3bb6d1504aa25b6052f | ||
| 44 | Cast to mp_digit when updating *rho | ||
| 45 | |||
| 46 | There is | ||
| 47 | |||
| 48 | int | ||
| 49 | mp_montgomery_setup (mp_int * n, mp_digit * rho) | ||
| 50 | |||
| 51 | We should cast to mp_digit instead of unsigned long when updating | ||
| 52 | *rho since mp_digit may be unsigned long long and unsigned long long | ||
| 53 | may be different from unsigned long, like in x32. | ||
| 54 | |||
| 55 | diff -r a10a1c46b857 -r c7555a4cb7de libtommath/bn_mp_montgomery_setup.c | ||
| 56 | --- a/libtommath/bn_mp_montgomery_setup.c Thu May 23 14:21:19 2013 -0700 | ||
| 57 | +++ b/libtommath/bn_mp_montgomery_setup.c Thu May 23 14:24:01 2013 -0700 | ||
| 58 | @@ -48,7 +48,7 @@ | ||
| 59 | #endif | ||
| 60 | |||
| 61 | /* rho = -1/m mod b */ | ||
| 62 | - *rho = (unsigned long)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK; | ||
| 63 | + *rho = (mp_digit)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK; | ||
| 64 | |||
| 65 | return MP_OKAY; | ||
| 66 | } | ||
| 67 | # HG changeset patch | ||
| 68 | # User H.J. Lu <hjl.tools@gmail.com> | ||
| 69 | # Date 1369344541 25200 | ||
| 70 | # Node ID 7c656e7071a6412688b2f30a529a9afac6c7bf5a | ||
| 71 | # Parent c7555a4cb7ded3a88409ba85f4027baa7af5f536 | ||
| 72 | Define LTC_FAST_TYPE to unsigned long long for __x86_64__ | ||
| 73 | |||
| 74 | We should define LTC_FAST_TYPE to unsigned long long instead of unsigned | ||
| 75 | long if __x86_64__ to support x32 where unsigned long long is 64-bit | ||
| 76 | and unsigned long is 32-bit. | ||
| 77 | |||
| 78 | diff -r c7555a4cb7de -r 7c656e7071a6 libtomcrypt/src/headers/tomcrypt_cfg.h | ||
| 79 | --- a/libtomcrypt/src/headers/tomcrypt_cfg.h Thu May 23 14:24:01 2013 -0700 | ||
| 80 | +++ b/libtomcrypt/src/headers/tomcrypt_cfg.h Thu May 23 14:29:01 2013 -0700 | ||
| 81 | @@ -74,7 +74,7 @@ | ||
| 82 | #define ENDIAN_LITTLE | ||
| 83 | #define ENDIAN_64BITWORD | ||
| 84 | #define LTC_FAST | ||
| 85 | - #define LTC_FAST_TYPE unsigned long | ||
| 86 | + #define LTC_FAST_TYPE unsigned long long | ||
| 87 | #endif | ||
| 88 | |||
| 89 | /* detect PPC32 */ | ||
| 90 | # HG changeset patch | ||
| 91 | # User H.J. Lu <hjl.tools@gmail.com> | ||
| 92 | # Date 1369344730 25200 | ||
| 93 | # Node ID a7d4690158fae4ede2c4e5b56233e83730bf38ee | ||
| 94 | # Parent 7c656e7071a6412688b2f30a529a9afac6c7bf5a | ||
| 95 | Use unsigned long long aas unsigned 64-bit integer for x86-64 GCC | ||
| 96 | |||
| 97 | We should use unsigned long long instead of unsigned long as unsigned | ||
| 98 | 64-bit integer for x86-64 GCC to support x32 where unsigned long is | ||
| 99 | 32-bit. | ||
| 100 | |||
| 101 | diff -r 7c656e7071a6 -r a7d4690158fa libtomcrypt/src/headers/tomcrypt_macros.h | ||
| 102 | --- a/libtomcrypt/src/headers/tomcrypt_macros.h Thu May 23 14:29:01 2013 -0700 | ||
| 103 | +++ b/libtomcrypt/src/headers/tomcrypt_macros.h Thu May 23 14:32:10 2013 -0700 | ||
| 104 | @@ -343,7 +343,7 @@ | ||
| 105 | /* 64-bit Rotates */ | ||
| 106 | #if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(LTC_NO_ASM) | ||
| 107 | |||
| 108 | -static inline unsigned long ROL64(unsigned long word, int i) | ||
| 109 | +static inline unsigned long long ROL64(unsigned long long word, int i) | ||
| 110 | { | ||
| 111 | asm("rolq %%cl,%0" | ||
| 112 | :"=r" (word) | ||
| 113 | @@ -351,7 +351,7 @@ | ||
| 114 | return word; | ||
| 115 | } | ||
| 116 | |||
| 117 | -static inline unsigned long ROR64(unsigned long word, int i) | ||
| 118 | +static inline unsigned long long ROR64(unsigned long long word, int i) | ||
| 119 | { | ||
| 120 | asm("rorq %%cl,%0" | ||
| 121 | :"=r" (word) | ||
| 122 | @@ -361,7 +361,7 @@ | ||
| 123 | |||
| 124 | #ifndef LTC_NO_ROLC | ||
| 125 | |||
| 126 | -static inline unsigned long ROL64c(unsigned long word, const int i) | ||
| 127 | +static inline unsigned long long ROL64c(unsigned long long word, const int i) | ||
| 128 | { | ||
| 129 | asm("rolq %2,%0" | ||
| 130 | :"=r" (word) | ||
| 131 | @@ -369,7 +369,7 @@ | ||
| 132 | return word; | ||
| 133 | } | ||
| 134 | |||
| 135 | -static inline unsigned long ROR64c(unsigned long word, const int i) | ||
| 136 | +static inline unsigned long long ROR64c(unsigned long long word, const int i) | ||
| 137 | { | ||
| 138 | asm("rorq %2,%0" | ||
| 139 | :"=r" (word) | ||
| 140 | |||
diff --git a/meta/recipes-core/dropbear/dropbear.inc b/meta/recipes-core/dropbear/dropbear.inc index 9864ae8186..be93d60595 100644 --- a/meta/recipes-core/dropbear/dropbear.inc +++ b/meta/recipes-core/dropbear/dropbear.inc | |||
| @@ -2,7 +2,7 @@ DESCRIPTION = "Dropbear is a lightweight SSH and SCP implementation" | |||
| 2 | HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html" | 2 | HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html" |
| 3 | SECTION = "console/network" | 3 | SECTION = "console/network" |
| 4 | 4 | ||
| 5 | INC_PR = "r0" | 5 | INC_PR = "r1" |
| 6 | 6 | ||
| 7 | # some files are from other projects and have others license terms: | 7 | # some files are from other projects and have others license terms: |
| 8 | # public domain, OpenSSH 3.5p1, OpenSSH3.6.1p2, PuTTY | 8 | # public domain, OpenSSH 3.5p1, OpenSSH3.6.1p2, PuTTY |
| @@ -19,6 +19,7 @@ SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \ | |||
| 19 | file://0002-static_build_fix.patch \ | 19 | file://0002-static_build_fix.patch \ |
| 20 | file://0003-configure.patch \ | 20 | file://0003-configure.patch \ |
| 21 | file://0004-fix-2kb-keys.patch \ | 21 | file://0004-fix-2kb-keys.patch \ |
| 22 | file://0007-dropbear-fix-for-x32-abi.patch \ | ||
| 22 | file://init \ | 23 | file://init \ |
| 23 | ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} " | 24 | ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} " |
| 24 | 25 | ||
