VirtualBox

Ignore:
Timestamp:
Mar 3, 2022 7:17:34 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
150325
Message:

libs/openssl-3.0.1: started applying and adjusting our OpenSSL changes to 3.0.1. bugref:10128

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  
        1212/vendor/openssl/1.1.1c:131722-131725
        1313/vendor/openssl/1.1.1k:145841-145843
         14/vendor/openssl/3.0.1:150323-150324
         15/vendor/openssl/current:147554-150322
  • trunk/src/libs/openssl-3.0.1/crypto/bio/bss_acpt.c

    r91772 r94082  
    11/*
    2  * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
     2 * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
    33 *
    4  * Licensed under the OpenSSL license (the "License").  You may not use
     4 * Licensed under the Apache License 2.0 (the "License").  You may not use
    55 * this file except in compliance with the License.  You can obtain a copy
    66 * in the file LICENSE in the source distribution or at
    77 * https://www.openssl.org/source/license.html
    88 */
     9
     10#define OPENSSL_SUPPRESS_DEPRECATED
    911
    1012#include <stdio.h>
     
    5557    BIO_TYPE_ACCEPT,
    5658    "socket accept",
    57     /* TODO: Convert to new style write function */
    5859    bwrite_conv,
    5960    acpt_write,
    60     /* TODO: Convert to new style read function */
    6161    bread_conv,
    6262    acpt_read,
     
    9494
    9595    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);
    9797        return NULL;
    9898    }
     
    157157        case ACPT_S_BEFORE:
    158158            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);
    163163                goto exit_loop;
    164164            }
     
    193193                    } else {
    194194#endif
    195                         BIOerr(BIO_F_ACPT_STATE, BIO_R_UNAVAILABLE_IP_FAMILY);
     195                        ERR_raise(ERR_LIB_BIO, BIO_R_UNAVAILABLE_IP_FAMILY);
    196196                        goto exit_loop;
    197197                    }
     
    204204                    break;
    205205                default:
    206                     BIOerr(BIO_F_ACPT_STATE, BIO_R_UNSUPPORTED_IP_FAMILY);
     206                    ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_IP_FAMILY);
    207207                    goto exit_loop;
    208208                }
     
    212212            }
    213213            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);
    215215                goto exit_loop;
    216216            }
    217             /* We're currently not iterating, but set this as preparation
    218              * for possible future development in that regard
    219              */
    220217            c->addr_iter = c->addr_first;
    221218            c->state = ACPT_S_CREATE_SOCKET;
     
    223220
    224221        case ACPT_S_CREATE_SOCKET:
     222            ERR_set_mark();
    225223            s = BIO_socket(BIO_ADDRINFO_family(c->addr_iter),
    226224                           BIO_ADDRINFO_socktype(c->addr_iter),
    227225                           BIO_ADDRINFO_protocol(c->addr_iter), 0);
    228226            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);
    234239                goto exit_loop;
    235240            }
     
    307312                goto exit_loop;
    308313
     314            BIO_set_callback_ex(bio, BIO_get_callback_ex(b));
     315#ifndef OPENSSL_NO_DEPRECATED_3_0
    309316            BIO_set_callback(bio, BIO_get_callback(b));
     317#endif
    310318            BIO_set_callback_arg(bio, BIO_get_callback_arg(b));
    311 
    312319            /*
    313320             * 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.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette