[openssl-commits] Jenkins build is back to normal : 1_0_2_abi #484

2018-08-11 Thread osslsanity
See 


_
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits


[openssl-commits] [openssl] OpenSSL_1_0_2-stable update

2018-08-11 Thread Richard Levitte
The branch OpenSSL_1_0_2-stable has been updated
   via  0971432f6f6d8b40d797133621809bd31eb7bf4e (commit)
  from  ec3f996b3066ecaaec87ba5ad29c606aeac0740d (commit)


- Log -
commit 0971432f6f6d8b40d797133621809bd31eb7bf4e
Author: Richard Levitte 
Date:   Sat Aug 11 09:59:20 2018 +0200

i2d_ASN1_OBJECT(): allocate memory if the user didn't provide a buffer

Since 0.9.7, all i2d_ functions were documented to allocate an output
buffer if the user didn't provide one, under these conditions (from
the 1.0.2 documentation):

For OpenSSL 0.9.7 and later if B<*out> is B memory will be
allocated for a buffer and the encoded data written to it. In this
case B<*out> is not incremented and it points to the start of the
data just written.

i2d_ASN1_OBJECT was found not to do this, and would crash if a NULL
output buffer was provided.

Fixes #6914

Reviewed-by: Matthias St. Pierre 
(Merged from https://github.com/openssl/openssl/pull/6918)

(cherry picked from commit 6114041540d8d1fecaf23a861788c3c742d3b467)

---

Summary of changes:
 crypto/asn1/a_object.c | 21 -
 crypto/asn1/asn1.h |  1 +
 crypto/asn1/asn1_err.c |  1 +
 3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/crypto/asn1/a_object.c b/crypto/asn1/a_object.c
index ad6b12a..ce05cf4 100644
--- a/crypto/asn1/a_object.c
+++ b/crypto/asn1/a_object.c
@@ -66,7 +66,7 @@
 
 int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
 {
-unsigned char *p;
+unsigned char *p, *allocated = NULL;
 int objsize;
 
 if ((a == NULL) || (a->data == NULL))
@@ -76,13 +76,24 @@ int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
 if (pp == NULL || objsize == -1)
 return objsize;
 
-p = *pp;
+if (*pp == NULL) {
+if ((p = allocated = OPENSSL_malloc(objsize)) == NULL) {
+ASN1err(ASN1_F_I2D_ASN1_OBJECT, ERR_R_MALLOC_FAILURE);
+return 0;
+}
+} else {
+p = *pp;
+}
+
 ASN1_put_object(, 0, a->length, V_ASN1_OBJECT, V_ASN1_UNIVERSAL);
 memcpy(p, a->data, a->length);
-p += a->length;
 
-*pp = p;
-return (objsize);
+/*
+ * If a new buffer was allocated, just return it back.
+ * If not, return the incremented buffer pointer.
+ */
+*pp = allocated != NULL ? allocated : p + a->length;
+return objsize;
 }
 
 int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
diff --git a/crypto/asn1/asn1.h b/crypto/asn1/asn1.h
index 256c531..0515292 100644
--- a/crypto/asn1/asn1.h
+++ b/crypto/asn1/asn1.h
@@ -1267,6 +1267,7 @@ void ERR_load_ASN1_strings(void);
 # define ASN1_F_D2I_X509_PKEY 159
 # define ASN1_F_DO_BUF221
 # define ASN1_F_I2D_ASN1_BIO_STREAM   211
+# define ASN1_F_I2D_ASN1_OBJECT   222
 # define ASN1_F_I2D_ASN1_SET  188
 # define ASN1_F_I2D_ASN1_TIME 160
 # define ASN1_F_I2D_DSA_PUBKEY161
diff --git a/crypto/asn1/asn1_err.c b/crypto/asn1/asn1_err.c
index c144180..475e80a 100644
--- a/crypto/asn1/asn1_err.c
+++ b/crypto/asn1/asn1_err.c
@@ -168,6 +168,7 @@ static ERR_STRING_DATA ASN1_str_functs[] = {
 {ERR_FUNC(ASN1_F_D2I_X509_PKEY), "d2i_X509_PKEY"},
 {ERR_FUNC(ASN1_F_DO_BUF), "DO_BUF"},
 {ERR_FUNC(ASN1_F_I2D_ASN1_BIO_STREAM), "i2d_ASN1_bio_stream"},
+{ERR_FUNC(ASN1_F_I2D_ASN1_OBJECT), "i2d_ASN1_OBJECT"},
 {ERR_FUNC(ASN1_F_I2D_ASN1_SET), "i2d_ASN1_SET"},
 {ERR_FUNC(ASN1_F_I2D_ASN1_TIME), "I2D_ASN1_TIME"},
 {ERR_FUNC(ASN1_F_I2D_DSA_PUBKEY), "i2d_DSA_PUBKEY"},
_
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits


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

2018-08-11 Thread Richard Levitte
The branch OpenSSL_1_1_0-stable has been updated
   via  6114041540d8d1fecaf23a861788c3c742d3b467 (commit)
  from  9553d9691ca67d6cd31573c7f6e567b182800511 (commit)


- Log -
commit 6114041540d8d1fecaf23a861788c3c742d3b467
Author: Richard Levitte 
Date:   Sat Aug 11 09:59:20 2018 +0200

i2d_ASN1_OBJECT(): allocate memory if the user didn't provide a buffer

Since 0.9.7, all i2d_ functions were documented to allocate an output
buffer if the user didn't provide one, under these conditions (from
the 1.0.2 documentation):

For OpenSSL 0.9.7 and later if B<*out> is B memory will be
allocated for a buffer and the encoded data written to it. In this
case B<*out> is not incremented and it points to the start of the
data just written.

i2d_ASN1_OBJECT was found not to do this, and would crash if a NULL
output buffer was provided.

Fixes #6914

Reviewed-by: Matthias St. Pierre 
(Merged from https://github.com/openssl/openssl/pull/6918)

(cherry picked from commit cba024dc685d13dbcbd0577bed028ee6b295b56a)

---

Summary of changes:
 crypto/asn1/a_object.c | 21 -
 crypto/asn1/asn1_err.c |  1 +
 include/openssl/asn1.h |  1 +
 3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/crypto/asn1/a_object.c b/crypto/asn1/a_object.c
index 1ec7a7e..91c7e28 100644
--- a/crypto/asn1/a_object.c
+++ b/crypto/asn1/a_object.c
@@ -19,7 +19,7 @@
 
 int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp)
 {
-unsigned char *p;
+unsigned char *p, *allocated = NULL;
 int objsize;
 
 if ((a == NULL) || (a->data == NULL))
@@ -29,13 +29,24 @@ int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char 
**pp)
 if (pp == NULL || objsize == -1)
 return objsize;
 
-p = *pp;
+if (*pp == NULL) {
+if ((p = allocated = OPENSSL_malloc(objsize)) == NULL) {
+ASN1err(ASN1_F_I2D_ASN1_OBJECT, ERR_R_MALLOC_FAILURE);
+return 0;
+}
+} else {
+p = *pp;
+}
+
 ASN1_put_object(, 0, a->length, V_ASN1_OBJECT, V_ASN1_UNIVERSAL);
 memcpy(p, a->data, a->length);
-p += a->length;
 
-*pp = p;
-return (objsize);
+/*
+ * If a new buffer was allocated, just return it back.
+ * If not, return the incremented buffer pointer.
+ */
+*pp = allocated != NULL ? allocated : p + a->length;
+return objsize;
 }
 
 int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
diff --git a/crypto/asn1/asn1_err.c b/crypto/asn1/asn1_err.c
index 7068c0c..5d895d3 100644
--- a/crypto/asn1/asn1_err.c
+++ b/crypto/asn1/asn1_err.c
@@ -95,6 +95,7 @@ static ERR_STRING_DATA ASN1_str_functs[] = {
 {ERR_FUNC(ASN1_F_DO_BUF), "do_buf"},
 {ERR_FUNC(ASN1_F_DO_TCREATE), "do_tcreate"},
 {ERR_FUNC(ASN1_F_I2D_ASN1_BIO_STREAM), "i2d_ASN1_bio_stream"},
+{ERR_FUNC(ASN1_F_I2D_ASN1_OBJECT), "i2d_ASN1_OBJECT"},
 {ERR_FUNC(ASN1_F_I2D_DSA_PUBKEY), "i2d_DSA_PUBKEY"},
 {ERR_FUNC(ASN1_F_I2D_EC_PUBKEY), "i2d_EC_PUBKEY"},
 {ERR_FUNC(ASN1_F_I2D_PRIVATEKEY), "i2d_PrivateKey"},
diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h
index 88e6469..d0b1099 100644
--- a/include/openssl/asn1.h
+++ b/include/openssl/asn1.h
@@ -956,6 +956,7 @@ int ERR_load_ASN1_strings(void);
 # define ASN1_F_DO_BUF142
 # define ASN1_F_DO_TCREATE222
 # define ASN1_F_I2D_ASN1_BIO_STREAM   211
+# define ASN1_F_I2D_ASN1_OBJECT   143
 # define ASN1_F_I2D_DSA_PUBKEY161
 # define ASN1_F_I2D_EC_PUBKEY 181
 # define ASN1_F_I2D_PRIVATEKEY163
_
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits


[openssl-commits] [openssl] master update

2018-08-11 Thread Richard Levitte
The branch master has been updated
   via  cba024dc685d13dbcbd0577bed028ee6b295b56a (commit)
  from  d0d0e8a71918816f7039f1f5443ebb3e28c06393 (commit)


- Log -
commit cba024dc685d13dbcbd0577bed028ee6b295b56a
Author: Richard Levitte 
Date:   Sat Aug 11 09:59:20 2018 +0200

i2d_ASN1_OBJECT(): allocate memory if the user didn't provide a buffer

Since 0.9.7, all i2d_ functions were documented to allocate an output
buffer if the user didn't provide one, under these conditions (from
the 1.0.2 documentation):

