gnutls-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gnutls branch, master, updated. gnutls_3_0_4-25-g312c884


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_3_0_4-25-g312c884
Date: Mon, 24 Oct 2011 12:34:37 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=312c884bf5df734f9b672df8ab6459a4af19a4d1

The branch, master has been updated
       via  312c884bf5df734f9b672df8ab6459a4af19a4d1 (commit)
       via  daf232347022a62607f3200daf88e46cc8b13586 (commit)
      from  347ddb46c0b3affc1f696ad0477a3c5fae83472e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 312c884bf5df734f9b672df8ab6459a4af19a4d1
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Mon Oct 24 14:29:11 2011 +0200

    library mismatch error is no longer used

commit daf232347022a62607f3200daf88e46cc8b13586
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Mon Oct 24 13:58:13 2011 +0200

    PHE-partial detection is not being done, instead of checking for VIA nano.

-----------------------------------------------------------------------

Summary of changes:
 lib/accelerated/x86/Makefile.am          |    2 +-
 lib/accelerated/x86/aes-padlock.c        |   24 +++++++++++++-
 lib/accelerated/x86/aes-padlock.h        |    5 ---
 lib/accelerated/x86/asm/padlock-common.s |   53 ------------------------------
 lib/accelerated/x86/sha-padlock.h        |    2 +
 lib/gnutls_global.c                      |    2 +-
 6 files changed, 27 insertions(+), 61 deletions(-)
 delete mode 100644 lib/accelerated/x86/asm/padlock-common.s

diff --git a/lib/accelerated/x86/Makefile.am b/lib/accelerated/x86/Makefile.am
index 8d4bf3b..3530998 100644
--- a/lib/accelerated/x86/Makefile.am
+++ b/lib/accelerated/x86/Makefile.am
@@ -40,7 +40,7 @@ libx86_la_SOURCES = sha-padlock.c hmac-padlock.c aes-x86.c 
aes-padlock.c aes-gcm
 
 if ASM_X86_64
 AM_CFLAGS += -DASM_X86_64 -DASM_X86
-libx86_la_SOURCES += asm/appro-aes-x86-64.s asm/appro-aes-gcm-x86-64.s 
aes-gcm-x86.c asm/padlock-x86-64.s asm/cpuid-x86-64.s asm/padlock-common.s
+libx86_la_SOURCES += asm/appro-aes-x86-64.s asm/appro-aes-gcm-x86-64.s 
aes-gcm-x86.c asm/padlock-x86-64.s asm/cpuid-x86-64.s
 else
 AM_CFLAGS += -DASM_X86_32 -DASM_X86
 libx86_la_SOURCES += asm/appro-aes-x86.s asm/padlock-x86.s asm/cpuid-x86.s
diff --git a/lib/accelerated/x86/aes-padlock.c 
b/lib/accelerated/x86/aes-padlock.c
index 774cc92..5069c20 100644
--- a/lib/accelerated/x86/aes-padlock.c
+++ b/lib/accelerated/x86/aes-padlock.c
@@ -33,6 +33,7 @@
 #include <x86.h>
 #ifdef HAVE_LIBNETTLE
 #include <nettle/aes.h>         /* for key generation in 192 and 256 bits */
+#include <sha-padlock.h>
 #endif
 #include <aes-padlock.h>
 
@@ -191,6 +192,24 @@ check_phe_sha512 (void)
   return ((edx & (0x3 << 25)) == (0x3 << 25));
 }
 
