[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Fri Oct 28 22:58:02 UTC 2016


The branch master has been updated
       via  4e3973b457d42172711e2c556362826b02c44169 (commit)
       via  b509b6d787354141e776344782e46ab4c49cb6e9 (commit)
      from  f7970f303f849f0d0c8eb1717efd35b559c47964 (commit)


- Log -----------------------------------------------------------------
commit 4e3973b457d42172711e2c556362826b02c44169
Author: Benjamin Kaduk <bkaduk at akamai.com>
Date:   Fri Oct 28 11:53:00 2016 -0500

    Try to unify BIO read/write parameter names
    
    After the recent reworking, not everything matched up, and some
    comments didn't catch up to the outl-->dlen and inl-->dlen renames
    that happened during the development of the recent patches.
    
    Try to make parameter names consistent across header, implementation,
    and manual pages.
    
    Also remove some trailing whitespace that was inadvertently introduced.
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/1798)

commit b509b6d787354141e776344782e46ab4c49cb6e9
Author: Benjamin Kaduk <bkaduk at akamai.com>
Date:   Wed Aug 31 17:06:22 2016 -0500

    Wordsmith INSTALL
    
    Make it clear that the OPENSSL_LOCAL_CONFIG_DIR settings take
    precedence over the in-tree configs.
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/1798)

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

Summary of changes:
 INSTALL                       |  4 ++--
 crypto/bio/bio_lib.c          | 24 +++++++++++-----------
 doc/man3/BIO_read.pod         | 18 ++++++++---------
 doc/man3/BIO_set_callback.pod | 46 +++++++++++++++++++++----------------------
 include/openssl/bio.h         |  2 +-
 5 files changed, 47 insertions(+), 47 deletions(-)

diff --git a/INSTALL b/INSTALL
index de127df..44b3a1c 100644
--- a/INSTALL
+++ b/INSTALL
@@ -806,8 +806,8 @@
                 possible to create your own ".conf" and ".tmpl" files and store
                 them locally, outside the OpenSSL source tree. This environment
                 variable can be set to the directory where these files are held
-                and will have Configure to consider them in addition to the
-                standard ones.
+                and will be considered by Configure before it looks in the
+                standard directories.
 
  PERL
                 The name of the Perl executable to use when building OpenSSL.
diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c
index 2bd337c..c14e238 100644
--- a/crypto/bio/bio_lib.c
+++ b/crypto/bio/bio_lib.c
@@ -295,7 +295,7 @@ int BIO_read(BIO *b, void *data, int dlen)
     ret = bio_read_intern(b, data, (size_t)dlen, &readbytes);
 
     if (ret > 0) {
-        /* *readbytes should always be <= outl */
+        /* *readbytes should always be <= dlen */
         ret = (int)readbytes;
     }
 
@@ -362,7 +362,7 @@ int BIO_write(BIO *b, const void *data, int dlen)
     ret = bio_write_intern(b, data, (size_t)dlen, &written);
 
     if (ret > 0) {
-        /* *written should always be <= inl */
+        /* *written should always be <= dlen */
         ret = (int)written;
     }
 
@@ -383,7 +383,7 @@ int BIO_write_ex(BIO *b, const void *data, size_t dlen, size_t *written)
     return ret;
 }
 
-int BIO_puts(BIO *b, const char *in)
+int BIO_puts(BIO *b, const char *buf)
 {
     int ret;
     size_t written = 0;
@@ -394,7 +394,7 @@ int BIO_puts(BIO *b, const char *in)
     }
 
     if (b->callback != NULL || b->callback_ex != NULL) {
-        ret = (int)bio_call_callback(b, BIO_CB_PUTS, in, 0, 0, 0L, 1L, NULL);
+        ret = (int)bio_call_callback(b, BIO_CB_PUTS, buf, 0, 0, 0L, 1L, NULL);
         if (ret <= 0)
             return ret;
     }
@@ -404,7 +404,7 @@ int BIO_puts(BIO *b, const char *in)
         return -2;
     }
 
-    ret = b->method->bputs(b, in);
+    ret = b->method->bputs(b, buf);
 
     if (ret > 0) {
         b->num_write += (uint64_t)ret;
@@ -413,7 +413,7 @@ int BIO_puts(BIO *b, const char *in)
     }
 
     if (b->callback != NULL || b->callback_ex != NULL)
-        ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, in, 0, 0,
+        ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
                                      0L, ret, &written);
 
     if (ret > 0) {
@@ -428,7 +428,7 @@ int BIO_puts(BIO *b, const char *in)
     return ret;
 }
 
-int BIO_gets(BIO *b, char *out, int outl)
+int BIO_gets(BIO *b, char *buf, int size)
 {
     int ret;
     size_t readbytes = 0;
@@ -438,13 +438,13 @@ int BIO_gets(BIO *b, char *out, int outl)
         return (-2);
     }
 
