[openssl-commits] [openssl] master update

Dr. Stephen Henson steve at openssl.org
Tue Aug 16 22:38:20 UTC 2016


The branch master has been updated
       via  48593cb12afc9a8b9de8b3e25ee1097c4f6fe90d (commit)
       via  b2e57e094db5f516cffa6f2749615a7287a7681d (commit)
       via  bb2f62bababe1e735efe828bc9a467b967c8cd20 (commit)
      from  69b86d4b98051af62d44b2ccf0a4cab7c8aa8ff9 (commit)


- Log -----------------------------------------------------------------
commit 48593cb12afc9a8b9de8b3e25ee1097c4f6fe90d
Author: Matt Caswell <matt at openssl.org>
Date:   Sat Aug 13 14:29:41 2016 +0100

    Convert SSL_SESSION* functions to use const getters
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>
    Reviewed-by: Stephen Henson <steve at openssl.org>

commit b2e57e094db5f516cffa6f2749615a7287a7681d
Author: Matt Caswell <matt at openssl.org>
Date:   Sat Aug 13 13:40:05 2016 +0100

    Convert PKCS8* functions to use const getters
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>
    Reviewed-by: Stephen Henson <steve at openssl.org>

commit bb2f62bababe1e735efe828bc9a467b967c8cd20
Author: Matt Caswell <matt at openssl.org>
Date:   Sat Aug 13 14:32:17 2016 +0100

    Convert TS_STATUS_INFO* functions to use const getters
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>
    Reviewed-by: Stephen Henson <steve at openssl.org>

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

Summary of changes:
 apps/pkcs12.c                      | 4 ++--
 crypto/asn1/p8_pkey.c              | 3 ++-
 crypto/pkcs12/p12_attr.c           | 3 ++-
 crypto/ts/ts_rsp_utils.c           | 7 ++++---
 doc/ssl/SSL_SESSION_has_ticket.pod | 2 +-
 include/openssl/pkcs12.h           | 3 ++-
 include/openssl/ssl.h              | 2 +-
 include/openssl/ts.h               | 8 +++++---
 include/openssl/x509.h             | 3 ++-
 ssl/ssl_sess.c                     | 2 +-
 test/handshake_helper.c            | 2 +-
 11 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/apps/pkcs12.c b/apps/pkcs12.c
index 315b72d..5f25734 100644
--- a/apps/pkcs12.c
+++ b/apps/pkcs12.c
@@ -37,7 +37,7 @@ int dump_certs_pkeys_bags(BIO *out, STACK_OF(PKCS12_SAFEBAG) *bags,
 int dump_certs_pkeys_bag(BIO *out, PKCS12_SAFEBAG *bags, char *pass,
                          int passlen, int options, char *pempass,
                          const EVP_CIPHER *enc);
-int print_attribs(BIO *out, STACK_OF(X509_ATTRIBUTE) *attrlst,
+int print_attribs(BIO *out, const STACK_OF(X509_ATTRIBUTE) *attrlst,
                   const char *name);
 void hex_prin(BIO *out, unsigned char *buf, int len);
 static int alg_print(X509_ALGOR *alg);
@@ -827,7 +827,7 @@ int cert_load(BIO *in, STACK_OF(X509) *sk)
 
 /* Generalised attribute print: handle PKCS#8 and bag attributes */
 
-int print_attribs(BIO *out, STACK_OF(X509_ATTRIBUTE) *attrlst,
+int print_attribs(BIO *out, const STACK_OF(X509_ATTRIBUTE) *attrlst,
                   const char *name)
 {
     X509_ATTRIBUTE *attr;
diff --git a/crypto/asn1/p8_pkey.c b/crypto/asn1/p8_pkey.c
index c08aa85..b8cc0b1 100644
--- a/crypto/asn1/p8_pkey.c
+++ b/crypto/asn1/p8_pkey.c
@@ -65,7 +65,8 @@ int PKCS8_pkey_get0(ASN1_OBJECT **ppkalg,
     return 1;
 }
 
-STACK_OF(X509_ATTRIBUTE) *PKCS8_pkey_get0_attrs(PKCS8_PRIV_KEY_INFO *p8)
+const STACK_OF(X509_ATTRIBUTE) *
+PKCS8_pkey_get0_attrs(const PKCS8_PRIV_KEY_INFO *p8)
 {
     return p8->attributes;
 }
diff --git a/crypto/pkcs12/p12_attr.c b/crypto/pkcs12/p12_attr.c
index bf44c0a..58935c1 100644
--- a/crypto/pkcs12/p12_attr.c
+++ b/crypto/pkcs12/p12_attr.c
@@ -64,7 +64,8 @@ int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name, int namelen)
         return 0;
 }
 
-ASN1_TYPE *PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid)
+ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs,
+                               int attr_nid)
 {
     X509_ATTRIBUTE *attrib;
     int i;
diff --git a/crypto/ts/ts_rsp_utils.c b/crypto/ts/ts_rsp_utils.c
index 3ee9dae..3ecee39 100644
--- a/crypto/ts/ts_rsp_utils.c
+++ b/crypto/ts/ts_rsp_utils.c
@@ -348,17 +348,18 @@ int TS_STATUS_INFO_set_status(TS_STATUS_INFO *a, int i)
     return ASN1_INTEGER_set(a->status, i);
 }
 
