[RFC] Change OpenSSL derived digest functions to return boolean values

From: Jun Kuriyama <kuriyama_at_FreeBSD.org>
Date: Fri, 16 Jan 2015 14:40:05 +0900
Hi,

I put a patch to Phabricator and Github.

https://reviews.freebsd.org/D1542
https://github.com/kuriyama/freebsd/compare/openssl-digest-return-value

Any comments are welcome!


DESCRIPTION

OpenSSL changed return value type of *_{Init,Update,Final}() functions
at 2001 [1].  Our implementations at libmd do not follow these changes.

[1] https://github.com/openssl/openssl/commit/2dc769a1c17e1e0c7aef6e11496c8ba2c1db2e28


BACKGROUND

I noticed this problem during using install(1) with net/nss_ldap,
net/openldap24-client and ldaps:// protocol.  While install(1) is
linked with libmd, but ports libldap is compiled with libcrypto to
expect OpenSSL's SHA1_Update() function.  When using install(1) in this
situation, install(1) uses libmd's SHA1_Update(), but wrapping
functions in OpenSSL expects SHA1_Update() to return boolean. This
causes sometimes fails SHA1_Update() (which depends on value of EAX
register?) call.

Problem is, we have SHA1_Update() functions in libmd and libcrypto,
and both has different return value types.  This should be same if they
provides identical functionality.


TBD

Should adjust {SHA{256,512}_,MDX}{Init,Update,Final}() functions, too?


-- 
Jun Kuriyama <kuriyama_at_FreeBSD.org> // FreeBSD Project
         <kuriyama_at_s2factory.co.jp> // S2 Factory, Inc.
Received on Fri Jan 16 2015 - 04:40:11 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:54 UTC