Changeset 94082 in vbox for trunk/src/libs/openssl-3.0.1/crypto/bio/bss_acpt.c
- Timestamp:
- Mar 3, 2022 7:17:34 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 150325
- Location:
- trunk/src/libs/openssl-3.0.1
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/openssl-3.0.1
- Property svn:mergeinfo
-
old new 12 12 /vendor/openssl/1.1.1c:131722-131725 13 13 /vendor/openssl/1.1.1k:145841-145843 14 /vendor/openssl/3.0.1:150323-150324 15 /vendor/openssl/current:147554-150322
-
- Property svn:mergeinfo
-
trunk/src/libs/openssl-3.0.1/crypto/bio/bss_acpt.c
r91772 r94082 1 1 /* 2 * Copyright 1995-202 0The OpenSSL Project Authors. All Rights Reserved.2 * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. 3 3 * 4 * Licensed under the OpenSSL license(the "License"). You may not use4 * Licensed under the Apache License 2.0 (the "License"). You may not use 5 5 * this file except in compliance with the License. You can obtain a copy 6 6 * in the file LICENSE in the source distribution or at 7 7 * https://www.openssl.org/source/license.html 8 8 */ 9 10 #define OPENSSL_SUPPRESS_DEPRECATED 9 11 10 12 #include <stdio.h> … … 55 57 BIO_TYPE_ACCEPT, 56 58 "socket accept", 57 /* TODO: Convert to new style write function */58 59 bwrite_conv, 59 60 acpt_write, 60 /* TODO: Convert to new style read function */61 61 bread_conv, 62 62 acpt_read, … … 94 94 95 95 if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 96 BIOerr(BIO_F_BIO_ACCEPT_NEW, ERR_R_MALLOC_FAILURE);96 ERR_raise(ERR_LIB_BIO, ERR_R_MALLOC_FAILURE); 97 97 return NULL; 98 98 } … … 157 157 case ACPT_S_BEFORE: 158 158 if (c->param_addr == NULL && c->param_serv == NULL) { 159 BIOerr(BIO_F_ACPT_STATE, BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED);160 ERR_add_error_data(4,161 "hostname=", c->param_addr,162 " service=", c->param_serv);159 ERR_raise_data(ERR_LIB_BIO, 160 BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED, 161 "hostname=%s, service=%s", 162 c->param_addr, c->param_serv); 163 163 goto exit_loop; 164 164 } … … 193 193 } else { 194 194 #endif 195 BIOerr(BIO_F_ACPT_STATE, BIO_R_UNAVAILABLE_IP_FAMILY);195 ERR_raise(ERR_LIB_BIO, BIO_R_UNAVAILABLE_IP_FAMILY); 196 196 goto exit_loop; 197 197 } … … 204 204 break; 205 205 default: 206 BIOerr(BIO_F_ACPT_STATE, BIO_R_UNSUPPORTED_IP_FAMILY);206 ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_IP_FAMILY); 207 207 goto exit_loop; 208 208 } … … 212 212 } 213 213 if (c->addr_first == NULL) { 214 BIOerr(BIO_F_ACPT_STATE, BIO_R_LOOKUP_RETURNED_NOTHING);214 ERR_raise(ERR_LIB_BIO, BIO_R_LOOKUP_RETURNED_NOTHING); 215 215 goto exit_loop; 216 216 } 217 /* We're currently not iterating, but set this as preparation218 * for possible future development in that regard219 */220 217 c->addr_iter = c->addr_first; 221 218 c->state = ACPT_S_CREATE_SOCKET; … … 223 220 224 221 case ACPT_S_CREATE_SOCKET: 222 ERR_set_mark(); 225 223 s = BIO_socket(BIO_ADDRINFO_family(c->addr_iter), 226 224 BIO_ADDRINFO_socktype(c->addr_iter), 227 225 BIO_ADDRINFO_protocol(c->addr_iter), 0); 228 226 if (s == (int)INVALID_SOCKET) { 229 SYSerr(SYS_F_SOCKET, get_last_socket_error()); 230 ERR_add_error_data(4, 231 "hostname=", c->param_addr, 232 " service=", c->param_serv); 233 BIOerr(BIO_F_ACPT_STATE, BIO_R_UNABLE_TO_CREATE_SOCKET); 227 if ((c->addr_iter = BIO_ADDRINFO_next(c->addr_iter)) != NULL) { 228 /* 229 * if there are more addresses to try, do that first 230 */ 231 ERR_pop_to_mark(); 232 break; 233 } 234 ERR_clear_last_mark(); 235 ERR_raise_data(ERR_LIB_SYS, get_last_socket_error(), 236 "calling socket(%s, %s)", 237 c->param_addr, c->param_serv); 238 ERR_raise(ERR_LIB_BIO, BIO_R_UNABLE_TO_CREATE_SOCKET); 234 239 goto exit_loop; 235 240 } … … 307 312 goto exit_loop; 308 313 314 BIO_set_callback_ex(bio, BIO_get_callback_ex(b)); 315 #ifndef OPENSSL_NO_DEPRECATED_3_0 309 316 BIO_set_callback(bio, BIO_get_callback(b)); 317 #endif 310 318 BIO_set_callback_arg(bio, BIO_get_callback_arg(b)); 311 312 319 /* 313 320 * If the accept BIO has an bio_chain, we dup it and put the new
Note:
See TracChangeset
for help on using the changeset viewer.