Imported OpenSSL 1.1.1b
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -782,7 +782,12 @@ int BIO_lookup_ex(const char *host, const char *service, int lookup_type,
|
||||
* anyway [above getaddrinfo/gai_strerror is]. We just let
|
||||
* system administrator figure this out...
|
||||
*/
|
||||
# if defined(OPENSSL_SYS_VXWORKS)
|
||||
/* h_errno doesn't exist on VxWorks */
|
||||
SYSerr(SYS_F_GETHOSTBYNAME, 1000 );
|
||||
# else
|
||||
SYSerr(SYS_F_GETHOSTBYNAME, 1000 + h_errno);
|
||||
# endif
|
||||
#else
|
||||
SYSerr(SYS_F_GETHOSTBYNAME, WSAGetLastError());
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -253,9 +253,7 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
}
|
||||
# elif defined(OPENSSL_SYS_WIN32_CYGWIN)
|
||||
int fd = fileno((FILE *)ptr);
|
||||
if (num & BIO_FP_TEXT)
|
||||
setmode(fd, O_TEXT);
|
||||
else
|
||||
if (!(num & BIO_FP_TEXT))
|
||||
setmode(fd, O_BINARY);
|
||||
# endif
|
||||
}
|
||||
@@ -279,11 +277,14 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
ret = 0;
|
||||
break;
|
||||
}
|
||||
# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32_CYGWIN)
|
||||
# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS)
|
||||
if (!(num & BIO_FP_TEXT))
|
||||
OPENSSL_strlcat(p, "b", sizeof(p));
|
||||
else
|
||||
OPENSSL_strlcat(p, "t", sizeof(p));
|
||||
# elif defined(OPENSSL_SYS_WIN32_CYGWIN)
|
||||
if (!(num & BIO_FP_TEXT))
|
||||
OPENSSL_strlcat(p, "b", sizeof(p));
|
||||
# endif
|
||||
fp = openssl_fopen(ptr, p);
|
||||
if (fp == NULL) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -20,7 +20,7 @@ static long mem_ctrl(BIO *h, int cmd, long arg1, void *arg2);
|
||||
static int mem_new(BIO *h);
|
||||
static int secmem_new(BIO *h);
|
||||
static int mem_free(BIO *data);
|
||||
static int mem_buf_free(BIO *data, int free_all);
|
||||
static int mem_buf_free(BIO *data);
|
||||
static int mem_buf_sync(BIO *h);
|
||||
|
||||
static const BIO_METHOD mem_method = {
|
||||
@@ -140,10 +140,20 @@ static int secmem_new(BIO *bi)
|
||||
|
||||
static int mem_free(BIO *a)
|
||||
{
|
||||
return mem_buf_free(a, 1);
|
||||
BIO_BUF_MEM *bb;
|
||||
|
||||
if (a == NULL)
|
||||
return 0;
|
||||
|
||||
bb = (BIO_BUF_MEM *)a->ptr;
|
||||
if (!mem_buf_free(a))
|
||||
return 0;
|
||||
OPENSSL_free(bb->readp);
|
||||
OPENSSL_free(bb);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int mem_buf_free(BIO *a, int free_all)
|
||||
static int mem_buf_free(BIO *a)
|
||||
{
|
||||
if (a == NULL)
|
||||
return 0;
|
||||
@@ -155,11 +165,6 @@ static int mem_buf_free(BIO *a, int free_all)
|
||||
if (a->flags & BIO_FLAGS_MEM_RDONLY)
|
||||
b->data = NULL;
|
||||
BUF_MEM_free(b);
|
||||
if (free_all) {
|
||||
OPENSSL_free(bb->readp);
|
||||
OPENSSL_free(bb);
|
||||
}
|
||||
a->ptr = NULL;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -266,11 +271,10 @@ static long mem_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
}
|
||||
break;
|
||||
case BIO_C_SET_BUF_MEM:
|
||||
mem_buf_free(b, 0);
|
||||
mem_buf_free(b);
|
||||
b->shutdown = (int)num;
|
||||
bbm->buf = ptr;
|
||||
*bbm->readp = *bbm->buf;
|
||||
b->ptr = bbm;
|
||||
break;
|
||||
case BIO_C_GET_BUF_MEM_PTR:
|
||||
if (ptr != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user