From owner-freebsd-current@FreeBSD.ORG Fri Jan 16 05:40:11 2015 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C770E856 for ; Fri, 16 Jan 2015 05:40:11 +0000 (UTC) Received: from smtp.imgsrc.co.jp (smtp.imgsrc.co.jp [210.188.236.140]) by mx1.freebsd.org (Postfix) with ESMTP id 9D85CA1E for ; Fri, 16 Jan 2015 05:40:11 +0000 (UTC) Received: from waterblue.s2factory.co.jp (waterblue.s2factory.co.jp [IPv6:2001:e41:a010:778a::313]) by smtp.imgsrc.co.jp (Postfix) with ESMTPSA id B987E1131B6 for ; Fri, 16 Jan 2015 14:40:05 +0900 (JST) Date: Fri, 16 Jan 2015 14:40:05 +0900 Message-ID: <7mppafi8qy.wl%kuriyama@FreeBSD.org> From: Jun Kuriyama To: current@FreeBSD.org Subject: [RFC] Change OpenSSL derived digest functions to return boolean values User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/24.4 Mule/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2015 05:40:11 -0000 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 // FreeBSD Project // S2 Factory, Inc.