Thu Jul 9 13:40:33 2009

Asterisk developer's documentation


cryptostub.c

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 1999 - 2005, Digium, Inc.
00005  *
00006  * Mark Spencer <markster@digium.com>
00007  *
00008  * See http://www.asterisk.org for more information about
00009  * the Asterisk project. Please do not directly contact
00010  * any of the maintainers of this project for assistance;
00011  * the project provides a web site, mailing lists and IRC
00012  * channels for your use.
00013  *
00014  * This program is free software, distributed under the terms of
00015  * the GNU General Public License Version 2. See the LICENSE file
00016  * at the top of the source tree.
00017  */
00018 
00019 /*! \file
00020  *
00021  * \brief Stubs for res_crypto routines
00022  *
00023  * \author Mark Spencer <markster@digium.com>
00024  */
00025 
00026 #include "asterisk.h"
00027 
00028 ASTERISK_FILE_VERSION(__FILE__, "$Revision: 148204 $")
00029 
00030 #include "asterisk/crypto.h"
00031 #include "asterisk/logger.h"
00032 
00033 static struct ast_key *stub_ast_key_get(const char *kname, int ktype)
00034 {
00035    ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
00036    return NULL;
00037 }
00038 
00039 #ifdef SKREP
00040 #define build_stub(func_name,...) \
00041 static int stub_ ## func_name(__VA_ARGS__) \
00042 { \
00043    ast_log(LOG_NOTICE, "Crypto support not loaded!\n"); \
00044    return -1; \
00045 } \
00046 \
00047 int (*func_name)(__VA_ARGS__) = \
00048    stub_ ## func_name;
00049 #endif
00050 #define build_stub(func_name,...) \
00051 static int stub_##func_name(__VA_ARGS__) \
00052 { \
00053    ast_log(LOG_NOTICE, "Crypto support not loaded!\n"); \
00054    return -1; \
00055 } \
00056 \
00057 int (*func_name)(__VA_ARGS__) = \
00058    stub_##func_name;
00059 
00060 struct ast_key *(*ast_key_get)(const char *key, int type) =
00061 stub_ast_key_get;
00062 
00063 build_stub(ast_check_signature, struct ast_key *key, const char *msg, const char *sig);
00064 build_stub(ast_check_signature_bin, struct ast_key *key, const char *msg, int msglen, const unsigned char *sig);
00065 build_stub(ast_sign, struct ast_key *key, char *msg, char *sig);
00066 build_stub(ast_sign_bin, struct ast_key *key, const char *msg, int msglen, unsigned char *sig);
00067 build_stub(ast_encrypt_bin, unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key);
00068 build_stub(ast_decrypt_bin, unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key);

Generated on Thu Jul 9 13:40:33 2009 for Asterisk - the Open Source PBX by  doxygen 1.4.7