[openssl-commits] [openssl] master update

2018-07-10 Thread Andy Polyakov
The branch master has been updated
   via  8977880603176bea3dda1f1accae1b774d2104ac (commit)
  from  f99648638c8340cbc0cb7ddaa54309435bda9530 (commit)


- Log -
commit 8977880603176bea3dda1f1accae1b774d2104ac
Author: Andy Polyakov 
Date:   Mon Jul 9 11:11:37 2018 +0200

poly1305/asm/poly1305-x86_64.pl: fix solaris64-x86_64-cc build.

Reviewed-by: Paul Dale 
Reviewed-by: Rich Salz 
(Merged from https://github.com/openssl/openssl/pull/6676)

---

Summary of changes:
 crypto/poly1305/asm/poly1305-x86_64.pl | 77 +-
 1 file changed, 38 insertions(+), 39 deletions(-)

diff --git a/crypto/poly1305/asm/poly1305-x86_64.pl 
b/crypto/poly1305/asm/poly1305-x86_64.pl
index 0b4c56e..88394b0 100755
--- a/crypto/poly1305/asm/poly1305-x86_64.pl
+++ b/crypto/poly1305/asm/poly1305-x86_64.pl
@@ -3753,6 +3753,44 @@ poly1305_emit_base2_44:
 .size  poly1305_emit_base2_44,.-poly1305_emit_base2_44
 ___
 }  }   }
+$code.=<<___;
+.align 64
+.Lconst:
+.Lmask24:
+.long  0x0ff,0,0x0ff,0,0x0ff,0,0x0ff,0
+.L129:
+.long  `1<<24`,0,`1<<24`,0,`1<<24`,0,`1<<24`,0
+.Lmask26:
+.long  0x3ff,0,0x3ff,0,0x3ff,0,0x3ff,0
+.Lpermd_avx2:
+.long  2,2,2,3,2,0,2,1
+.Lpermd_avx512:
+.long  0,0,0,1, 0,2,0,3, 0,4,0,5, 0,6,0,7
+
+.L2_44_inp_permd:
+.long  0,1,1,2,2,3,7,7
+.L2_44_inp_shift:
+.quad  0,12,24,64
+.L2_44_mask:
+.quad  0xfff,0xfff,0x3ff,0x
+.L2_44_shift_rgt:
+.quad  44,44,42,64
+.L2_44_shift_lft:
+.quad  8,8,10,64
+
+.align 64
+.Lx_mask44:
+.quad  0xfff,0xfff,0xfff,0xfff
+.quad  0xfff,0xfff,0xfff,0xfff
+.Lx_mask42:
+.quad  0x3ff,0x3ff,0x3ff,0x3ff
+.quad  0x3ff,0x3ff,0x3ff,0x3ff
+___
+}
+$code.=<<___;
+.asciz "Poly1305 for x86_64, CRYPTOGAMS by "
+.align 16
+___
 
 {  # chacha20-poly1305 helpers
 my ($out,$inp,$otp,$len)=$win64 ? ("%rcx","%rdx","%r8", "%r9") :  # Win64 order
@@ -3857,45 +3895,6 @@ xor128_decrypt_n_pad:
 .size  xor128_decrypt_n_pad,.-xor128_decrypt_n_pad
 ___
 }
-$code.=<<___;
-.align 64
-.Lconst:
-.Lmask24:
-.long  0x0ff,0,0x0ff,0,0x0ff,0,0x0ff,0
-.L129:
-.long  `1<<24`,0,`1<<24`,0,`1<<24`,0,`1<<24`,0
-.Lmask26:
-.long  0x3ff,0,0x3ff,0,0x3ff,0,0x3ff,0
-.Lpermd_avx2:
-.long  2,2,2,3,2,0,2,1
-.Lpermd_avx512:
-.long  0,0,0,1, 0,2,0,3, 0,4,0,5, 0,6,0,7
-
-.L2_44_inp_permd:
-.long  0,1,1,2,2,3,7,7
-.L2_44_inp_shift:
-.quad  0,12,24,64
-.L2_44_mask:
-.quad  0xfff,0xfff,0x3ff,0x
-.L2_44_shift_rgt:
-.quad  44,44,42,64
-.L2_44_shift_lft:
-.quad  8,8,10,64
-
-.align 64
-.Lx_mask44:
-.quad  0xfff,0xfff,0xfff,0xfff
-.quad  0xfff,0xfff,0xfff,0xfff
-.Lx_mask42:
-.quad  0x3ff,0x3ff,0x3ff,0x3ff
-.quad  0x3ff,0x3ff,0x3ff,0x3ff
-___
-}
-
-$code.=<<___;
-.asciz "Poly1305 for x86_64, CRYPTOGAMS by "
-.align 16
-___
 
 # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame,
 #  CONTEXT *context,DISPATCHER_CONTEXT *disp)
