]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: don't use OpenSSL's ERR_PACK.
authorAdam Langley <agl@google.com>
Wed, 7 Dec 2016 20:18:21 +0000 (12:18 -0800)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 7 Dec 2016 22:53:03 +0000 (23:53 +0100)
ERR_PACK is an internal detail of OpenSSL. Also, when using it, a
function name must be specified which is overly specific: the test will
break whenever OpenSSL internally change things so that a different
function creates the error.

Closes #1157

lib/vtls/openssl.c

index 8507f866f7431957f20d3603e7de0dee1c0972cc..559e710871b118fb9ea83f2fe13e6ac107a60259 100644 (file)
@@ -3159,8 +3159,8 @@ static ssize_t ossl_send(struct connectdata *conn,
       /*  A failure in the SSL library occurred, usually a protocol error.
           The OpenSSL error queue contains more information on the error. */
       sslerror = ERR_get_error();
-      if(sslerror ==
-         ERR_PACK(ERR_LIB_SSL, SSL_F_SSL3_WRITE_PENDING, SSL_R_BIO_NOT_SET) &&
+      if(ERR_GET_LIB(sslerror) == ERR_LIB_SSL &&
+         ERR_GET_REASON(sslerror) == SSL_R_BIO_NOT_SET &&
          conn->ssl[sockindex].state == ssl_connection_complete &&
          conn->proxy_ssl[sockindex].state == ssl_connection_complete) {
         char ver[120];