Source-Changes-HG archive

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

[src/trunk]: src merge



details:   https://anonhg.NetBSD.org/src/rev/44a80aa6abaf
branches:  trunk
changeset: 765781:44a80aa6abaf
user:      spz <spz%NetBSD.org@localhost>
date:      Sun Jun 05 23:09:44 2011 +0000

description:
merge
It builds, which is an improvement to before. It may not work.
AES-NI is disabled and needs to be retrofitted yet

diffstat:

 crypto/external/bsd/openssl/dist/apps/speed.c                           |   55 +-
 crypto/external/bsd/openssl/dist/crypto/bio/b_sock.c                    |   66 +-
 crypto/external/bsd/openssl/dist/crypto/bio/bss_file.c                  |   53 +-
 crypto/external/bsd/openssl/dist/crypto/bio/bss_log.c                   |   32 +-
 crypto/external/bsd/openssl/dist/crypto/bn/bn_mont.c                    |    2 +-
 crypto/external/bsd/openssl/dist/crypto/cast/cast.h                     |    4 +-
 crypto/external/bsd/openssl/dist/crypto/cms/cms_pwri.c                  |  453 ----------
 crypto/external/bsd/openssl/dist/crypto/conf/conf_def.c                 |   13 +-
 crypto/external/bsd/openssl/dist/crypto/crypto.h                        |   34 +-
 crypto/external/bsd/openssl/dist/crypto/des/des.h                       |    3 +
 crypto/external/bsd/openssl/dist/crypto/dso/dso_dlfcn.c                 |    4 +
 crypto/external/bsd/openssl/dist/crypto/engine/Makefile                 |   21 +-
 crypto/external/bsd/openssl/dist/crypto/engine/eng_aesni.c              |    8 +-
 crypto/external/bsd/openssl/dist/crypto/engine/eng_all.c                |   14 +-
 crypto/external/bsd/openssl/dist/crypto/engine/eng_cryptodev.c          |   41 +-
 crypto/external/bsd/openssl/dist/crypto/engine/engine.h                 |   17 +-
 crypto/external/bsd/openssl/dist/crypto/evp/m_sha1.c                    |    5 +
 crypto/external/bsd/openssl/dist/crypto/idea/i_skey.c                   |    8 +
 crypto/external/bsd/openssl/dist/crypto/idea/idea.h                     |    3 +
 crypto/external/bsd/openssl/dist/crypto/md32_common.h                   |   21 +-
 crypto/external/bsd/openssl/dist/crypto/md4/md4.h                       |    3 +
 crypto/external/bsd/openssl/dist/crypto/md4/md4_dgst.c                  |    5 +-
 crypto/external/bsd/openssl/dist/crypto/md5/md5.h                       |    3 +
 crypto/external/bsd/openssl/dist/crypto/md5/md5_dgst.c                  |    3 +-
 crypto/external/bsd/openssl/dist/crypto/opensslv.h                      |    8 +-
 crypto/external/bsd/openssl/dist/crypto/rand/randfile.c                 |   23 +-
 crypto/external/bsd/openssl/dist/crypto/rc2/rc2.h                       |    4 +-
 crypto/external/bsd/openssl/dist/crypto/rc5/rc5_locl.h                  |    4 +-
 crypto/external/bsd/openssl/dist/crypto/ripemd/ripemd.h                 |    3 +
 crypto/external/bsd/openssl/dist/crypto/ripemd/rmd_dgst.c               |    3 +-
 crypto/external/bsd/openssl/dist/crypto/rsa/rsa_eay.c                   |    2 +-
 crypto/external/bsd/openssl/dist/crypto/sha/sha.h                       |   14 +
 crypto/external/bsd/openssl/dist/crypto/sha/sha256.c                    |    4 +-
 crypto/external/bsd/openssl/dist/crypto/sha/sha_locl.h                  |    6 +-
 crypto/external/bsd/openssl/dist/doc/apps/tsget.pod                     |    8 +-
 crypto/external/bsd/openssl/dist/ssl/s23_clnt.c                         |   48 +-
 crypto/external/bsd/openssl/dist/ssl/s3_clnt.c                          |  352 ++++++-
 crypto/external/bsd/openssl/dist/ssl/s3_enc.c                           |   27 +-
 crypto/external/bsd/openssl/dist/ssl/s3_lib.c                           |  442 +++++++++-
 crypto/external/bsd/openssl/dist/ssl/s3_pkt.c                           |   18 +-
 crypto/external/bsd/openssl/dist/ssl/s3_srvr.c                          |  425 ++++++++-
 crypto/external/bsd/openssl/dist/ssl/ssl_ciph.c                         |   53 +-
 crypto/external/bsd/openssl/dist/ssl/ssl_locl.h                         |   27 +-
 crypto/external/bsd/openssl/dist/ssl/ssltest.c                          |  144 ++-
 crypto/external/bsd/openssl/dist/ssl/t1_enc.c                           |  243 +++-
 crypto/external/bsd/openssl/dist/ssl/t1_lib.c                           |  403 ++++++++-
 crypto/external/bsd/openssl/lib/libcrypto/arch/i386/Makefile            |    4 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/i386/aes-586.S           |    3 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/i386/bn-586.S            |    2 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/i386/co-586.S            |    2 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/i386/des-586.S           |   16 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/i386/md5-586.S           |    2 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/i386/rmd-586.S           |    2 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/i386/x86.S               |    2 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/Makefile         |    4 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/aes-ppc.S        |  281 +++---
 crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/ppc.S            |    2 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/ppccpuid.S       |    3 +
 crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/sha1-ppc.S       |    1 +
 crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/sha512-ppc.S     |    1 +
 crypto/external/bsd/openssl/lib/libcrypto/arch/sparc64/Makefile         |    4 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/sparc64/aes-sparcv9.S    |   24 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/sparc64/sha1-sparcv9.S   |    1 +
 crypto/external/bsd/openssl/lib/libcrypto/arch/sparc64/sha512-sparcv9.S |    3 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64/Makefile          |    4 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64/aes-x86_64.S      |  227 ++--
 crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64/md5-x86_64.S      |  111 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64/rc4-x86_64.S      |   30 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64/sha1-x86_64.S     |   98 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64/sha512-x86_64.S   |   29 +-
 crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64/wp-x86_64.S       |   35 +-
 crypto/external/bsd/openssl/lib/libcrypto/cmac.inc                      |   14 +
 crypto/external/bsd/openssl/lib/libcrypto/cms.inc                       |    4 +-
 crypto/external/bsd/openssl/lib/libcrypto/engine.inc                    |   14 +-
 crypto/external/bsd/openssl/lib/libcrypto/shlib_version                 |    4 +-
 crypto/external/bsd/openssl/lib/libcrypto/srp.inc                       |   14 +
 crypto/external/bsd/openssl/lib/libssl/shlib_version                    |    4 +-
 distrib/sets/lists/base/ad.mips64eb                                     |    6 +-
 distrib/sets/lists/base/ad.mips64el                                     |    6 +-
 distrib/sets/lists/base/md.amd64                                        |    6 +-
 distrib/sets/lists/base/md.sparc64                                      |    6 +-
 distrib/sets/lists/base/shl.mi                                          |    6 +-
 82 files changed, 2840 insertions(+), 1267 deletions(-)

diffs (truncated from 7959 to 300 lines):

diff -r 14f8e9858024 -r 44a80aa6abaf crypto/external/bsd/openssl/dist/apps/speed.c
--- a/crypto/external/bsd/openssl/dist/apps/speed.c     Sun Jun 05 23:09:15 2011 +0000
+++ b/crypto/external/bsd/openssl/dist/apps/speed.c     Sun Jun 05 23:09:44 2011 +0000
@@ -184,12 +184,27 @@
 #include <openssl/ecdh.h>
 #endif
 
-#if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_NETWARE)
-# define NO_FORK 1
-#elif HAVE_FORK
-# undef NO_FORK
+#ifdef OPENSSL_FIPS
+#define BF_set_key     private_BF_set_key
+#define CAST_set_key   private_CAST_set_key
+#define idea_set_encrypt_key   private_idea_set_encrypt_key
+#define SEED_set_key   private_SEED_set_key
+#define RC2_set_key    private_RC2_set_key
+#define DES_set_key_unchecked  private_DES_set_key_unchecked
+#endif
+
+#ifndef HAVE_FORK
+# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_NETWARE)
+#  define HAVE_FORK 0
+# else
+#  define HAVE_FORK 1
+# endif
+#endif
+
+#if HAVE_FORK
+#undef NO_FORK
 #else