For OpenSSL 0.9.7 and later if B<*out> is B memory will be
allocated for a buffer and the encoded data written to it. In this
case B<*out> is not incremented and it points to the start of the
data just written.

i2d_ASN1_OBJECT was found not to do this, and would crash if a NULL
output buffer was provided.

Fixes #6914

Reviewed-by: Matthias St. Pierre 
(Merged from https://github.com/openssl/openssl/pull/6918)

---

Summary of changes:
 crypto/asn1/a_object.c| 19 +++
 crypto/asn1/asn1_err.c|  1 +
 crypto/err/openssl.txt|  1 +
 include/openssl/asn1err.h |  1 +
 4 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/crypto/asn1/a_object.c b/crypto/asn1/a_object.c
index 42c138c..5e1424a 100644
--- a/crypto/asn1/a_object.c
+++ b/crypto/asn1/a_object.c
@@ -20,7 +20,7 @@
 
 int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp)
 {
-unsigned char *p;
+unsigned char *p, *allocated = NULL;
 int objsize;
 
 if ((a == NULL) || (a->data == NULL))
@@ -30,12 +30,23 @@ int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char 
**pp)
 if (pp == NULL || objsize == -1)
 return objsize;
 
-p = *pp;
+if (*pp == NULL) {
+if ((p = allocated = OPENSSL_malloc(objsize)) == NULL) {
+ASN1err(ASN1_F_I2D_ASN1_OBJECT, ERR_R_MALLOC_FAILURE);
+return 0;
+}
+} else {
+p = *pp;
+}
+
 ASN1_put_object(, 0, a->length, V_ASN1_OBJECT, V_ASN1_UNIVERSAL);
 memcpy(p, a->data, a->length);
-p += a->length;
 
