From a79f55e03325d2294bcc475dc7a7a55a3c910e9c Mon Sep 17 00:00:00 2001 From: Alex Hornung Date: Fri, 20 Aug 2010 21:09:52 +0100 Subject: [PATCH] padlock - get rid of __GNUCLIKE_ASM #ifdefs * Remove the uses of __GNUCLIKE_ASM, as we don't define it and in any case it only causes problems. * If it wasn't defined, it would cause encryption to succeed but without encrypting anything, potentially leaking private information. Since on DragonFly this define doesn't exist, this would always be the case. Reported-by: Jan Lentfer (lentferj@) Dragonfly-bug: http://bugs.dragonflybsd.org/issue1638 --- sys/crypto/via/padlock_cipher.c | 2 -- sys/crypto/via/padlock_hash.c | 4 ---- 2 files changed, 6 deletions(-) diff --git a/sys/crypto/via/padlock_cipher.c b/sys/crypto/via/padlock_cipher.c index 831187ce38..6ebd75598c 100644 --- a/sys/crypto/via/padlock_cipher.c +++ b/sys/crypto/via/padlock_cipher.c @@ -80,7 +80,6 @@ static __inline void padlock_cbc(void *in, void *out, size_t count, void *key, union padlock_cw *cw, void *iv) { -#ifdef __GNUCLIKE_ASM /* The .byte line is really VIA C3 "xcrypt-cbc" instruction */ __asm __volatile( "pushf \n\t" @@ -91,7 +90,6 @@ padlock_cbc(void *in, void *out, size_t count, void *key, union padlock_cw *cw, : "b" (key), "d" (cw) : "cc", "memory" ); -#endif } static void diff --git a/sys/crypto/via/padlock_hash.c b/sys/crypto/via/padlock_hash.c index dfba0172fa..b8741da57b 100644 --- a/sys/crypto/via/padlock_hash.c +++ b/sys/crypto/via/padlock_hash.c @@ -115,13 +115,11 @@ padlock_do_sha1(const u_char *in, u_char *out, int count) ((uint32_t *)result)[3] = 0x10325476; ((uint32_t *)result)[4] = 0xC3D2E1F0; -#ifdef __GNUCLIKE_ASM __asm __volatile( ".byte 0xf3, 0x0f, 0xa6, 0xc8" /* rep xsha1 */ : "+S"(in), "+D"(result) : "c"(count), "a"(0) ); -#endif padlock_output_block((uint32_t *)result, (uint32_t *)out, SHA1_HASH_LEN / sizeof(uint32_t)); @@ -142,13 +140,11 @@ padlock_do_sha256(const char *in, char *out, int count) ((uint32_t *)result)[6] = 0x1F83D9AB; ((uint32_t *)result)[7] = 0x5BE0CD19; -#ifdef __GNUCLIKE_ASM __asm __volatile( ".byte 0xf3, 0x0f, 0xa6, 0xd0" /* rep xsha256 */ : "+S"(in), "+D"(result) : "c"(count), "a"(0) ); -#endif padlock_output_block((uint32_t *)result, (uint32_t *)out, SHA2_256_HASH_LEN / sizeof(uint32_t)); -- 2.41.0