Path: blob/main/crypto/heimdal/lib/krb5/crypto-stubs.c
34878 views
/*1* Copyright (c) 1997 - 2008 Kungliga Tekniska Högskolan2* (Royal Institute of Technology, Stockholm, Sweden).3* All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8*9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11*12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15*16* 3. Neither the name of the Institute nor the names of its contributors17* may be used to endorse or promote products derived from this software18* without specific prior written permission.19*20* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND21* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE22* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE23* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE24* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL25* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS26* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)27* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT28* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY29* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF30* SUCH DAMAGE.31*/3233#include <krb5_locl.h>3435/* These are stub functions for the standalone RFC3961 crypto library */3637KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL38krb5_init_context(krb5_context *context)39{40krb5_context p;4142*context = NULL;4344/* should have a run_once */45bindtextdomain(HEIMDAL_TEXTDOMAIN, HEIMDAL_LOCALEDIR);4647p = calloc(1, sizeof(*p));48if(!p)49return ENOMEM;5051p->mutex = malloc(sizeof(HEIMDAL_MUTEX));52if (p->mutex == NULL) {53free(p);54return ENOMEM;55}56HEIMDAL_MUTEX_init(p->mutex);5758*context = p;59return 0;60}6162KRB5_LIB_FUNCTION void KRB5_LIB_CALL63krb5_free_context(krb5_context context)64{65krb5_clear_error_message(context);6667HEIMDAL_MUTEX_destroy(context->mutex);68free(context->mutex);69if (context->flags & KRB5_CTX_F_SOCKETS_INITIALIZED) {70rk_SOCK_EXIT();71}7273memset(context, 0, sizeof(*context));74free(context);75}7677krb5_boolean78_krb5_homedir_access(krb5_context context) {79return 0;80}8182KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL83krb5_log(krb5_context context,84krb5_log_facility *fac,85int level,86const char *fmt,87...)88{89return 0;90}9192/* This function is currently just used to get the location of the EGD93* socket. If we're not using an EGD, then we can just return NULL */9495KRB5_LIB_FUNCTION const char* KRB5_LIB_CALL96krb5_config_get_string (krb5_context context,97const krb5_config_section *c,98...)99{100return NULL;101}102103104