[openssl-commits] [openssl] master update

Matt Caswell matt at openssl.org
Mon Aug 15 22:33:05 UTC 2016


The branch master has been updated
       via  40c60b0d7389aa479cf7474a080737e901944d0d (commit)
       via  e7e5d608fb6cef9929a2cf56d72fa7e236ca7573 (commit)
       via  3f8d1216df7a4314fca77b6ee6fe9fc814fcd909 (commit)
      from  bb982ce7532eb5f5f8d66211d556940a7f407496 (commit)


- Log -----------------------------------------------------------------
commit 40c60b0d7389aa479cf7474a080737e901944d0d
Author: Tomas Mraz <tmraz at fedoraproject.org>
Date:   Mon Aug 15 12:02:06 2016 +0200

    Avoid truncating the pointer on x32 platform.
    
    The 64 bit pointer must not be cast to 32bit unsigned long on
    x32 platform.
    
    Reviewed-by: Tim Hudson <tjh at openssl.org>
    Reviewed-by: Matt Caswell <matt at openssl.org>

commit e7e5d608fb6cef9929a2cf56d72fa7e236ca7573
Author: Tomas Mraz <tmraz at fedoraproject.org>
Date:   Wed Aug 10 15:21:32 2016 +0200

    Add a comment for the added cast with explanation.
    
    Reviewed-by: Tim Hudson <tjh at openssl.org>
    Reviewed-by: Matt Caswell <matt at openssl.org>

commit 3f8d1216df7a4314fca77b6ee6fe9fc814fcd909
Author: Tomas Mraz <tmraz at fedoraproject.org>
Date:   Tue Aug 9 12:50:13 2016 +0200

    Fix af_alg engine failure on 32 bit architectures.
    
    Add extra cast to unsigned long to avoid sign extension when
    converting pointer to 64 bit data.
    
    Reviewed-by: Tim Hudson <tjh at openssl.org>
    Reviewed-by: Matt Caswell <matt at openssl.org>

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

Summary of changes:
 engines/afalg/e_afalg.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/engines/afalg/e_afalg.c b/engines/afalg/e_afalg.c
index 2e7ce34..2ea5ba5 100644
--- a/engines/afalg/e_afalg.c
+++ b/engines/afalg/e_afalg.c
@@ -230,7 +230,15 @@ int afalg_fin_cipher_aio(afalg_aio *aio, int sfd, unsigned char *buf,
     memset(cb, '\0', sizeof(*cb));
     cb->aio_fildes = sfd;
     cb->aio_lio_opcode = IOCB_CMD_PREAD;
-    cb->aio_buf = (uint64_t)buf;
+    if (sizeof(buf) != sizeof(cb->aio_buf)) {
+        /*
+         * The pointer has to be converted to 32 bit unsigned value first
+         * to avoid sign extension on cast to 64 bit value
+         */
+        cb->aio_buf = (uint64_t)(unsigned long)buf;
+    } else {
+        cb->aio_buf = (uint64_t)buf;
+    }
     cb->aio_offset = 0;
     cb->aio_data = 0;
     cb->aio_nbytes = len;


More information about the openssl-commits mailing list