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:
7 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/ui/ui_err.c

    r91772 r94082  
    11/*
    22 * Generated by util/mkerr.pl DO NOT EDIT
    3  * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
     3 * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
    44 *
    5  * Licensed under the OpenSSL license (the "License").  You may not use
     5 * Licensed under the Apache License 2.0 (the "License").  You may not use
    66 * this file except in compliance with the License.  You can obtain a copy
    77 * in the file LICENSE in the source distribution or at
     
    1111#include <openssl/err.h>
    1212#include <openssl/uierr.h>
     13#include "crypto/uierr.h"
    1314
    1415#ifndef OPENSSL_NO_ERR
    15 
    16 static const ERR_STRING_DATA UI_str_functs[] = {
    17     {ERR_PACK(ERR_LIB_UI, UI_F_CLOSE_CONSOLE, 0), "close_console"},
    18     {ERR_PACK(ERR_LIB_UI, UI_F_ECHO_CONSOLE, 0), "echo_console"},
    19     {ERR_PACK(ERR_LIB_UI, UI_F_GENERAL_ALLOCATE_BOOLEAN, 0),
    20      "general_allocate_boolean"},
    21     {ERR_PACK(ERR_LIB_UI, UI_F_GENERAL_ALLOCATE_PROMPT, 0),
    22      "general_allocate_prompt"},
    23     {ERR_PACK(ERR_LIB_UI, UI_F_NOECHO_CONSOLE, 0), "noecho_console"},
    24     {ERR_PACK(ERR_LIB_UI, UI_F_OPEN_CONSOLE, 0), "open_console"},
    25     {ERR_PACK(ERR_LIB_UI, UI_F_UI_CONSTRUCT_PROMPT, 0), "UI_construct_prompt"},
    26     {ERR_PACK(ERR_LIB_UI, UI_F_UI_CREATE_METHOD, 0), "UI_create_method"},
    27     {ERR_PACK(ERR_LIB_UI, UI_F_UI_CTRL, 0), "UI_ctrl"},
    28     {ERR_PACK(ERR_LIB_UI, UI_F_UI_DUP_ERROR_STRING, 0), "UI_dup_error_string"},
    29     {ERR_PACK(ERR_LIB_UI, UI_F_UI_DUP_INFO_STRING, 0), "UI_dup_info_string"},
    30     {ERR_PACK(ERR_LIB_UI, UI_F_UI_DUP_INPUT_BOOLEAN, 0),
    31      "UI_dup_input_boolean"},
    32     {ERR_PACK(ERR_LIB_UI, UI_F_UI_DUP_INPUT_STRING, 0), "UI_dup_input_string"},
    33     {ERR_PACK(ERR_LIB_UI, UI_F_UI_DUP_USER_DATA, 0), "UI_dup_user_data"},
    34     {ERR_PACK(ERR_LIB_UI, UI_F_UI_DUP_VERIFY_STRING, 0),
    35      "UI_dup_verify_string"},
    36     {ERR_PACK(ERR_LIB_UI, UI_F_UI_GET0_RESULT, 0), "UI_get0_result"},
    37     {ERR_PACK(ERR_LIB_UI, UI_F_UI_GET_RESULT_LENGTH, 0),
    38      "UI_get_result_length"},
    39     {ERR_PACK(ERR_LIB_UI, UI_F_UI_NEW_METHOD, 0), "UI_new_method"},
    40     {ERR_PACK(ERR_LIB_UI, UI_F_UI_PROCESS, 0), "UI_process"},
    41     {ERR_PACK(ERR_LIB_UI, UI_F_UI_SET_RESULT, 0), "UI_set_result"},
    42     {ERR_PACK(ERR_LIB_UI, UI_F_UI_SET_RESULT_EX, 0), "UI_set_result_ex"},
    43     {0, NULL}
    44 };
    4516
    4617static const ERR_STRING_DATA UI_str_reasons[] = {
     
    6738#endif
    6839
    69 int ERR_load_UI_strings(void)
     40int ossl_err_load_UI_strings(void)
    7041{
    7142#ifndef OPENSSL_NO_ERR
    72     if (ERR_func_error_string(UI_str_functs[0].error) == NULL) {
    73         ERR_load_strings_const(UI_str_functs);
     43    if (ERR_reason_error_string(UI_str_reasons[0].error) == NULL)
    7444        ERR_load_strings_const(UI_str_reasons);
    75     }
    7645#endif
    7746    return 1;
  • trunk/src/libs/openssl-3.0.1/crypto/ui/ui_lib.c

    r91772 r94082  
    11/*
    2  * Copyright 2001-2019 The OpenSSL Project Authors. All Rights Reserved.
     2 * Copyright 2001-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
     
    2626
    2727    if (ret == NULL) {
    28         UIerr(UI_F_UI_NEW_METHOD, ERR_R_MALLOC_FAILURE);
     28        ERR_raise(ERR_LIB_UI, ERR_R_MALLOC_FAILURE);
    2929        return NULL;
    3030    }
     
    3232    ret->lock = CRYPTO_THREAD_lock_new();
    3333    if (ret->lock == NULL) {
    34         UIerr(UI_F_UI_NEW_METHOD, ERR_R_MALLOC_FAILURE);
     34        ERR_raise(ERR_LIB_UI, ERR_R_MALLOC_FAILURE);
    3535        OPENSSL_free(ret);
    3636        return NULL;
     
    4444
    4545    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_UI, ret, &ret->ex_data)) {
    46         OPENSSL_free(ret);
     46        UI_free(ret);
    4747        return NULL;
    4848    }
     
    103103
    104104    if (prompt == NULL) {
    105         UIerr(UI_F_GENERAL_ALLOCATE_PROMPT, ERR_R_PASSED_NULL_PARAMETER);
     105        ERR_raise(ERR_LIB_UI, ERR_R_PASSED_NULL_PARAMETER);
    106106    } else if ((type == UIT_PROMPT || type == UIT_VERIFY
    107107                || type == UIT_BOOLEAN) && result_buf == NULL) {
    108         UIerr(UI_F_GENERAL_ALLOCATE_PROMPT, UI_R_NO_RESULT_BUFFER);
    109     } else if ((ret = OPENSSL_malloc(sizeof(*ret))) != NULL) {
     108        ERR_raise(ERR_LIB_UI, UI_R_NO_RESULT_BUFFER);
     109    } else if ((ret = OPENSSL_zalloc(sizeof(*ret))) != NULL) {
    110110        ret->out_string = prompt;
    111111        ret->flags = prompt_freeable ? OUT_STRING_FREEABLE : 0;
     
    158158
    159159    if (ok_chars == NULL) {
    160         UIerr(UI_F_GENERAL_ALLOCATE_BOOLEAN, ERR_R_PASSED_NULL_PARAMETER);
     160        ERR_raise(ERR_LIB_UI, ERR_R_PASSED_NULL_PARAMETER);
    161161    } else if (cancel_chars == NULL) {
    162         UIerr(UI_F_GENERAL_ALLOCATE_BOOLEAN, ERR_R_PASSED_NULL_PARAMETER);
     162        ERR_raise(ERR_LIB_UI, ERR_R_PASSED_NULL_PARAMETER);
    163163    } else {
    164164        for (p = ok_chars; *p != '\0'; p++) {
    165165            if (strchr(cancel_chars, *p) != NULL) {
    166                 UIerr(UI_F_GENERAL_ALLOCATE_BOOLEAN,
    167                       UI_R_COMMON_OK_AND_CANCEL_CHARACTERS);
     166                ERR_raise(ERR_LIB_UI, UI_R_COMMON_OK_AND_CANCEL_CHARACTERS);
    168167            }
    169168        }
     
    213212        prompt_copy = OPENSSL_strdup(prompt);
    214213        if (prompt_copy == NULL) {
    215             UIerr(UI_F_UI_DUP_INPUT_STRING, ERR_R_MALLOC_FAILURE);
     214            ERR_raise(ERR_LIB_UI, ERR_R_MALLOC_FAILURE);
    216215            return 0;
    217216        }
     
    241240        prompt_copy = OPENSSL_strdup(prompt);
    242241        if (prompt_copy == NULL) {
    243             UIerr(UI_F_UI_DUP_VERIFY_STRING, ERR_R_MALLOC_FAILURE);
     242            ERR_raise(ERR_LIB_UI, ERR_R_MALLOC_FAILURE);
    244243            return -1;
    245244        }
     
    272271        prompt_copy = OPENSSL_strdup(prompt);
    273272        if (prompt_copy == NULL) {
    274             UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE);
     273            ERR_raise(ERR_LIB_UI, ERR_R_MALLOC_FAILURE);
    275274            goto err;
    276275        }
     
    280279        action_desc_copy = OPENSSL_strdup(action_desc);
    281280        if (action_desc_copy == NULL) {
    282             UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE);
     281            ERR_raise(ERR_LIB_UI, ERR_R_MALLOC_FAILURE);
    283282            goto err;
    284283        }
     
    288287        ok_chars_copy = OPENSSL_strdup(ok_chars);
    289288        if (ok_chars_copy == NULL) {
    290             UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE);
     289            ERR_raise(ERR_LIB_UI, ERR_R_MALLOC_FAILURE);
    291290            goto err;
    292291        }
     
    296295        cancel_chars_copy = OPENSSL_strdup(cancel_chars);
    297296        if (cancel_chars_copy == NULL) {
    298             UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE);
     297            ERR_raise(ERR_LIB_UI, ERR_R_MALLOC_FAILURE);
    299298            goto err;
    300299        }
     
    325324        text_copy = OPENSSL_strdup(text);
    326325        if (text_copy == NULL) {
    327             UIerr(UI_F_UI_DUP_INFO_STRING, ERR_R_MALLOC_FAILURE);
     326            ERR_raise(ERR_LIB_UI, ERR_R_MALLOC_FAILURE);
    328327            return -1;
    329328        }
     
    347346        text_copy = OPENSSL_strdup(text);
    348347        if (text_copy == NULL) {
    349             UIerr(UI_F_UI_DUP_ERROR_STRING, ERR_R_MALLOC_FAILURE);
     348            ERR_raise(ERR_LIB_UI, ERR_R_MALLOC_FAILURE);
    350349            return -1;
    351350        }
     
    355354}
    356355
    357 char *UI_construct_prompt(UI *ui, const char *object_desc,
     356char *UI_construct_prompt(UI *ui, const char *phrase_desc,
    358357                          const char *object_name)
    359358{
    360359    char *prompt = NULL;
    361360
    362     if (ui->meth->ui_construct_prompt != NULL)
    363         prompt = ui->meth->ui_construct_prompt(ui, object_desc, object_name);
     361    if (ui != NULL && ui->meth != NULL && ui->meth->ui_construct_prompt != NULL)
     362        prompt = ui->meth->ui_construct_prompt(ui, phrase_desc, object_name);
    364363    else {
    365364        char prompt1[] = "Enter ";
     
    368367        int len = 0;
    369368
    370         if (object_desc == NULL)
     369        if (phrase_desc == NULL)
    371370            return NULL;
    372         len = sizeof(prompt1) - 1 + strlen(object_desc);
     371        len = sizeof(prompt1) - 1 + strlen(phrase_desc);
    373372        if (object_name != NULL)
    374373            len += sizeof(prompt2) - 1 + strlen(object_name);
     
    376375
    377376        if ((prompt = OPENSSL_malloc(len + 1)) == NULL) {
    378             UIerr(UI_F_UI_CONSTRUCT_PROMPT, ERR_R_MALLOC_FAILURE);
     377            ERR_raise(ERR_LIB_UI, ERR_R_MALLOC_FAILURE);
    379378            return NULL;
    380379        }
    381380        OPENSSL_strlcpy(prompt, prompt1, len + 1);
    382         OPENSSL_strlcat(prompt, object_desc, len + 1);
     381        OPENSSL_strlcat(prompt, phrase_desc, len + 1);
    383382        if (object_name != NULL) {
    384383            OPENSSL_strlcat(prompt, prompt2, len + 1);
     
    409408    if (ui->meth->ui_duplicate_data == NULL
    410409        || ui->meth->ui_destroy_data == NULL) {
    411         UIerr(UI_F_UI_DUP_USER_DATA, UI_R_USER_DATA_DUPLICATION_UNSUPPORTED);
     410        ERR_raise(ERR_LIB_UI, UI_R_USER_DATA_DUPLICATION_UNSUPPORTED);
    412411        return -1;
    413412    }
     
    415414    duplicate = ui->meth->ui_duplicate_data(ui, user_data);
    416415    if (duplicate == NULL) {
    417         UIerr(UI_F_UI_DUP_USER_DATA, ERR_R_MALLOC_FAILURE);
     416        ERR_raise(ERR_LIB_UI, ERR_R_MALLOC_FAILURE);
    418417        return -1;
    419418    }
     
    433432{
    434433    if (i < 0) {
    435         UIerr(UI_F_UI_GET0_RESULT, UI_R_INDEX_TOO_SMALL);
     434        ERR_raise(ERR_LIB_UI, UI_R_INDEX_TOO_SMALL);
    436435        return NULL;
    437436    }
    438437    if (i >= sk_UI_STRING_num(ui->strings)) {
    439         UIerr(UI_F_UI_GET0_RESULT, UI_R_INDEX_TOO_LARGE);
     438        ERR_raise(ERR_LIB_UI, UI_R_INDEX_TOO_LARGE);
    440439        return NULL;
    441440    }
     
    446445{
    447446    if (i < 0) {
    448         UIerr(UI_F_UI_GET_RESULT_LENGTH, UI_R_INDEX_TOO_SMALL);
     447        ERR_raise(ERR_LIB_UI, UI_R_INDEX_TOO_SMALL);
    449448        return -1;
    450449    }
    451450    if (i >= sk_UI_STRING_num(ui->strings)) {
    452         UIerr(UI_F_UI_GET_RESULT_LENGTH, UI_R_INDEX_TOO_LARGE);
     451        ERR_raise(ERR_LIB_UI, UI_R_INDEX_TOO_LARGE);
    453452        return -1;
    454453    }
     
    542541    }
    543542
    544     if (ok == -1) {
    545         UIerr(UI_F_UI_PROCESS, UI_R_PROCESSING_ERROR);
    546         ERR_add_error_data(2, "while ", state);
    547     }
     543    if (ok == -1)
     544        ERR_raise_data(ERR_LIB_UI, UI_R_PROCESSING_ERROR, "while %s", state);
    548545    return ok;
    549546}
     
    552549{
    553550    if (ui == NULL) {
    554         UIerr(UI_F_UI_CTRL, ERR_R_PASSED_NULL_PARAMETER);
     551        ERR_raise(ERR_LIB_UI, ERR_R_PASSED_NULL_PARAMETER);
    555552        return -1;
    556553    }
     
    570567        break;
    571568    }
    572     UIerr(UI_F_UI_CTRL, UI_R_UNKNOWN_CONTROL_COMMAND);
     569    ERR_raise(ERR_LIB_UI, UI_R_UNKNOWN_CONTROL_COMMAND);
    573570    return -1;
    574571}
     
    579576}
    580577
    581 void *UI_get_ex_data(UI *r, int idx)
     578void *UI_get_ex_data(const UI *r, int idx)
    582579{
    583580    return CRYPTO_get_ex_data(&r->ex_data, idx);
     
    606603            OPENSSL_free(ui_method->name);
    607604        OPENSSL_free(ui_method);
    608         UIerr(UI_F_UI_CREATE_METHOD, ERR_R_MALLOC_FAILURE);
     605        ERR_raise(ERR_LIB_UI, ERR_R_MALLOC_FAILURE);
    609606        return NULL;
    610607    }
     
    689686int UI_method_set_prompt_constructor(UI_METHOD *method,
    690687                                     char *(*prompt_constructor) (UI *ui,
    691                                                                   const char
    692                                                                   *object_desc,
    693                                                                   const char
    694                                                                   *object_name))
     688                                                                  const char *,
     689                                                                  const char *))
    695690{
    696691    if (method != NULL) {
     
    875870int UI_set_result(UI *ui, UI_STRING *uis, const char *result)
    876871{
    877 #if 0
    878     /*
    879      * This is placed here solely to preserve UI_F_UI_SET_RESULT
    880      * To be removed for OpenSSL 1.2.0
    881      */
    882     UIerr(UI_F_UI_SET_RESULT, ERR_R_DISABLED);
    883 #endif
    884872    return UI_set_result_ex(ui, uis, result, strlen(result));
    885873}
     
    892880    case UIT_PROMPT:
    893881    case UIT_VERIFY:
    894         {
    895             char number1[DECIMAL_SIZE(uis->_.string_data.result_minsize) + 1];
    896             char number2[DECIMAL_SIZE(uis->_.string_data.result_maxsize) + 1];
    897 
    898             BIO_snprintf(number1, sizeof(number1), "%d",
    899                          uis->_.string_data.result_minsize);
    900             BIO_snprintf(number2, sizeof(number2), "%d",
    901                          uis->_.string_data.result_maxsize);
    902 
    903             if (len < uis->_.string_data.result_minsize) {
    904                 ui->flags |= UI_FLAG_REDOABLE;
    905                 UIerr(UI_F_UI_SET_RESULT_EX, UI_R_RESULT_TOO_SMALL);
    906                 ERR_add_error_data(5, "You must type in ",
    907                                    number1, " to ", number2, " characters");
    908                 return -1;
    909             }
    910             if (len > uis->_.string_data.result_maxsize) {
    911                 ui->flags |= UI_FLAG_REDOABLE;
    912                 UIerr(UI_F_UI_SET_RESULT_EX, UI_R_RESULT_TOO_LARGE);
    913                 ERR_add_error_data(5, "You must type in ",
    914                                    number1, " to ", number2, " characters");
    915                 return -1;
    916             }
     882        if (len < uis->_.string_data.result_minsize) {
     883            ui->flags |= UI_FLAG_REDOABLE;
     884            ERR_raise_data(ERR_LIB_UI, UI_R_RESULT_TOO_SMALL,
     885                           "You must type in %d to %d characters",
     886                           uis->_.string_data.result_minsize,
     887                           uis->_.string_data.result_maxsize);
     888            return -1;
     889        }
     890        if (len > uis->_.string_data.result_maxsize) {
     891            ui->flags |= UI_FLAG_REDOABLE;
     892            ERR_raise_data(ERR_LIB_UI, UI_R_RESULT_TOO_LARGE,
     893                           "You must type in %d to %d characters",
     894                           uis->_.string_data.result_minsize,
     895                           uis->_.string_data.result_maxsize);
     896            return -1;
    917897        }
    918898
    919899        if (uis->result_buf == NULL) {
    920             UIerr(UI_F_UI_SET_RESULT_EX, UI_R_NO_RESULT_BUFFER);
     900            ERR_raise(ERR_LIB_UI, UI_R_NO_RESULT_BUFFER);
    921901            return -1;
    922902        }
     
    932912
    933913            if (uis->result_buf == NULL) {
    934                 UIerr(UI_F_UI_SET_RESULT_EX, UI_R_NO_RESULT_BUFFER);
     914                ERR_raise(ERR_LIB_UI, UI_R_NO_RESULT_BUFFER);
    935915                return -1;
    936916            }
  • trunk/src/libs/openssl-3.0.1/crypto/ui/ui_local.h

    r91772 r94082  
    22 * Copyright 2001-2016 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
  • trunk/src/libs/openssl-3.0.1/crypto/ui/ui_null.c

    r91772 r94082  
    22 * Copyright 2017 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
  • trunk/src/libs/openssl-3.0.1/crypto/ui/ui_openssl.c

    r91772 r94082  
    11/*
    2  * Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.
     2 * Copyright 2001-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
     
    3535
    3636# if !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VMS)
    37 #  ifdef OPENSSL_UNISTD
    38 #   include OPENSSL_UNISTD
    39 #  else
    40 #   include <unistd.h>
    41 #  endif
     37#  include <unistd.h>
    4238/*
    4339 * If unistd.h defines _POSIX_VERSION, we conclude that we are on a POSIX
     
    9389 */
    9490#  elif !defined(OPENSSL_SYS_VMS) \
    95         && !defined(OPENSSL_SYS_MSDOS) \
    96         && !defined(OPENSSL_SYS_VXWORKS)
     91        && !defined(OPENSSL_SYS_MSDOS) \
     92        && !defined(OPENSSL_SYS_VXWORKS)
    9793#   define TERMIOS
    9894#   undef  TERMIO
     
    132128# endif
    133129
    134 # if !defined(_LIBC) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VMS)
     130# if !defined(_LIBC) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VMS) && ! (defined(OPENSSL_SYS_TANDEM) && defined(_SPT_MODEL_))
    135131#  include <sys/ioctl.h>
    136132# endif
     
    377373static int open_console(UI *ui)
    378374{
    379     CRYPTO_THREAD_write_lock(ui->lock);
     375    if (!CRYPTO_THREAD_write_lock(ui->lock))
     376        return 0;
    380377    is_a_tty = 1;
    381378
     
    456453             */
    457454        if (errno == ENODEV)
    458             is_a_tty = 0;
     455                is_a_tty = 0;
    459456        else
    460457#  endif
    461458            {
    462                 char tmp_num[10];
    463                 BIO_snprintf(tmp_num, sizeof(tmp_num) - 1, "%d", errno);
    464                 UIerr(UI_F_OPEN_CONSOLE, UI_R_UNKNOWN_TTYGET_ERRNO_VALUE);
    465                 ERR_add_error_data(2, "errno=", tmp_num);
    466 
     459                ERR_raise_data(ERR_LIB_UI, UI_R_UNKNOWN_TTYGET_ERRNO_VALUE,
     460                               "errno=%d", errno);
    467461                return 0;
    468462            }
     
    474468    /* if there isn't a TT device, something is very wrong */
    475469    if (status != SS$_NORMAL) {
    476         char tmp_num[12];
    477 
    478         BIO_snprintf(tmp_num, sizeof(tmp_num) - 1, "%%X%08X", status);
    479         UIerr(UI_F_OPEN_CONSOLE, UI_R_SYSASSIGN_ERROR);
    480         ERR_add_error_data(2, "status=", tmp_num);
     470        ERR_raise_data(ERR_LIB_UI, UI_R_SYSASSIGN_ERROR,
     471                       "status=%%X%08X", status);
    481472        return 0;
    482473    }
     
    511502                          0, 0, 0, 0);
    512503        if ((status != SS$_NORMAL) || (iosb.iosb$w_value != SS$_NORMAL)) {
    513             char tmp_num[2][12];
    514 
    515             BIO_snprintf(tmp_num[0], sizeof(tmp_num[0]) - 1, "%%X%08X",
    516                          status);
    517             BIO_snprintf(tmp_num[1], sizeof(tmp_num[1]) - 1, "%%X%08X",
    518                          iosb.iosb$w_value);
    519             UIerr(UI_F_NOECHO_CONSOLE, UI_R_SYSQIOW_ERROR);
    520             ERR_add_error_data(5, "status=", tmp_num[0],
    521                                ",", "iosb.iosb$w_value=", tmp_num[1]);
     504            ERR_raise_data(ERR_LIB_UI, UI_R_SYSQIOW_ERROR,
     505                           "status=%%X%08X, iosb.iosb$w_value=%%X%08X",
     506                           status, iosb.iosb$w_value);
    522507            return 0;
    523508        }
     
    549534                          0, 0, 0, 0);
    550535        if ((status != SS$_NORMAL) || (iosb.iosb$w_value != SS$_NORMAL)) {
    551             char tmp_num[2][12];
    552 
    553             BIO_snprintf(tmp_num[0], sizeof(tmp_num[0]) - 1, "%%X%08X",
    554                          status);
    555             BIO_snprintf(tmp_num[1], sizeof(tmp_num[1]) - 1, "%%X%08X",
    556                          iosb.iosb$w_value);
    557             UIerr(UI_F_ECHO_CONSOLE, UI_R_SYSQIOW_ERROR);
    558             ERR_add_error_data(5, "status=", tmp_num[0],
    559                                ",", "iosb.iosb$w_value=", tmp_num[1]);
     536            ERR_raise_data(ERR_LIB_UI, UI_R_SYSQIOW_ERROR,
     537                           "status=%%X%08X, iosb.iosb$w_value=%%X%08X",
     538                           status, iosb.iosb$w_value);
    560539            return 0;
    561540        }
     
    580559    status = sys$dassgn(channel);
    581560    if (status != SS$_NORMAL) {
    582         char tmp_num[12];
    583 
    584         BIO_snprintf(tmp_num, sizeof(tmp_num) - 1, "%%X%08X", status);
    585         UIerr(UI_F_CLOSE_CONSOLE, UI_R_SYSDASSGN_ERROR);
    586         ERR_add_error_data(2, "status=", tmp_num);
     561        ERR_raise_data(ERR_LIB_UI, UI_R_SYSDASSGN_ERROR,
     562                       "status=%%X%08X", status);
    587563        return 0;
    588564    }
  • trunk/src/libs/openssl-3.0.1/crypto/ui/ui_util.c

    r91772 r94082  
    11/*
    2  * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
     2 * Copyright 2002-2020 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
     
    7272
    7373static int ui_dup_method_data(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
    74                               void *from_d, int idx, long argl, void *argp)
     74                              void **pptr, int idx, long argl, void *argp)
    7575{
    76     void **pptr = (void **)from_d;
    7776    if (*pptr != NULL)
    7877        *pptr = OPENSSL_memdup(*pptr, sizeof(struct pem_password_cb_data));
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