Hi,

When building the OpenSSL 1.0.2i with -DHAVE_CRYPTODEV flag the build will fail 
in crypto/engine/eng_cryptodev.c. I am using 64-bit Ubuntu 14.04 in my build 
machine with gcc toolchain. 

For me it looks like there has been a typo in the OPENSSL_malloc return value 
check. Attached patch solves the issue. Below is the original error message:

| gcc -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include  -fPIC 
-DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H 
-DL_ENDIAN      -DTERMIO -i/build/tmp/sysroots/x86_64-linux/usr/include -O2 
-pipe -Wall -Wa,--noexecstack -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS 
-DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 
-DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM 
-DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM 
-DECP_NISTZ256_ASM -ibuild/tmp/sysroots/x86_64-linux/usr/include  -c -o 
eng_cryptodev.o eng_cryptodev.c
| eng_cryptodev.c: In function 'cryptodev_digest_copy':
| eng_cryptodev.c:942:23: error: 'struct dev_crypto_state' has no member named 
'ac_data'
|              if (dstate->ac_data == NULL) {
|                        ^
| make[2]: *** [eng_cryptodev.o] Error 1


Kind regards,
Jan-Markus Pumpanen

----------------------------------------------------------------
Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.


-- 
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4686
Please log in as guest with password guest if prompted

--- clean-openssl-1.0.2i/crypto/engine/eng_cryptodev.c	2016-09-22 13:23:06.000000000 +0300
+++ openssl-1.0.2i/crypto/engine/eng_cryptodev.c	2016-09-26 16:07:24.724568163 +0300
@@ -939,7 +939,7 @@
     if (fstate->mac_len != 0) {
         if (fstate->mac_data != NULL) {
             dstate->mac_data = OPENSSL_malloc(fstate->mac_len);
-            if (dstate->ac_data == NULL) {
+            if (dstate->mac_data == NULL) {
                 printf("cryptodev_digest_init: malloc failed\n");
                 return 0;
             }
-- 
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev

Reply via email to