VirtualBox

source: vbox/trunk/src/libs/openssl-3.1.4/test/testutil/apps_shims.c@ 103050

最後變更 在這個檔案從103050是 102863,由 vboxsync 提交於 10 月 前

openssl-3.1.4: Applied and adjusted our OpenSSL changes to 3.1.3. bugref:10577

檔案大小: 1.3 KB
 
1/*
2 * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#include <stdlib.h>
11#include "apps.h"
12#include "../testutil.h"
13
14/* shim that avoids sucking in too much from apps/apps.c */
15
16void *app_malloc(size_t sz, const char *what)
17{
18 void *vp;
19
20 /*
21 * This isn't ideal but it is what the app's app_malloc() does on failure.
22 * Instead of exiting with a failure, abort() is called which makes sure
23 * that there will be a good stack trace for debugging purposes.
24 */
25 if (!TEST_ptr(vp = OPENSSL_malloc(sz))) {
26 TEST_info("Could not allocate %zu bytes for %s\n", sz, what);
27 abort();
28 }
29 return vp;
30}
31
32/* shim to prevent sucking in too much from apps */
33
34int opt_legacy_okay(void)
35{
36 return 1;
37}
38
39/*
40 * These three functions are defined here so that they don't need to come from
41 * the apps source code and pull in a lot of additional things.
42 */
43int opt_provider_option_given(void)
44{
45 return 0;
46}
47
48const char *app_get0_propq(void)
49{
50 return NULL;
51}
52
53OSSL_LIB_CTX *app_get0_libctx(void)
54{
55 return NULL;
56}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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