-ASN1_INTEGER *TS_STATUS_INFO_get0_status(TS_STATUS_INFO *a)
+const ASN1_INTEGER *TS_STATUS_INFO_get0_status(const TS_STATUS_INFO *a)
 {
     return a->status;
 }
 
-STACK_OF(ASN1_UTF8STRING) *TS_STATUS_INFO_get0_text(TS_STATUS_INFO *a)
+const STACK_OF(ASN1_UTF8STRING) *
+TS_STATUS_INFO_get0_text(const TS_STATUS_INFO *a)
 {
     return a->text;
 }
 
-ASN1_BIT_STRING *TS_STATUS_INFO_get0_failure_info(TS_STATUS_INFO *a)
+const ASN1_BIT_STRING *TS_STATUS_INFO_get0_failure_info(const TS_STATUS_INFO *a)
 {
     return a->failure_info;
 }
diff --git a/doc/ssl/SSL_SESSION_has_ticket.pod b/doc/ssl/SSL_SESSION_has_ticket.pod
index 2982c19..9e37255 100644
--- a/doc/ssl/SSL_SESSION_has_ticket.pod
+++ b/doc/ssl/SSL_SESSION_has_ticket.pod
@@ -12,7 +12,7 @@ SSL_SESSION_has_ticket, SSL_SESSION_get_ticket_lifetime_hint,
 
  int SSL_SESSION_has_ticket(const SSL_SESSION *s);
  unsigned long SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s);
- void SSL_SESSION_get0_ticket(const SSL_SESSION *s, unsigned char **tick,
+ void SSL_SESSION_get0_ticket(const SSL_SESSION *s, const unsigned char **tick,
                               size_t *len);
 
 =head1 DESCRIPTION
diff --git a/include/openssl/pkcs12.h b/include/openssl/pkcs12.h
index 4711dfa..775f20a 100644
--- a/include/openssl/pkcs12.h
+++ b/include/openssl/pkcs12.h
@@ -141,7 +141,8 @@ int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name,
 int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag,
                                 const unsigned char *name, int namelen);
 int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage);
-ASN1_TYPE *PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid);
+ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs,
+                               int attr_nid);
 char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag);
 STACK_OF(X509_ATTRIBUTE) *PKCS12_SAFEBAG_get0_attrs(PKCS12_SAFEBAG *bag);
 unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass,
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h
index 288b018..0f28920 100644
--- a/include/openssl/ssl.h
+++ b/include/openssl/ssl.h
@@ -1400,7 +1400,7 @@ __owur const char *SSL_SESSION_get0_hostname(const SSL_SESSION *s);
 __owur const SSL_CIPHER *SSL_SESSION_get0_cipher(const SSL_SESSION *s);
 __owur int SSL_SESSION_has_ticket(const SSL_SESSION *s);
 __owur unsigned long SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s);