-*pp = p;
+/*
+ * If a new buffer was allocated, just return it back.
+ * If not, return the incremented buffer pointer.
+ */
+*pp = allocated != NULL ? allocated : p + a->length;
 return objsize;
 }
 
diff --git a/crypto/asn1/asn1_err.c b/crypto/asn1/asn1_err.c
index 5907c94..613f9ae 100644
--- a/crypto/asn1/asn1_err.c
+++ b/crypto/asn1/asn1_err.c
@@ -116,6 +116,7 @@ static const ERR_STRING_DATA ASN1_str_functs[] = {
 {ERR_PACK(ERR_LIB_ASN1, ASN1_F_I2A_ASN1_OBJECT, 0), "i2a_ASN1_OBJECT"},
 {ERR_PACK(ERR_LIB_ASN1, ASN1_F_I2D_ASN1_BIO_STREAM, 0),
  "i2d_ASN1_bio_stream"},
+{ERR_PACK(ERR_LIB_ASN1, ASN1_F_I2D_ASN1_OBJECT, 0), "i2d_ASN1_OBJECT"},
 {ERR_PACK(ERR_LIB_ASN1, ASN1_F_I2D_DSA_PUBKEY, 0), "i2d_DSA_PUBKEY"},
 {ERR_PACK(ERR_LIB_ASN1, ASN1_F_I2D_EC_PUBKEY, 0), "i2d_EC_PUBKEY"},
 {ERR_PACK(ERR_LIB_ASN1, ASN1_F_I2D_PRIVATEKEY, 0), "i2d_PrivateKey"},
diff --git a/crypto/err/openssl.txt b/crypto/err/openssl.txt
index 90b5c4e..3ecd44b 100644
--- a/crypto/err/openssl.txt
+++ b/crypto/err/openssl.txt
@@ -88,6 +88,7 @@ ASN1_F_DO_DUMP:125:do_dump
 ASN1_F_DO_TCREATE:222:do_tcreate
 ASN1_F_I2A_ASN1_OBJECT:126:i2a_ASN1_OBJECT
 ASN1_F_I2D_ASN1_BIO_STREAM:211:i2d_ASN1_bio_stream
+ASN1_F_I2D_ASN1_OBJECT:143:i2d_ASN1_OBJECT
 ASN1_F_I2D_DSA_PUBKEY:161:i2d_DSA_PUBKEY
 ASN1_F_I2D_EC_PUBKEY:181:i2d_EC_PUBKEY
 ASN1_F_I2D_PRIVATEKEY:163:i2d_PrivateKey
diff --git a/include/openssl/asn1err.h b/include/openssl/asn1err.h
index 8001120..5a91126 100644
--- a/include/openssl/asn1err.h
+++ b/include/openssl/asn1err.h
@@ -101,6 +101,7 @@ int ERR_load_ASN1_strings(void);
 # define ASN1_F_DO_TCREATE222
 # define ASN1_F_I2A_ASN1_OBJECT   126
 # define ASN1_F_I2D_ASN1_BIO_STREAM   211
+# define ASN1_F_I2D_ASN1_OBJECT   143
 # define ASN1_F_I2D_DSA_PUBKEY161
 # define ASN1_F_I2D_EC_PUBKEY 181
 # define ASN1_F_I2D_PRIVATEKEY163
_
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits


[openssl-commits] Build completed: openssl master.19328

2018-08-11 Thread AppVeyor


Build openssl master.19328 completed



Commit ed73471e70 by Richard Levitte on 8/11/2018 8:49 AM:

fixup! i2d_ASN1_OBJECT(): allocate memory if the user didn't provide a buffer


Configure your notification preferences

_
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits


[openssl-commits] Build failed: openssl master.19327

2018-08-11 Thread AppVeyor



Build openssl master.19327 failed


Commit ee1b11aa88 by Richard Levitte on 8/11/2018 8:42 AM:

fixup! i2d_ASN1_OBJECT(): allocate memory if the user didn't provide a buffer


Configure your notification preferences

_
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits