Hello together,
In the moment I want to integrate a clean, warning free, c99 compatible
OpenSSL in my library collection.
I succeded in building the OpenSSL-1.0.1d package with my own build
process with the compilers MSVC(32bit) and MingW(64bit) on windows. But
I encountered some problems and removed them. I want to share this
knowledge and send in this mail (only a part of) the removed problems
with a kind request to integrate them into the openssl package.
Kind Regards
Witold Kaminski
============================================================================================================
1. Build problems because of swapped include <e_os2.h> and depending
defines that are defined in e_os2.h
Example: crypto\bf\bf_opts.c
first lines are:
#if !defined(OPENSSL_SYS_MSDOS) && (!defined(OPENSSL_SYS_VMS) ||
defined(__DECC)) && !defined(OPENSSL_SYS_MACOSX)
#define TIMES
#endif
but #include <e_os2.h> is executed after this #define TIMES => undefined
TIMES causes problems
Affected files:
crypto\bf\bf_opts.c
crypto\bf\bfspeed.c
crypto\cast\cast_spd.c
crypto\cast\castopts.c
crypto\des\des_opts.c
crypto\des\speed.c
crypto\idea\idea_spd.c
crypto\rc2\rc2speed.c
crypto\rc4\rc4speed.c
crypto\rc5\rc5speed.c
============================================================================================================
2. Build problems because of compiler warnings, mostly not availabe type
casts or wrong types.
Affected Files/Code:
crypto\bf\bf_opts.c:
212: unsigned long d[2]; \ => BF_LONG d[2]; \
259: unsigned long data[2]; => BF_LONG data[2];
crypto\bio\b_print.c:
378:
case 'p':
value = (long)va_arg(args, void *);
fmtint(sbuffer, buffer, &currlen, maxlen,
value, 16, min, max, flags|DP_F_NUM);
break;
=>
case 'p': {
void * vptr = va_arg(args, void *);
fmtint(sbuffer, buffer, &currlen, maxlen,
(size_t)vptr, 16, min, max, flags|DP_F_NUM);
break;
}
crypto\des\des_opts.c:
454: DES_set_key_unchecked(&key,sch); => DES_set_key_unchecked(&key,&sch);
463: DES_encrypt1(data,&(sch[0]),DES_ENCRYPT); =>
DES_encrypt1(data,&sch,DES_ENCRYPT);
crypto\x509v3\tabtest.c:
73: X509V3_EXT_METHOD **tmp; => const X509V3_EXT_METHOD **tmp;
crypto\engine\eng_rsax.c:
429: if (0 == (m[7] & 0x8000000000000000)) { => if (0 == (m[7] &
0x8000000000000000ULL)) {
============================================================================================================
3. Build problems, because of wrong parameters in printf or simular
commands:
crypto\asn1\asn1_lib.c:
467: BIO_snprintf(buf1,sizeof buf1,"%lu",(unsigned long)address); =>
BIO_snprintf(buf1,sizeof buf1,"%p",address);
crypto\bio\bio_cb.c
78: BIO_snprintf(buf,sizeof buf,"BIO[%08lX]:",(unsigned long)bio); =>
BIO_snprintf(buf,sizeof buf,"BIO[%08p]:",bio);
============================================================================================================
4. Build problems because of 64/32 pointer size problems:
Integer casted pointers: Instead of types like, long, int, etc. size_t
should be used.
Affected files/Code:
ssl\s3_pkt.c
134: long align=0; => size_t align=0;
147: align = align = (long)rb->buf + SSL3_RT_HEADER_LENGTH; =>
(size_t)rb->buf + SSL3_RT_HEADER_LENGTH;
637: long align=0; => size_t align=0;
719: align = (long)wb->buf + 2*SSL3_RT_HEADER_LENGTH; => align =
(size_t)wb->buf + 2*SSL3_RT_HEADER_LENGTH;
732: align = (long)wb->buf + SSL3_RT_HEADER_LENGTH; => align =
(size_t)wb->buf + SSL3_RT_HEADER_LENGTH;
crypto\cryptlib.c:
446: id->val = (unsigned long)id->ptr; => id->val = (size_t)id->ptr;
crypto\crypto.h:
432: unsigned long val; => size_t val;
============================================================================================================
5. Build problems because of missing int in parameter list or return value:
crypto\bn\divtest.c:
21: main => int main
crypto\bn\vms-helper.c:
61: bn_div_words_abort(int i) => int bn_div_words_abort(int i)
68: added return 0;
crypto\dh\p192.c:
71: main() => int main()
crypto\dh\p512.c:
76: main() => int main()
crypto\dh\p1024.c:
83: main() => int main()
crypto\rc2\tab.c:
73: main() => int main()
crypto\x509v3\tabtest.c:
70: main() => int main()
============================================================================================================
6. Build problems because of incompatible function calls:
crypto\des\speed.c:
300: crypt("testing1","ef"); => DES_crypt("testing1","ef");
============================================================================================================
7. Build process problems because of instantiation in header file
(multiple references):
crypto\des\spr.h
59: added
extern OPENSSL_GLOBAL const DES_LONG DES_SPtrans[8][64];
#ifndef _des_spr_h_
#define _des_spr_h_
212: added
#endif
============================================================================================================
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [email protected]
Automated List Manager [email protected]