+static int
+check_phe_partial (void)
+{
+  const char* text = "test and test";
+  uint32_t iv[5] = { 0x67452301UL, 0xEFCDAB89UL,
+       0x98BADCFEUL, 0x10325476UL, 0xC3D2E1F0UL };
+
+  padlock_sha1_oneshot (iv, text, sizeof(text)-1);
+  padlock_sha1_oneshot (iv, text, sizeof(text)-1);
+
+  if (iv[0] == 0xdccd6d7eUL && iv[1] == 0xe09319bbUL &&
+      iv[2] == 0x3a23a450UL && iv[3] == 0x4aa6c66cUL &&
+      iv[4] == 0x86715f12UL)
+      return 1;
+  else
+    return 0;
+}
+
 static unsigned
 check_via (void)
 {
@@ -263,10 +282,12 @@ register_padlock_crypto (void)
 #ifdef HAVE_LIBNETTLE
   phe = check_phe ();
 
-  if (is_padlock_nano () && phe)
+  if (check_phe_partial () && phe)
     {
+      _gnutls_debug_log ("Padlock SHA1 and SHA256 (partial) accelerator was 
detected\n");
       if (check_phe_sha512 ())
         {
+          _gnutls_debug_log ("Padlock SHA512 (partial) accelerator was 
detected\n");
           ret =
             gnutls_crypto_single_digest_register (GNUTLS_DIG_SHA384,
                                                   80,
@@ -350,6 +371,7 @@ register_padlock_crypto (void)
     {
       /* Original padlock PHE. Does not support incremental operations.
        */
+      _gnutls_debug_log ("Padlock SHA1 and SHA256 accelerator was detected\n");
       ret =
         gnutls_crypto_single_digest_register (GNUTLS_DIG_SHA1,
                                               80, &sha_padlock_struct);
diff --git a/lib/accelerated/x86/aes-padlock.h 
b/lib/accelerated/x86/aes-padlock.h
index fd5d992..ccb8359 100644
--- a/lib/accelerated/x86/aes-padlock.h
+++ b/lib/accelerated/x86/aes-padlock.h
@@ -38,11 +38,6 @@ int padlock_aes_cipher_setkey(void *_ctx, const void 
*userkey, size_t keysize);
 
 /* asm */
 unsigned int padlock_capability(void);
-#ifdef ASM_X86_64
-unsigned int is_padlock_nano(void);
-#else
-# define is_padlock_nano() 0
-#endif
 void padlock_reload_key(void);
 int padlock_ecb_encrypt(void *out, const void *inp,
                         struct padlock_cipher_data *ctx, size_t len);
diff --git a/lib/accelerated/x86/asm/padlock-common.s 
b/lib/accelerated/x86/asm/padlock-common.s
deleted file mode 100644
index 4f92dc2..0000000
--- a/lib/accelerated/x86/asm/padlock-common.s
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Copyright (C) 2011 Free Software Foundation, Inc.
-#
-# Author: Nikos Mavrogiannopoulos
-#
-# This file is part of GnuTLS.
-#
-# The GnuTLS is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# as published by the Free Software Foundation; either version 3 of
-# the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-.file  "padlock-common.s"
-.text
-.globl is_padlock_nano
-.type  is_padlock_nano,@function
-.align 16
-is_padlock_nano:
-       pushq   %rbp
-       movq    %rsp, %rbp
-       pushq   %rbx
-       xorq    %rax,%rax
-       cpuid
-       movq    $1,%rax
-       cpuid
-       or      $0x000f,%rax
-        cmp     $0x06ff,%rax
-       jne     .Lno_nano
-       popq    %rbx
-       mov     $1,%rax
-       popq    %rbx
-       leave
-        ret
-.Lno_nano:
-       popq    %rbx
-       xorq    %rax,%rax
-       popq    %rbx
-       leave
-        ret
-.size  is_padlock_nano,.-is_padlock_nano
-
-#if defined(__ELF__)
-.section .note.GNU-stack,"",%progbits
-#endif
diff --git a/lib/accelerated/x86/sha-padlock.h 
b/lib/accelerated/x86/sha-padlock.h
index 0f42acf..5d1959a 100644
--- a/lib/accelerated/x86/sha-padlock.h
+++ b/lib/accelerated/x86/sha-padlock.h
@@ -1,6 +1,8 @@
 #ifndef SHA_PADLOCK_H
 # define SHA_PADLOCK_H
 
+#include <nettle/sha.h>
+
 void padlock_sha1_oneshot(void *ctx, const void *inp, size_t len);
 void padlock_sha256_oneshot(void *ctx, const void *inp, size_t len);
 
diff --git a/lib/gnutls_global.c b/lib/gnutls_global.c
index e99f1c1..010e614 100644
--- a/lib/gnutls_global.c
+++ b/lib/gnutls_global.c
@@ -212,7 +212,7 @@ gnutls_global_init (void)
     goto out;
 
   if (gl_sockets_startup (SOCKETS_1_1))
-    return GNUTLS_E_LIBRARY_VERSION_MISMATCH;
+    return gnutls_assert_val(GNUTLS_E_FILE_ERROR);
 
   bindtextdomain (PACKAGE, LOCALEDIR);
 


hooks/post-receive
-- 
GNU gnutls



reply via email to

[Prev in Thread] Current Thread [Next in Thread]