_
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits


[openssl-commits] [openssl] master update

2018-07-10 Thread Richard Levitte
The branch master has been updated
   via  3550d9159f0c89b2ae1c01e81e31649d1b357d06 (commit)
  from  8977880603176bea3dda1f1accae1b774d2104ac (commit)


- Log -
commit 3550d9159f0c89b2ae1c01e81e31649d1b357d06
Author: Richard Levitte 
Date:   Mon Jul 9 17:31:23 2018 +0200

Avoid __GNUC__ warnings when defining DECLARE_DEPRECATED

We need to check that __GNUC__ is defined before trying to use it.
This demands a slightly different way to define DECLARE_DEPRECATED.

Reviewed-by: Rich Salz 
(Merged from https://github.com/openssl/openssl/pull/6680)

---

Summary of changes:
 include/openssl/opensslconf.h.in | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/include/openssl/opensslconf.h.in b/include/openssl/opensslconf.h.in
index 96f791e..200a11a 100644
--- a/include/openssl/opensslconf.h.in
+++ b/include/openssl/opensslconf.h.in
@@ -68,10 +68,12 @@ extern "C" {
  * still won't see them if the library has been built to disable deprecated
  * functions.
  */
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
-# define DECLARE_DEPRECATED(f)f __attribute__ ((deprecated));
-#else
-# define DECLARE_DEPRECATED(f)   f;
+#define DECLARE_DEPRECATED(f)   f;
+#ifdef __GNUC__
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
+#  undef DECLARE_DEPRECATED
+#  define DECLARE_DEPRECATED(f)f __attribute__ ((deprecated));
+# endif
 #endif
 
 #ifndef OPENSSL_FILE
_
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits


[openssl-commits] [openssl] master update

2018-07-10 Thread Richard Levitte
The branch master has been updated
   via  4e351ca92e3a1f447cef3d2e330f13941f9412c6 (commit)
   via  f7dce50f21c13520d36f51bed83d19d3eb0bf698 (commit)
   via  e9bc5706744213a1a6748dbbcd1b43a6ad4ca09e (commit)
  from  3550d9159f0c89b2ae1c01e81e31649d1b357d06 (commit)


- Log -
commit 4e351ca92e3a1f447cef3d2e330f13941f9412c6
Author: Richard Levitte 
Date:   Mon Jul 9 21:10:10 2018 +0200

util/dofile.pl: require Text::Template 1.46 or newer

The reason is that we override Text::Template::append_text_to_output(),
and it didn't exist before Text::Template 1.46.

Fixes #6641

Reviewed-by: Rich Salz 
(Merged from https://github.com/openssl/openssl/pull/6682)

commit f7dce50f21c13520d36f51bed83d19d3eb0bf698
Author: Richard Levitte 
Date:   Mon Jul 9 21:09:30 2018 +0200

Existing transfer modules must have a package and a $VERSION

Reviewed-by: Rich Salz 
(Merged from https://github.com/openssl/openssl/pull/6682)

commit e9bc5706744213a1a6748dbbcd1b43a6ad4ca09e
Author: Richard Levitte 
Date:   Mon Jul 9 21:07:25 2018 +0200

Make 'with_fallback' use 'use' instead of 'require'

This enables us to require module versions, and to fall back to a
bundled version if the system version is too low.

Reviewed-by: Rich Salz 
(Merged from https://github.com/openssl/openssl/pull/6682)

---

Summary of changes:
 external/perl/transfer/Text/Template.pm | 3 +++
 util/dofile.pl  | 2 +-
 util/perl/with_fallback.pm  | 6 --
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/external/perl/transfer/Text/Template.pm 
b/external/perl/transfer/Text/Template.pm
index 7dbfe3f..fa2acc3 100644
--- a/external/perl/transfer/Text/Template.pm
+++ b/external/perl/transfer/Text/Template.pm
@@ -7,6 +7,9 @@
 
 # Quick transfer to the downloaded Text::Template
 
+package transfer::Text::Template;
+$VERSION = 1.46;
+
 BEGIN {
 use File::Spec::Functions;
 use File::Basename;
diff --git a/util/dofile.pl b/util/dofile.pl
index b0e2068..c3bc9ba 100644
--- a/util/dofile.pl
+++ b/util/dofile.pl
@@ -40,7 +40,7 @@ package OpenSSL::Template;
 use File::Basename;
 use File::Spec::Functions;
 use lib "$FindBin::Bin/perl";
-use with_fallback qw(Text::Template);
+use with_fallback "Text::Template 1.46";
 
 #use parent qw/Text::Template/;
 use vars qw/@ISA/;
diff --git a/util/perl/with_fallback.pm b/util/perl/with_fallback.pm
index 2af1d5f..fc5638d 100644
--- a/util/perl/with_fallback.pm
+++ b/util/perl/with_fallback.pm
@@ -8,15 +8,17 @@
 package with_fallback;
 
 sub import {
+shift;
+
 use File::Basename;
 use File::Spec::Functions;
 foreach (@_) {
-   eval "require $_";
+   eval "use $_";
if ($@) {
unshift @INC, catdir(dirname(__FILE__),
  "..", "..", "external", "perl");
my $transfer = "transfer::$_";
-   eval "require $transfer";
+   eval "use $transfer";
shift @INC;
warn $@ if $@;
}
_
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits


[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

2018-07-10 Thread Richard Levitte
The branch OpenSSL_1_1_0-stable has been updated
   via  356d63458279f05e361de5f69f8d8acb75ada925 (commit)
   via  374976ee64d31bee04bbd2548df7c0b2ecc1 (commit)
   via  546574ba92cae095fd1b4c7366c3b5bde4a58383 (commit)
  from  7725c76c3f685c306ef4f4125a8a3495e9978a68 (commit)


- Log -
commit 356d63458279f05e361de5f69f8d8acb75ada925
Author: Richard Levitte 
Date:   Mon Jul 9 21:10:10 2018 +0200

util/dofile.pl: require Text::Template 1.46 or newer

The reason is that we override Text::Template::append_text_to_output(),
and it didn't exist before Text::Template 1.46.

Fixes #6641

Reviewed-by: Rich Salz 
(Merged from https://github.com/openssl/openssl/pull/6682)

(cherry picked from commit 4e351ca92e3a1f447cef3d2e330f13941f9412c6)

commit 374976ee64d31bee04bbd2548df7c0b2ecc1
Author: Richard Levitte 
Date:   Mon Jul 9 21:09:30 2018 +0200

Existing transfer modules must have a package and a $VERSION

Reviewed-by: Rich Salz 
(Merged from https://github.com/openssl/openssl/pull/6682)

(cherry picked from commit f7dce50f21c13520d36f51bed83d19d3eb0bf698)

commit 546574ba92cae095fd1b4c7366c3b5bde4a58383
Author: Richard Levitte 
Date:   Mon Jul 9 21:07:25 2018 +0200

Make 'with_fallback' use 'use' instead of 'require'

This enables us to require module versions, and to fall back to a
bundled version if the system version is too low.

Reviewed-by: Rich Salz 
(Merged from https://github.com/openssl/openssl/pull/6682)

(cherry picked from commit e9bc5706744213a1a6748dbbcd1b43a6ad4ca09e)

---

Summary of changes:
 external/perl/transfer/Text/Template.pm | 3 +++
 util/dofile.pl  | 2 +-
 util/perl/with_fallback.pm  | 6 --
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/external/perl/transfer/Text/Template.pm 
b/external/perl/transfer/Text/Template.pm
index 7dbfe3f..fa2acc3 100644
--- a/external/perl/transfer/Text/Template.pm
+++ b/external/perl/transfer/Text/Template.pm
@@ -7,6 +7,9 @@
 
 # Quick transfer to the downloaded Text::Template
 
+package transfer::Text::Template;
+$VERSION = 1.46;
+
 BEGIN {
 use File::Spec::Functions;
 use File::Basename;
diff --git a/util/dofile.pl b/util/dofile.pl
index a932941..4533c13 100644
--- a/util/dofile.pl
+++ b/util/dofile.pl
@@ -40,7 +40,7 @@ package OpenSSL::Template;
 use File::Basename;
 use File::Spec::Functions;
 use lib "$FindBin::Bin/perl";
-use with_fallback qw(Text::Template);
+use with_fallback "Text::Template 1.46";
 
 #use parent qw/Text::Template/;
 use vars qw/@ISA/;
diff --git a/util/perl/with_fallback.pm b/util/perl/with_fallback.pm
index 2af1d5f..fc5638d 100644
--- a/util/perl/with_fallback.pm
+++ b/util/perl/with_fallback.pm
@@ -8,15 +8,17 @@
 package with_fallback;
 
 sub import {
+shift;
+
 use File::Basename;
 use File::Spec::Functions;
 foreach (@_) {
-   eval "require $_";
+   eval "use $_";
if ($@) {
unshift @INC, catdir(dirname(__FILE__),
  "..", "..", "external", "perl");
my $transfer = "transfer::$_";
-   eval "require $transfer";
+   eval "use $transfer";
shift @INC;
warn $@ if $@;
}
_
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits


[openssl-commits] [openssl] master update

2018-07-10 Thread Richard Levitte
The branch master has been updated
   via  4431107d6c430950c2c2e19c03b8dff6355ccfdb (commit)
  from  4e351ca92e3a1f447cef3d2e330f13941f9412c6 (commit)


- Log -
commit 4431107d6c430950c2c2e19c03b8dff6355ccfdb
Author: Richard Levitte 
Date:   Tue Jul 10 19:11:06 2018 +0200

Guard DECLARE_DEPRECATED against multiple includes of opensslconf.h

Reviewed-by: Rich Salz 
(Merged from https://github.com/openssl/openssl/pull/6689)

---

Summary of changes:
 include/openssl/opensslconf.h.in | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/include/openssl/opensslconf.h.in b/include/openssl/opensslconf.h.in
index 200a11a..b793d48 100644
--- a/include/openssl/opensslconf.h.in
+++ b/include/openssl/opensslconf.h.in
@@ -68,11 +68,13 @@ extern "C" {
  * still won't see them if the library has been built to disable deprecated
  * functions.
  */
-#define DECLARE_DEPRECATED(f)   f;
-#ifdef __GNUC__
-# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
-#  undef DECLARE_DEPRECATED
-#  define DECLARE_DEPRECATED(f)f __attribute__ ((deprecated));
+#ifndef DECLARE_DEPRECATED
+# define DECLARE_DEPRECATED(f)   f;
+# ifdef __GNUC__
+#  if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
+#   undef DECLARE_DEPRECATED
+#   define DECLARE_DEPRECATED(f)f __attribute__ ((deprecated));
+#  endif
 # endif
 #endif
 
_
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits


[openssl-commits] [openssl] master update

2018-07-10 Thread paul . dale
The branch master has been updated
   via  c9ecb13191fe902c1e78e3bca7c36c293bba4bc6 (commit)
  from  4431107d6c430950c2c2e19c03b8dff6355ccfdb (commit)


- Log -
commit c9ecb13191fe902c1e78e3bca7c36c293bba4bc6
Author: Pauli 
Date:   Wed Jul 4 09:30:43 2018 +1000

NCONF_get_number refix.

Fix the NULL check lack in a different way that is more compatible with
non-NULL branch.  Refer #6632

Also mark and pop the error stack instead of clearing all errors when 
something
goes awry in CONF_get_number.

Reviewed-by: Rich Salz 
Reviewed-by: Andy Polyakov 
(Merged from https://github.com/openssl/openssl/pull/6643)

---

Summary of changes:
 crypto/conf/conf_err.c|  1 +
 crypto/conf/conf_lib.c| 44 
 crypto/err/openssl.txt|  1 +
 include/openssl/conferr.h |  1 +
 test/conf_include_test.c  | 26 ++
 5 files changed, 61 insertions(+), 12 deletions(-)

diff --git a/crypto/conf/conf_err.c b/crypto/conf/conf_err.c
index 01f98da..f761358 100644
--- a/crypto/conf/conf_err.c
+++ b/crypto/conf/conf_err.c
@@ -60,6 +60,7 @@ static const ERR_STRING_DATA CONF_str_reasons[] = {
 {ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_SECTION), "no section"},
 {ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_SUCH_FILE), "no such file"},
 {ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_VALUE), "no value"},
+{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NUMBER_TOO_LARGE), "number too large"},
 {ERR_PACK(ERR_LIB_CONF, 0, CONF_R_RECURSIVE_DIRECTORY_INCLUDE),
 "recursive directory include"},
 {ERR_PACK(ERR_LIB_CONF, 0, CONF_R_SSL_COMMAND_SECTION_EMPTY),
diff --git a/crypto/conf/conf_lib.c b/crypto/conf/conf_lib.c
index 5f976f3..1833b15 100644
--- a/crypto/conf/conf_lib.c
+++ b/crypto/conf/conf_lib.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include "internal/conf.h"
+#include "internal/ctype.h"
 #include 
 #include 
 #include 
@@ -123,6 +124,7 @@ long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char 
*group,
 int status;
 long result = 0;
 
+ERR_set_mark();
 if (conf == NULL) {
 status = NCONF_get_number_e(NULL, group, name, );
 } else {
@@ -130,12 +132,8 @@ long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const 
char *group,
 CONF_set_nconf(, conf);
 status = NCONF_get_number_e(, group, name, );
 }
-
-if (status == 0) {
-/* This function does not believe in errors... */
-ERR_clear_error();
-}
-return result;
+ERR_pop_to_mark();
+return status == 0 ? 0L : result;
 }
 
 void CONF_free(LHASH_OF(CONF_VALUE) *conf)
@@ -277,10 +275,23 @@ char *NCONF_get_string(const CONF *conf, const char 
*group, const char *name)
 return NULL;
 }
 
+static int default_is_number(const CONF *conf, char c)
+{
+return ossl_isdigit(c);
+}
+
+static int default_to_int(const CONF *conf, char c)
+{
+return (int)(c - '0');
+}
+
 int NCONF_get_number_e(const CONF *conf, const char *group, const char *name,
long *result)
 {
 char *str;
+long res;
+int (*is_number)(const CONF *, char) = _is_number;
+int (*to_int)(const CONF *, char) = _to_int;
 
 if (result == NULL) {
 CONFerr(CONF_F_NCONF_GET_NUMBER_E, ERR_R_PASSED_NULL_PARAMETER);
@@ -292,14 +303,23 @@ int NCONF_get_number_e(const CONF *conf, const char 
*group, const char *name,
 if (str == NULL)
 return 0;
 
-if (conf == NULL)
-*result = strtol(str, , 10);
-else
-for (*result = 0; conf->meth->is_number(conf, *str);) {
-*result = (*result) * 10 + conf->meth->to_int(conf, *str);
-str++;
+if (conf != NULL) {
+if (conf->meth->is_number != NULL)
+is_number = conf->meth->is_number;
+if (conf->meth->to_int != NULL)
+to_int = conf->meth->to_int;
+}
+for (res = 0; is_number(conf, *str); str++) {
+const int d = to_int(conf, *str);
+
+if (res > (LONG_MAX - d) / 10L) {
+CONFerr(CONF_F_NCONF_GET_NUMBER_E, CONF_R_NUMBER_TOO_LARGE);
+return 0;
 }
+res = res * 10 + d;
+}
 
+*result = res;
 return 1;
 }
 
diff --git a/crypto/err/openssl.txt b/crypto/err/openssl.txt
index ee68388..007560a 100644
--- a/crypto/err/openssl.txt
+++ b/crypto/err/openssl.txt
@@ -2012,6 +2012,7 @@ CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE:106:no conf or 
environment variable
 CONF_R_NO_SECTION:107:no section
 CONF_R_NO_SUCH_FILE:114:no such file
 CONF_R_NO_VALUE:108:no value
+CONF_R_NUMBER_TOO_LARGE:121:number too large
 CONF_R_RECURSIVE_DIRECTORY_INCLUDE:111:recursive directory include
 CONF_R_SSL_COMMAND_SECTION_EMPTY:117:ssl command section empty
 CONF_R_SSL_COMMAND_SECTION_NOT_FOUND:118:ssl command section not found
diff --git a/include/openssl/conferr.h b/include/openssl/conferr.h
index