-    if (outl < 0) {
+    if (size < 0) {
         BIOerr(BIO_F_BIO_GETS, BIO_R_INVALID_ARGUMENT);
         return 0;
     }
 
     if (b->callback != NULL || b->callback_ex != NULL) {
-        ret = (int)bio_call_callback(b, BIO_CB_GETS, out, outl, 0, 0L, 1, NULL);
+        ret = (int)bio_call_callback(b, BIO_CB_GETS, buf, size, 0, 0L, 1, NULL);
         if (ret <= 0)
             return ret;
     }
@@ -454,7 +454,7 @@ int BIO_gets(BIO *b, char *out, int outl)
         return (-2);
     }
 
-    ret = b->method->bgets(b, out, outl);
+    ret = b->method->bgets(b, buf, size);
 
     if (ret > 0) {
         readbytes = ret;
@@ -462,12 +462,12 @@ int BIO_gets(BIO *b, char *out, int outl)
     }
 
     if (b->callback != NULL || b->callback_ex != NULL)
-        ret = (int)bio_call_callback(b, BIO_CB_GETS | BIO_CB_RETURN, out, outl,
+        ret = (int)bio_call_callback(b, BIO_CB_GETS | BIO_CB_RETURN, buf, size,
                                      0, 0L, ret, &readbytes);
 
     if (ret > 0) {
         /* Shouldn't happen */
-        if (readbytes > (size_t)outl)
+        if (readbytes > (size_t)size)
             ret = -1;
         else
             ret = (int)readbytes;
diff --git a/doc/man3/BIO_read.pod b/doc/man3/BIO_read.pod
index 6baa075..bd9bb8f 100644
--- a/doc/man3/BIO_read.pod
+++ b/doc/man3/BIO_read.pod
@@ -9,21 +9,21 @@ BIO_read_ex, BIO_write_ex, BIO_read, BIO_write, BIO_gets, BIO_puts
 
  #include <openssl/bio.h>
 
- int BIO_read_ex(BIO *b, void *out, size_t outl, size_t *read);
- int BIO_write_ex(BIO *b, const void *in, size_t inl, size_t *written);
+ int BIO_read_ex(BIO *b, void *data, size_t dlen, size_t *readbytes);
+ int BIO_write_ex(BIO *b, const void *data, size_t dlen, size_t *written);
 
- int BIO_read(BIO *b, void *buf, int len);
+ int BIO_read(BIO *b, void *data, int dlen);
  int BIO_gets(BIO *b, char *buf, int size);
- int BIO_write(BIO *b, const void *buf, int len);
+ int BIO_write(BIO *b, const void *data, int dlen);
  int BIO_puts(BIO *b, const char *buf);
 
 =head1 DESCRIPTION
 
-BIO_read_ex() attempts to read B<outl> bytes from BIO B<b> and places the data
-in B<out>. If any bytes were successfully read then the number of bytes read is
-stored in B<*read>.
+BIO_read_ex() attempts to read B<dlen> bytes from BIO B<b> and places the data
+in B<data>. If any bytes were successfully read then the number of bytes read is
+stored in B<*readbytes>.
 
-BIO_write_ex() attempts to write B<inl> bytes from B<in> to BIO B<b>. If
+BIO_write_ex() attempts to write B<dlen> bytes from B<data> to BIO B<b>. If
 successful then the number of bytes written is stored in B<*written>.
 
 BIO_read() attempts to read B<len> bytes from BIO B<b> and places
@@ -31,7 +31,7 @@ the data in B<buf>.
 
 BIO_gets() performs the BIOs "gets" operation and places the data
 in B<buf>. Usually this operation will attempt to read a line of data
-from the BIO of maximum length B<len-1>. There are exceptions to this,
+from the BIO of maximum length B<size-1>. There are exceptions to this,
 however; for example, BIO_gets() on a digest BIO will calculate and
 return the digest and other BIOs may not support BIO_gets() at all.
 The returned string is always NUL-terminated.
diff --git a/doc/man3/BIO_set_callback.pod b/doc/man3/BIO_set_callback.pod
index 6e5656f..f53e7bd 100644
--- a/doc/man3/BIO_set_callback.pod
+++ b/doc/man3/BIO_set_callback.pod
@@ -76,7 +76,7 @@ the value of B<oper>, that is the operation being performed.
 =item B<processed>
 
 B<processed> is a pointer to a location which will be updated with the amount of
-data that was actually read or written. Only used for BIO_CB_READ, BIO_CB_WRITE, 
+data that was actually read or written. Only used for BIO_CB_READ, BIO_CB_WRITE,
 BIO_CB_GETS and BIO_CB_PUTS.
 
 =item B<ret>
@@ -111,75 +111,75 @@ or
 
 is called before the free operation.
 
-=item B<BIO_read_ex(b, out, outl, read)>
+=item B<BIO_read_ex(b, data, dlen, readbytes)>
 
- callback_ex(b, BIO_CB_READ, out, outl, 0, 0L, 1L, read)
+ callback_ex(b, BIO_CB_READ, data, dlen, 0, 0L, 1L, readbytes)
 
 or
 
- callback(b, BIO_CB_READ, out, outl, 0L, 1L)
- 
+ callback(b, BIO_CB_READ, data, dlen, 0L, 1L)
+
 is called before the read and
 
- callback_ex(b, BIO_CB_READ | BIO_CB_RETURN, out, outl, 0, 0L, retvalue, read)
+ callback_ex(b, BIO_CB_READ | BIO_CB_RETURN, data, dlen, 0, 0L, retvalue, readbytes)
 
 or
 
- callback(b, BIO_CB_READ|BIO_CB_RETURN, out, outl, 0L, retvalue)
+ callback(b, BIO_CB_READ|BIO_CB_RETURN, data, dlen, 0L, retvalue)
 
 after.
 
-=item B<BIO_write(b, in, inl, written)>
+=item B<BIO_write(b, data, dlen, written)>
 
- callback_ex(b, BIO_CB_WRITE, in, inl, 0, 0L, 1L, written)
+ callback_ex(b, BIO_CB_WRITE, data, dlen, 0, 0L, 1L, written)
 
 or
 
- callback(b, BIO_CB_WRITE, in, inl, 0L, 1L)
+ callback(b, BIO_CB_WRITE, datat, dlen, 0L, 1L)
 
 is called before the write and
 
- callback_ex(b, BIO_CB_WRITE | BIO_CB_RETURN, in, inl, 0, 0L, retvalue, written)
+ callback_ex(b, BIO_CB_WRITE | BIO_CB_RETURN, data, dlen, 0, 0L, retvalue, written)
 
 or
 
- callback(b, BIO_CB_WRITE|BIO_CB_RETURN, in, inl, 0L, retvalue)
+ callback(b, BIO_CB_WRITE|BIO_CB_RETURN, data, dlen, 0L, retvalue)
 
 after.
 
-=item B<BIO_gets(b, out, outl)>
+=item B<BIO_gets(b, buf, size)>
 
- callback_ex(b, BIO_CB_GETS, out, outl, 0, 0L, 1, NULL, NULL)
+ callback_ex(b, BIO_CB_GETS, buf, size, 0, 0L, 1, NULL, NULL)
 
 or
 
- callback(b, BIO_CB_GETS, out, outl, 0L, 1L)
+ callback(b, BIO_CB_GETS, buf, size, 0L, 1L)
 
 is called before the operation and
 
- callback_ex(b, BIO_CB_GETS | BIO_CB_RETURN, out, outl, 0, 0L, retvalue, read)
+ callback_ex(b, BIO_CB_GETS | BIO_CB_RETURN, buf, size, 0, 0L, retvalue, readbytes)
 
 or
 
- callback(b, BIO_CB_GETS|BIO_CB_RETURN, out, outl, 0L, retvalue)
+ callback(b, BIO_CB_GETS|BIO_CB_RETURN, buf, size, 0L, retvalue)
 
 after.
 
-=item B<BIO_puts(b, in)>
+=item B<BIO_puts(b, buf)>
 
- callback_ex(b, BIO_CB_PUTS, in, 0, 0, 0L, 1L, NULL);
+ callback_ex(b, BIO_CB_PUTS, buf, 0, 0, 0L, 1L, NULL);
 
 or
 
- callback(b, BIO_CB_PUTS, in, 0, 0L, 1L)
+ callback(b, BIO_CB_PUTS, buf, 0, 0L, 1L)
 
 is called before the operation and
 
- callback_ex(b, BIO_CB_PUTS | BIO_CB_RETURN, in, 0, 0, 0L, retvalue, written)
+ callback_ex(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0, 0L, retvalue, written)
 
 or
 
- callback(b, BIO_CB_WRITE|BIO_CB_RETURN, in, 0, 0L, retvalue)
+ callback(b, BIO_CB_WRITE|BIO_CB_RETURN, buf, 0, 0L, retvalue)
 
 after.
 
@@ -198,7 +198,7 @@ is called before the call and
 or
 
  callback(b, BIO_CB_CTRL|BIO_CB_RETURN, parg, cmd, larg, ret)
- 
+
 after.
 
 =back
diff --git a/include/openssl/bio.h b/include/openssl/bio.h
index 4b80719..2fb9023 100644
--- a/include/openssl/bio.h
+++ b/include/openssl/bio.h
@@ -552,7 +552,7 @@ int BIO_get_shutdown(BIO *a);
 void BIO_vfree(BIO *a);
 int BIO_up_ref(BIO *a);
 int BIO_read(BIO *b, void *data, int dlen);
-int BIO_read_ex(BIO *b, void *data, size_t dlen, size_t *read);
+int BIO_read_ex(BIO *b, void *data, size_t dlen, size_t *readbytes);
 int BIO_gets(BIO *bp, char *buf, int size);
 int BIO_write(BIO *b, const void *data, int dlen);
 int BIO_write_ex(BIO *b, const void *data, size_t dlen, size_t *written);


More information about the openssl-commits mailing list