-# define NO_FORK 1
+#define NO_FORK
 #endif
 
 #undef BUFSIZE
@@ -226,8 +241,12 @@
   "aes-128 ige","aes-192 ige","aes-256 ige"};
 static double results[ALGOR_NUM][SIZE_NUM];
 static int lengths[SIZE_NUM]={16,64,256,1024,8*1024};
+#ifndef OPENSSL_NO_RSA
 static double rsa_results[RSA_NUM][2];
+#endif
+#ifndef OPENSSL_NO_DSA
 static double dsa_results[DSA_NUM][2];
+#endif
 #ifndef OPENSSL_NO_ECDSA
 static double ecdsa_results[EC_NUM][2];
 #endif
@@ -324,9 +343,6 @@
 
 int MAIN(int argc, char **argv)
        {
-#ifndef OPENSSL_NO_ENGINE
-       ENGINE *e = NULL;
-#endif
        unsigned char *buf=NULL,*buf2=NULL;
        int mret=1;
        long count=0,save_count=0;
@@ -420,7 +436,6 @@
        unsigned char DES_iv[8];
        unsigned char iv[2*MAX_BLOCK_SIZE/8];
 #ifndef OPENSSL_NO_DES
-       DES_cblock *buf_as_des_cblock = NULL;
        static DES_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0};
        static DES_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12};
        static DES_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34};
@@ -634,9 +649,6 @@
                BIO_printf(bio_err,"out of memory\n");
                goto end;
                }
-#ifndef OPENSSL_NO_DES
-       buf_as_des_cblock = (DES_cblock *)buf;
-#endif
        if ((buf2=(unsigned char *)OPENSSL_malloc((int)BUFSIZE)) == NULL)
                {
                BIO_printf(bio_err,"out of memory\n");
@@ -711,7 +723,7 @@
                                BIO_printf(bio_err,"no engine given\n");
                                goto end;
                                }
