diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-21 02:11:39 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-21 02:11:39 +0000 |
commit | 8b0c007ad990aa27d9868da49215fd1076ac77cc (patch) | |
tree | 270b9c46c1e644483d6d2a35b509f43218ba3252 /main/cryptostub.c | |
parent | a42edc84034f91932a3e12d503e07f76a6eb498a (diff) |
merge new_loader_completion branch, including (at least):
- restructured build tree and makefiles to eliminate recursion problems
- support for embedded modules
- support for static builds
- simpler cross-compilation support
- simpler module/loader interface (no exported symbols)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/cryptostub.c')
-rw-r--r-- | main/cryptostub.c | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/main/cryptostub.c b/main/cryptostub.c new file mode 100644 index 000000000..676110374 --- /dev/null +++ b/main/cryptostub.c @@ -0,0 +1,95 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 1999 - 2005, Digium, Inc. + * + * Mark Spencer <markster@digium.com> + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/*! \file + * + * \brief Stubs for res_crypto routines + * + * \author Mark Spencer <markster@digium.com> + */ + +#include "asterisk.h" + +ASTERISK_FILE_VERSION(__FILE__, "$Revision$") + +#include <unistd.h> +#include <stdlib.h> + +#include "asterisk/crypto.h" +#include "asterisk/logger.h" + +/* Hrm, I wonder if the compiler is smart enough to only create two functions + for all these... I could force it to only make two, but those would be some + really nasty looking casts. */ + +static struct ast_key *stub_ast_key_get(const char *kname, int ktype) +{ + ast_log(LOG_NOTICE, "Crypto support not loaded!\n"); + return NULL; +} + +static int stub_ast_check_signature(struct ast_key *key, const char *msg, const char *sig) +{ + ast_log(LOG_NOTICE, "Crypto support not loaded!\n"); + return -1; +} + +static int stub_ast_check_signature_bin(struct ast_key *key, const char *msg, int msglen, const unsigned char *sig) +{ + ast_log(LOG_NOTICE, "Crypto support not loaded!\n"); + return -1; +} + +static int stub_ast_sign(struct ast_key *key, char *msg, char *sig) +{ + ast_log(LOG_NOTICE, "Crypto support not loaded!\n"); + return -1; +} + +static int stub_ast_sign_bin(struct ast_key *key, const char *msg, int msglen, unsigned char *sig) +{ + ast_log(LOG_NOTICE, "Crypto support not loaded!\n"); + return -1; +} + +static int stub_ast_encdec_bin(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key) +{ + ast_log(LOG_NOTICE, "Crypto support not loaded!\n"); + return -1; +} + +struct ast_key *(*ast_key_get)(const char *key, int type) = + stub_ast_key_get; + +int (*ast_check_signature)(struct ast_key *key, const char *msg, const char *sig) = + stub_ast_check_signature; + +int (*ast_check_signature_bin)(struct ast_key *key, const char *msg, int msglen, const unsigned char *sig) = + stub_ast_check_signature_bin; + +int (*ast_sign)(struct ast_key *key, char *msg, char *sig) = + stub_ast_sign; + +int (*ast_sign_bin)(struct ast_key *key, const char *msg, int msglen, unsigned char *sig) = + stub_ast_sign_bin; + +int (*ast_encrypt_bin)(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key) = + stub_ast_encdec_bin; + +int (*ast_decrypt_bin)(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key) = + stub_ast_encdec_bin; |