https://wiki.openssl.org/api.php?action=feedcontributions&user=Edwintorok&feedformat=atom
OpenSSLWiki - User contributions [en]
2024-03-29T00:14:05Z
User contributions
MediaWiki 1.35.6
https://wiki.openssl.org/index.php?title=Talk:OpenSSL_1.1.0_Changes&diff=2467
Talk:OpenSSL 1.1.0 Changes
2016-09-23T13:33:57Z
<p>Edwintorok: the #ifdef mention is enough</p>
<hr />
<div><br />
== Converting code to be compatible with both OpenSSL 1.0.x and 1.1.x ==<br />
<br />
Small correction to the example at [[1.1_API_Changes#Adding_forward-compatible_code_to_older_versions]]:<br />
<br />
<tt>HMAC_CTX_reset</tt>, and <tt>EVP_MD_CTX_free</tt> are OpenSSL 1.1 APIs themselves so their use should be avoided in the <tt>#if</tt> section.<br />
<br />
Suggested example:<br />
<br />
<code><br />
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined (LIBRESSL_VERSION_NUMBER)<br />
static HMAC_CTX *HMAC_CTX_new(void)<br />
{<br />
HMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));<br />
if (ctx != NULL)<br />
HMAC_CTX_init(ctx);<br />
return ctx;<br />
}<br />
<br />
static void HMAC_CTX_free(HMAC_CTX *ctx)<br />
{<br />
if (ctx != NULL) {<br />
HMAC_CTX_cleanup(ctx);<br />
OPENSSL_free(ctx);<br />
}<br />
}<br />
#endif<br />
</code><br />
<br />
Similarly examples for other APIs that I encountered:<br />
<code><br />
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined (LIBRESSL_VERSION_NUMBER)<br />
#define EVP_MD_CTX_new EVP_MD_CTX_create<br />
#define EVP_MD_CTX_free EVP_MD_CTX_destroy<br />
#endif<br />
<br />
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)<br />
#define ASN1_STRING_get0_data(x) ASN1_STRING_data(x)<br />
#endif<br />
</code><br />
--[[User:Edwintorok|Edwintorok]] ([[User talk:Edwintorok|talk]]) 13:30, 23 September 2016 (UTC)</div>
Edwintorok
https://wiki.openssl.org/index.php?title=Talk:OpenSSL_1.1.0_Changes&diff=2466
Talk:OpenSSL 1.1.0 Changes
2016-09-23T13:30:09Z
<p>Edwintorok: sign my edit</p>
<hr />
<div><br />
== Converting code to be compatible with both OpenSSL 1.0.x and 1.1.x ==<br />
<br />
Small correction to the example at [[1.1_API_Changes#Adding_forward-compatible_code_to_older_versions]]:<br />
<br />
<tt>HMAC_CTX_reset</tt>, and <tt>EVP_MD_CTX_free</tt> are OpenSSL 1.1 APIs themselves so their use should be avoided in the <tt>#if</tt> section.<br />
Also LibreSSL claims to be <tt>OPENSSL_VERSION_NUMBER 0x20000000L</tt>, but doesn't support the new OpenSSL 1.1.0 API yet.<br />
<br />
Suggested example:<br />
<br />
<code><br />
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined (LIBRESSL_VERSION_NUMBER)<br />
static HMAC_CTX *HMAC_CTX_new(void)<br />
{<br />
HMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));<br />
if (ctx != NULL)<br />
HMAC_CTX_init(ctx);<br />
return ctx;<br />
}<br />
<br />
static void HMAC_CTX_free(HMAC_CTX *ctx)<br />
{<br />
if (ctx != NULL) {<br />
HMAC_CTX_cleanup(ctx);<br />
OPENSSL_free(ctx);<br />
}<br />
}<br />
#endif<br />
</code><br />
<br />
Similarly examples for other APIs that I encountered:<br />
<code><br />
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined (LIBRESSL_VERSION_NUMBER)<br />
#define EVP_MD_CTX_new EVP_MD_CTX_create<br />
#define EVP_MD_CTX_free EVP_MD_CTX_destroy<br />
#endif<br />
<br />
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)<br />
#define ASN1_STRING_get0_data(x) ASN1_STRING_data(x)<br />
#endif<br />
</code><br />
--[[User:Edwintorok|Edwintorok]] ([[User talk:Edwintorok|talk]]) 13:30, 23 September 2016 (UTC)</div>
Edwintorok
https://wiki.openssl.org/index.php?title=Talk:OpenSSL_1.1.0_Changes&diff=2465
Talk:OpenSSL 1.1.0 Changes
2016-09-23T13:29:38Z
<p>Edwintorok: Correction to 1.0.x/1.1.x compatibility example</p>
<hr />
<div><br />
== Converting code to be compatible with both OpenSSL 1.0.x and 1.1.x ==<br />
<br />
Small correction to the example at [[1.1_API_Changes#Adding_forward-compatible_code_to_older_versions]]:<br />
<br />
<tt>HMAC_CTX_reset</tt>, and <tt>EVP_MD_CTX_free</tt> are OpenSSL 1.1 APIs themselves so their use should be avoided in the <tt>#if</tt> section.<br />
Also LibreSSL claims to be <tt>OPENSSL_VERSION_NUMBER 0x20000000L</tt>, but doesn't support the new OpenSSL 1.1.0 API yet.<br />
<br />
Suggested example:<br />
<br />
<code><br />
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined (LIBRESSL_VERSION_NUMBER)<br />
static HMAC_CTX *HMAC_CTX_new(void)<br />
{<br />
HMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));<br />
if (ctx != NULL)<br />
HMAC_CTX_init(ctx);<br />
return ctx;<br />
}<br />
<br />
static void HMAC_CTX_free(HMAC_CTX *ctx)<br />
{<br />
if (ctx != NULL) {<br />
HMAC_CTX_cleanup(ctx);<br />
OPENSSL_free(ctx);<br />
}<br />
}<br />
#endif<br />
</code><br />
<br />
Similarly examples for other APIs that I encountered:<br />
<code><br />
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined (LIBRESSL_VERSION_NUMBER)<br />
#define EVP_MD_CTX_new EVP_MD_CTX_create<br />
#define EVP_MD_CTX_free EVP_MD_CTX_destroy<br />
#endif<br />
<br />
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)<br />
#define ASN1_STRING_get0_data(x) ASN1_STRING_data(x)<br />
#endif<br />
</code></div>
Edwintorok