-void SSL_SESSION_get0_ticket(const SSL_SESSION *s, unsigned char **tick,
+void SSL_SESSION_get0_ticket(const SSL_SESSION *s, const unsigned char **tick,
                             size_t *len);
 __owur int SSL_copy_session_id(SSL *to, const SSL *from);
 __owur X509 *SSL_SESSION_get0_peer(SSL_SESSION *s);
diff --git a/include/openssl/ts.h b/include/openssl/ts.h
index cd8f373..a565982 100644
--- a/include/openssl/ts.h
+++ b/include/openssl/ts.h
@@ -160,11 +160,13 @@ int TS_REQ_set_version(TS_REQ *a, long version);
 long TS_REQ_get_version(const TS_REQ *a);
 
 int TS_STATUS_INFO_set_status(TS_STATUS_INFO *a, int i);
-ASN1_INTEGER *TS_STATUS_INFO_get0_status(TS_STATUS_INFO *a);
+const ASN1_INTEGER *TS_STATUS_INFO_get0_status(const TS_STATUS_INFO *a);
 
-STACK_OF(ASN1_UTF8STRING) *TS_STATUS_INFO_get0_text(TS_STATUS_INFO *a);
+const STACK_OF(ASN1_UTF8STRING) *
+TS_STATUS_INFO_get0_text(const TS_STATUS_INFO *a);
 
-ASN1_BIT_STRING *TS_STATUS_INFO_get0_failure_info(TS_STATUS_INFO *a);
+const ASN1_BIT_STRING *
+TS_STATUS_INFO_get0_failure_info(const TS_STATUS_INFO *a);
 
 int TS_REQ_set_msg_imprint(TS_REQ *a, TS_MSG_IMPRINT *msg_imprint);
 TS_MSG_IMPRINT *TS_REQ_get_msg_imprint(TS_REQ *a);
diff --git a/include/openssl/x509.h b/include/openssl/x509.h
index 5cb15b0..4ccf2ec 100644
--- a/include/openssl/x509.h
+++ b/include/openssl/x509.h
@@ -971,7 +971,8 @@ int PKCS8_pkey_get0(ASN1_OBJECT **ppkalg,
                     const unsigned char **pk, int *ppklen,
                     X509_ALGOR **pa, PKCS8_PRIV_KEY_INFO *p8);
 
-STACK_OF(X509_ATTRIBUTE) *PKCS8_pkey_get0_attrs(PKCS8_PRIV_KEY_INFO *p8);
+const STACK_OF(X509_ATTRIBUTE) *
+PKCS8_pkey_get0_attrs(const PKCS8_PRIV_KEY_INFO *p8);
 int PKCS8_pkey_add1_attr_by_NID(PKCS8_PRIV_KEY_INFO *p8, int nid, int type,
                                 const unsigned char *bytes, int len);
 
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
index 4a58fa5..1a2872c 100644
--- a/ssl/ssl_sess.c
+++ b/ssl/ssl_sess.c
@@ -847,7 +847,7 @@ unsigned long SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s)
     return s->tlsext_tick_lifetime_hint;
 }
 
-void SSL_SESSION_get0_ticket(const SSL_SESSION *s, unsigned char **tick,
+void SSL_SESSION_get0_ticket(const SSL_SESSION *s, const unsigned char **tick,
                             size_t *len)
 {
     *len = s->tlsext_ticklen;
diff --git a/test/handshake_helper.c b/test/handshake_helper.c
index 07615ad..c4b14e7 100644
--- a/test/handshake_helper.c
+++ b/test/handshake_helper.c
@@ -699,7 +699,7 @@ static HANDSHAKE_RESULT *do_handshake_internal(
     int client_turn = 1;
     connect_phase_t phase = HANDSHAKE;
     handshake_status_t status = HANDSHAKE_RETRY;
-    unsigned char* tick = NULL;
+    const unsigned char* tick = NULL;
     size_t tick_len = 0;
     SSL_SESSION* sess = NULL;
     const unsigned char *proto = NULL;


More information about the openssl-commits mailing list