Let's also include aclocal.m4
[asterisk-bristuff.git] / main / cryptostub.c
blob676110374482fd4fe520f28c473a4320305a8767
1 /*
2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 1999 - 2005, Digium, Inc.
6 * Mark Spencer <markster@digium.com>
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
19 /*! \file
21 * \brief Stubs for res_crypto routines
23 * \author Mark Spencer <markster@digium.com>
26 #include "asterisk.h"
28 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
30 #include <unistd.h>
31 #include <stdlib.h>
33 #include "asterisk/crypto.h"
34 #include "asterisk/logger.h"
36 /* Hrm, I wonder if the compiler is smart enough to only create two functions
37 for all these... I could force it to only make two, but those would be some
38 really nasty looking casts. */
40 static struct ast_key *stub_ast_key_get(const char *kname, int ktype)
42 ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
43 return NULL;
46 static int stub_ast_check_signature(struct ast_key *key, const char *msg, const char *sig)
48 ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
49 return -1;
52 static int stub_ast_check_signature_bin(struct ast_key *key, const char *msg, int msglen, const unsigned char *sig)
54 ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
55 return -1;
58 static int stub_ast_sign(struct ast_key *key, char *msg, char *sig)
60 ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
61 return -1;
64 static int stub_ast_sign_bin(struct ast_key *key, const char *msg, int msglen, unsigned char *sig)
66 ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
67 return -1;
70 static int stub_ast_encdec_bin(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key)
72 ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
73 return -1;
76 struct ast_key *(*ast_key_get)(const char *key, int type) =
77 stub_ast_key_get;
79 int (*ast_check_signature)(struct ast_key *key, const char *msg, const char *sig) =
80 stub_ast_check_signature;
82 int (*ast_check_signature_bin)(struct ast_key *key, const char *msg, int msglen, const unsigned char *sig) =
83 stub_ast_check_signature_bin;
85 int (*ast_sign)(struct ast_key *key, char *msg, char *sig) =
86 stub_ast_sign;
88 int (*ast_sign_bin)(struct ast_key *key, const char *msg, int msglen, unsigned char *sig) =
89 stub_ast_sign_bin;
91 int (*ast_encrypt_bin)(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key) =
92 stub_ast_encdec_bin;
94 int (*ast_decrypt_bin)(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key) =
95 stub_ast_encdec_bin;