The diff below contains the last planned const changes I can do without
a library bump. The functions are trivial callback getters for the
bio_meth_st and ui_method_st structures. They will acquire a const in
OpenSSL 1.1.1, but are unchanged in 1.1.0h. I see no reason to wait. As
usual, the diff went through a bulk by sthen.

To the best of my knowledge, there are five functions of our public API
missing const compared to OpenSSL 1.1.0h. Since the API comparison is
tricky, it may well be that I missed a few... The five functions are:

        OCSP_cert_to_id
        ECDH_compute_key        
        EVP_PKCS82PKEY
        PKCS8_pkey_get0
        EVP_PKEY_asn1_set_private

Here, OCSP_cert_to_id is properly done with a symbol addition so only
needs a minor bump, the others depend on data structure changes. I will
hold on to the diffs for those and will try to make them part of the
next minor or major libcrypto bump, as appropriate.

Index: lib/libcrypto/bio/bio.h
===================================================================
RCS file: /var/cvs/src/lib/libcrypto/bio/bio.h,v
retrieving revision 1.44
diff -u -p -r1.44 bio.h
--- lib/libcrypto/bio/bio.h     30 May 2018 00:23:04 -0000      1.44
+++ lib/libcrypto/bio/bio.h     1 Jun 2018 08:57:20 -0000
@@ -337,22 +337,22 @@ typedef int asn1_ps_func(BIO *b, unsigne
 /* BIO_METHOD accessors */
 BIO_METHOD *BIO_meth_new(int type, const char *name);
 void BIO_meth_free(BIO_METHOD *biom);
-int (*BIO_meth_get_write(BIO_METHOD *biom))(BIO *, const char *, int);
+int (*BIO_meth_get_write(const BIO_METHOD *biom))(BIO *, const char *, int);
 int BIO_meth_set_write(BIO_METHOD *biom,
     int (*write)(BIO *, const char *, int));
-int (*BIO_meth_get_read(BIO_METHOD *biom))(BIO *, char *, int);
+int (*BIO_meth_get_read(const BIO_METHOD *biom))(BIO *, char *, int);
 int BIO_meth_set_read(BIO_METHOD *biom, int (*read)(BIO *, char *, int));
-int (*BIO_meth_get_puts(BIO_METHOD *biom))(BIO *, const char *);
+int (*BIO_meth_get_puts(const BIO_METHOD *biom))(BIO *, const char *);
 int BIO_meth_set_puts(BIO_METHOD *biom, int (*puts)(BIO *, const char *));
-int (*BIO_meth_get_gets(BIO_METHOD *biom))(BIO *, char *, int);
+int (*BIO_meth_get_gets(const BIO_METHOD *biom))(BIO *, char *, int);
 int BIO_meth_set_gets(BIO_METHOD *biom, int (*gets)(BIO *, char *, int));
-long (*BIO_meth_get_ctrl(BIO_METHOD *biom))(BIO *, int, long, void *);
+long (*BIO_meth_get_ctrl(const BIO_METHOD *biom))(BIO *, int, long, void *);
 int BIO_meth_set_ctrl(BIO_METHOD *biom, long (*ctrl)(BIO *, int, long, void 
*));
-int (*BIO_meth_get_create(BIO_METHOD *biom))(BIO *);
+int (*BIO_meth_get_create(const BIO_METHOD *biom))(BIO *);
 int BIO_meth_set_create(BIO_METHOD *biom, int (*create)(BIO *));
-int (*BIO_meth_get_destroy(BIO_METHOD *biom))(BIO *);
+int (*BIO_meth_get_destroy(const BIO_METHOD *biom))(BIO *);
 int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *));
-long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom))(BIO *, int, BIO_info_cb 
*);
+long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))(BIO *, int, 
BIO_info_cb *);
 int BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
     long (*callback_ctrl)(BIO *, int, BIO_info_cb *));
 
Index: lib/libcrypto/bio/bio_meth.c
===================================================================
RCS file: /var/cvs/src/lib/libcrypto/bio/bio_meth.c,v
retrieving revision 1.5
diff -u -p -r1.5 bio_meth.c
--- lib/libcrypto/bio/bio_meth.c        20 Feb 2018 18:51:35 -0000      1.5
+++ lib/libcrypto/bio/bio_meth.c        1 Jun 2018 08:57:20 -0000
@@ -40,7 +40,7 @@ BIO_meth_free(BIO_METHOD *biom)
 }
 
 int
-(*BIO_meth_get_write(BIO_METHOD *biom))(BIO *, const char *, int)
+(*BIO_meth_get_write(const BIO_METHOD *biom))(BIO *, const char *, int)
 {
        return biom->bwrite;
 }
@@ -53,7 +53,7 @@ BIO_meth_set_write(BIO_METHOD *biom, int
 }
 
 int
-(*BIO_meth_get_read(BIO_METHOD *biom))(BIO *, char *, int)
+(*BIO_meth_get_read(const BIO_METHOD *biom))(BIO *, char *, int)
 {
        return biom->bread;
 }
@@ -66,7 +66,7 @@ BIO_meth_set_read(BIO_METHOD *biom, int 
 }
 
 int
-(*BIO_meth_get_puts(BIO_METHOD *biom))(BIO *, const char *)
+(*BIO_meth_get_puts(const BIO_METHOD *biom))(BIO *, const char *)
 {
        return biom->bputs;
 }
@@ -79,7 +79,7 @@ BIO_meth_set_puts(BIO_METHOD *biom, int 
 }
 
 int
-(*BIO_meth_get_gets(BIO_METHOD *biom))(BIO *, char *, int)
+(*BIO_meth_get_gets(const BIO_METHOD *biom))(BIO *, char *, int)
 {
        return biom->bgets;
 }
@@ -92,7 +92,7 @@ BIO_meth_set_gets(BIO_METHOD *biom, int 
 }
 
 long
-(*BIO_meth_get_ctrl(BIO_METHOD *biom))(BIO *, int, long, void *)
+(*BIO_meth_get_ctrl(const BIO_METHOD *biom))(BIO *, int, long, void *)
 {
        return biom->ctrl;
 }
@@ -105,7 +105,7 @@ BIO_meth_set_ctrl(BIO_METHOD *biom, long
 }
 
 int
-(*BIO_meth_get_create(BIO_METHOD *biom))(BIO *)
+(*BIO_meth_get_create(const BIO_METHOD *biom))(BIO *)
 {
        return biom->create;
 }
@@ -118,7 +118,7 @@ BIO_meth_set_create(BIO_METHOD *biom, in
 }
 
 int
-(*BIO_meth_get_destroy(BIO_METHOD *biom))(BIO *)
+(*BIO_meth_get_destroy(const BIO_METHOD *biom))(BIO *)
 {
        return biom->destroy;
 }
@@ -131,7 +131,7 @@ BIO_meth_set_destroy(BIO_METHOD *biom, i
 }
 
 long
-(*BIO_meth_get_callback_ctrl(BIO_METHOD *biom))(BIO *, int, BIO_info_cb *)
+(*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))(BIO *, int, BIO_info_cb 
*)
 {
        return
            (long (*)(BIO *, int, BIO_info_cb *))biom->callback_ctrl; /* XXX */
Index: lib/libcrypto/ui/ui.h
===================================================================
RCS file: /var/cvs/src/lib/libcrypto/ui/ui.h,v
retrieving revision 1.10
diff -u -p -r1.10 ui.h
--- lib/libcrypto/ui/ui.h       19 May 2018 11:03:33 -0000      1.10
+++ lib/libcrypto/ui/ui.h       1 Jun 2018 08:57:20 -0000
@@ -312,12 +312,12 @@ int UI_method_set_flusher(UI_METHOD *met
 int UI_method_set_reader(UI_METHOD *method, int (*reader)(UI *ui, UI_STRING 
*uis));
 int UI_method_set_closer(UI_METHOD *method, int (*closer)(UI *ui));
 int UI_method_set_prompt_constructor(UI_METHOD *method, char 
*(*prompt_constructor)(UI* ui, const char* object_desc, const char* 
object_name));
-int (*UI_method_get_opener(UI_METHOD *method))(UI*);
-int (*UI_method_get_writer(UI_METHOD *method))(UI*, UI_STRING*);
-int (*UI_method_get_flusher(UI_METHOD *method))(UI*);
-int (*UI_method_get_reader(UI_METHOD *method))(UI*, UI_STRING*);
-int (*UI_method_get_closer(UI_METHOD *method))(UI*);
-char * (*UI_method_get_prompt_constructor(UI_METHOD *method))(UI*, const 
char*, const char*);
+int (*UI_method_get_opener(const UI_METHOD *method))(UI*);
+int (*UI_method_get_writer(const UI_METHOD *method))(UI*, UI_STRING*);
+int (*UI_method_get_flusher(const UI_METHOD *method))(UI*);
+int (*UI_method_get_reader(const UI_METHOD *method))(UI*, UI_STRING*);
+int (*UI_method_get_closer(const UI_METHOD *method))(UI*);
+char * (*UI_method_get_prompt_constructor(const UI_METHOD *method))(UI*, const 
char*, const char*);
 
 /* The following functions are helpers for method writers to access relevant
    data from a UI_STRING. */
Index: lib/libcrypto/ui/ui_lib.c
===================================================================
RCS file: /var/cvs/src/lib/libcrypto/ui/ui_lib.c,v
retrieving revision 1.33
diff -u -p -r1.33 ui_lib.c
--- lib/libcrypto/ui/ui_lib.c   19 May 2018 11:03:33 -0000      1.33
+++ lib/libcrypto/ui/ui_lib.c   1 Jun 2018 08:57:20 -0000
@@ -666,7 +666,7 @@ UI_method_set_prompt_constructor(UI_METH
 }
 
 int
-(*UI_method_get_opener(UI_METHOD * method))(UI *)
+(*UI_method_get_opener(const UI_METHOD * method))(UI *)
 {
        if (method)
                return method->ui_open_session;
@@ -675,7 +675,7 @@ int
 }
 
 int
-(*UI_method_get_writer(UI_METHOD *method))(UI *, UI_STRING *)
+(*UI_method_get_writer(const UI_METHOD *method))(UI *, UI_STRING *)
 {
        if (method)
                return method->ui_write_string;
@@ -684,7 +684,7 @@ int
 }
 
 int
-(*UI_method_get_flusher(UI_METHOD *method)) (UI *)
+(*UI_method_get_flusher(const UI_METHOD *method)) (UI *)
 {
        if (method)
                return method->ui_flush;
@@ -693,7 +693,7 @@ int
 }
 
 int
-(*UI_method_get_reader(UI_METHOD *method))(UI *, UI_STRING *)
+(*UI_method_get_reader(const UI_METHOD *method))(UI *, UI_STRING *)
 {
        if (method)
                return method->ui_read_string;
@@ -702,7 +702,7 @@ int
 }
 
 int
-(*UI_method_get_closer(UI_METHOD *method))(UI *)
+(*UI_method_get_closer(const UI_METHOD *method))(UI *)
 {
        if (method)
                return method->ui_close_session;
@@ -711,7 +711,7 @@ int
 }
 
 char *
-(*UI_method_get_prompt_constructor(UI_METHOD *method))(UI *, const char *,
+(*UI_method_get_prompt_constructor(const UI_METHOD *method))(UI *, const char 
*,
     const char *)
 {
        if (method)

Reply via email to