Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • b412ed3
  • /
  • test
  • /
  • testutil
  • /
  • apps_shims.c
Raw File
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:53d851ffda3bdba8874c52b2dabb78b051d3e655
directory badge Iframe embedding
swh:1:dir:5b994467e58266275a0fcca2840c010c61c3a8b5
apps_shims.c
/*
 * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the Apache License 2.0 (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 */

#include <stdlib.h>
#include "apps.h"
#include "../testutil.h"

/* shim that avoids sucking in too much from apps/apps.c */

void *app_malloc(size_t sz, const char *what)
{
    void *vp;

    /*
     * This isn't ideal but it is what the app's app_malloc() does on failure.
     * Instead of exiting with a failure, abort() is called which makes sure
     * that there will be a good stack trace for debugging purposes.
     */
    if (!TEST_ptr(vp = OPENSSL_malloc(sz))) {
        TEST_info("Could not allocate %zu bytes for %s\n", sz, what);
        abort();
    }
    return vp;
}

/* shim to prevent sucking in too much from apps */

int opt_legacy_okay(void)
{
    return 1;
}

/*
 * These three functions are defined here so that they don't need to come from
 * the apps source code and pull in a lot of additional things.
 */
int opt_provider_option_given(void)
{
    return 0;
}

const char *app_get0_propq(void)
{
    return NULL;
}

OSSL_LIB_CTX *app_get0_libctx(void)
{
    return NULL;
}

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top