-                        e = setup_engine(bio_err, *argv, 0);
+                        setup_engine(bio_err, *argv, 0);
                        /* j will be increased again further down.  We just
                           don't want speed to confuse an engine with an
                           algorithm, especially when none is given (which
@@ -1227,7 +1239,8 @@
                count*=2;
                Time_F(START);
                for (it=count; it; it--)
-                       DES_ecb_encrypt(buf_as_des_cblock,buf_as_des_cblock,
+                       DES_ecb_encrypt((DES_cblock *)buf,
+                               (DES_cblock *)buf,
                                &sch,DES_ENCRYPT);
                d=Time_F(STOP);
                } while (d <3);
@@ -2604,7 +2617,11 @@
        fds=malloc(multi*sizeof *fds);
        for(n=0 ; n < multi ; ++n)
                {
-               pipe(fd);
+               if (pipe(fd) == -1)
+                       {
+                       fprintf(stderr, "pipe failure\n");
+                       exit(1);
+                       }
                fflush(stdout);
                fflush(stderr);
                if(fork())
@@ -2616,7 +2633,11 @@
                        {
                        close(fd[0]);
                        close(1);
-                       dup(fd[1]);
+                       if (dup(fd[1]) == -1)
+                               {
+                               fprintf(stderr, "dup failed\n");
+                               exit(1);
+                               }
                        close(fd[1]);
                        mr=1;
                        usertime=0;
@@ -2699,6 +2720,7 @@
                                else
                                        rsa_results[k][1]=d;
                                }
+#ifndef OPENSSL_NO_DSA
                        else if(!strncmp(buf,"+F3:",4))
                                {
                                int k;
@@ -2720,6 +2742,7 @@
                                else
                                        dsa_results[k][1]=d;
                                }
+#endif
 #ifndef OPENSSL_NO_ECDSA
                        else if(!strncmp(buf,"+F4:",4))
                                {
diff -r 14f8e9858024 -r 44a80aa6abaf crypto/external/bsd/openssl/dist/crypto/bio/b_sock.c
--- a/crypto/external/bsd/openssl/dist/crypto/bio/b_sock.c      Sun Jun 05 23:09:15 2011 +0000
+++ b/crypto/external/bsd/openssl/dist/crypto/bio/b_sock.c      Sun Jun 05 23:09:44 2011 +0000
@@ -88,6 +88,17 @@
 static int wsa_init_done=0;
 #endif
 
+/*
+ * WSAAPI specifier is required to make indirect calls to run-time
+ * linked WinSock 2 functions used in this module, to be specific
+ * [get|free]addrinfo and getnameinfo. This is because WinSock uses
+ * uses non-C calling convention, __stdcall vs. __cdecl, on x86
+ * Windows. On non-WinSock platforms WSAAPI needs to be void.
+ */
+#ifndef WSAAPI
+#define WSAAPI
+#endif
+
 #if 0
 static unsigned long BIO_ghbn_hits=0L;
 static unsigned long BIO_ghbn_miss=0L;
@@ -540,7 +551,30 @@
 #ifdef __DJGPP__
        i=ioctlsocket(fd,type,(char *)arg);
 #else
-       i=ioctlsocket(fd,type,arg);
+# if defined(OPENSSL_SYS_VMS)
+       /* 2011-02-18 SMS.
+        * VMS ioctl() can't tolerate a 64-bit "void *arg", but we
+        * observe that all the consumers pass in an "unsigned long *",
+        * so we arrange a local copy with a short pointer, and use
+        * that, instead.
+        */
+#  if __INITIAL_POINTER_SIZE == 64
+#   define ARG arg_32p
+#   pragma pointer_size save
+#   pragma pointer_size 32
+       unsigned long arg_32;
+       unsigned long *arg_32p;
+#   pragma pointer_size restore
+       arg_32p = &arg_32;
+       arg_32 = *((unsigned long *) arg);
+#  else /* __INITIAL_POINTER_SIZE == 64 */
+#   define ARG arg
+#  endif /* __INITIAL_POINTER_SIZE == 64 [else] */
+# else /* defined(OPENSSL_SYS_VMS) */
+#  define ARG arg
+# endif /* defined(OPENSSL_SYS_VMS) [else] */
+
+       i=ioctlsocket(fd,type,ARG);
 #endif /* __DJGPP__ */
        if (i < 0)
                SYSerr(SYS_F_IOCTLSOCKET,get_last_socket_error());
@@ -595,7 +629,7 @@
                struct sockaddr_in6 sa_in6;
 #endif
        } server,client;
-       int s=INVALID_SOCKET,cs;
+       int s=INVALID_SOCKET,cs,addrlen;
        unsigned char ip[4];
        unsigned short port;
        char *str=NULL,*e;
@@ -627,12 +661,12 @@
 #ifdef EAI_FAMILY
        do {
        static union {  void *p;
-                       int (*f)(const char *,const char *,
+                       int (WSAAPI *f)(const char *,const char *,
                                 const struct addrinfo *,
                                 struct addrinfo **);
                        } p_getaddrinfo = {NULL};
        static union {  void *p;
-                       void (*f)(struct addrinfo *);
+                       void (WSAAPI *f)(struct addrinfo *);
                        } p_freeaddrinfo = {NULL};
        struct addrinfo *res,hint;
 
@@ -649,6 +683,7 @@
         * note that commonly IPv6 wildchard socket can service
         * IPv4 connections just as well...  */
        memset(&hint,0,sizeof(hint));
+       hint.ai_flags = AI_PASSIVE;
        if (h)
                {
                if (strchr(h,':'))
@@ -661,15 +696,20 @@
 #endif
                        }
                else if (h[0]=='*' && h[1]=='\0')
+                       {
+                       hint.ai_family = AF_INET;
                        h=NULL;
+                       }
                }
        /* XXX: below we cast to sockaddr_in! */
        hint.ai_family = AF_INET;
 
        if ((*p_getaddrinfo.f)(h,p,&hint,&res)) break;
 
-       memcpy(&server, res->ai_addr,
-               res->ai_addrlen<=sizeof(server)?res->ai_addrlen:sizeof(server));
+       addrlen = res->ai_addrlen<=sizeof(server) ?
+                       res->ai_addrlen :
+                       sizeof(server);
+       memcpy(&server, res->ai_addr, addrlen);
 
        (*p_freeaddrinfo.f)(res);
        goto again;
@@ -681,6 +721,7 @@
        memset((char *)&server,0,sizeof(server));
        server.sa_in.sin_family=AF_INET;
        server.sa_in.sin_port=htons(port);
+       addrlen = sizeof(server.sa_in);
 
        if (h == NULL || strcmp(h,"*") == 0)
                server.sa_in.sin_addr.s_addr=INADDR_ANY;
@@ -714,12 +755,19 @@
                bind_mode=BIO_BIND_NORMAL;
                }
 #endif
-       if (bind(s,&server.sa,sizeof(server)) == -1)
+       if (bind(s,&server.sa,addrlen) == -1)
                {
 #ifdef SO_REUSEADDR
                err_num=get_last_socket_error();
                if ((bind_mode == BIO_BIND_REUSEADDR_IF_UNUSED) &&
+#ifdef OPENSSL_SYS_WINDOWS
+                       /* Some versions of Windows define EADDRINUSE to
+                        * a dummy value.
+                        */
+                       (err_num == WSAEADDRINUSE))
+#else
                        (err_num == EADDRINUSE))
+#endif
                        {
                        client = server;
                        if (h == NULL || strcmp(h,"*") == 0)
@@ -742,7 +790,7 @@
                        if (cs != INVALID_SOCKET)
                                {
                                int ii;
-                               ii=connect(cs,&client.sa,sizeof(client));
+                               ii=connect(cs,&client.sa,addrlen);
                                closesocket(cs);
                                if (ii == INVALID_SOCKET)
                                        {
@@ -842,7 +890,7 @@
        char   h[NI_MAXHOST],s[NI_MAXSERV];
        size_t nl;
        static union {  void *p;
-                       int (*f)(const struct sockaddr *,size_t/*socklen_t*/,
+                       int (WSAAPI *f)(const struct sockaddr *,size_t/*socklen_t*/,
                                 char *,size_t,char *,size_t,int);
                        } p_getnameinfo = {NULL};
                        /* 2nd argument to getnameinfo is specified to
diff -r 14f8e9858024 -r 44a80aa6abaf crypto/external/bsd/openssl/dist/crypto/bio/bss_file.c
--- a/crypto/external/bsd/openssl/dist/crypto/bio/bss_file.c    Sun Jun 05 23:09:15 2011 +0000
+++ b/crypto/external/bsd/openssl/dist/crypto/bio/bss_file.c    Sun Jun 05 23:09:44 2011 +0000
@@ -118,10 +118,53 @@
 
 BIO *BIO_new_file(const char *filename, const char *mode)
        {



Home | Main Index | Thread Index | Old Index