00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "asterisk.h"
00027
00028 ASTERISK_FILE_VERSION(__FILE__, "$Revision: 40722 $")
00029
00030 #include <unistd.h>
00031 #include <stdlib.h>
00032
00033 #include "asterisk/crypto.h"
00034 #include "asterisk/logger.h"
00035
00036
00037
00038
00039
00040 static struct ast_key *stub_ast_key_get(const char *kname, int ktype)
00041 {
00042 ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
00043 return NULL;
00044 }
00045
00046 static int stub_ast_check_signature(struct ast_key *key, const char *msg, const char *sig)
00047 {
00048 ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
00049 return -1;
00050 }
00051
00052 static int stub_ast_check_signature_bin(struct ast_key *key, const char *msg, int msglen, const unsigned char *sig)
00053 {
00054 ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
00055 return -1;
00056 }
00057
00058 static int stub_ast_sign(struct ast_key *key, char *msg, char *sig)
00059 {
00060 ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
00061 return -1;
00062 }
00063
00064 static int stub_ast_sign_bin(struct ast_key *key, const char *msg, int msglen, unsigned char *sig)
00065 {
00066 ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
00067 return -1;
00068 }
00069
00070 static int stub_ast_encdec_bin(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key)
00071 {
00072 ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
00073 return -1;
00074 }
00075
00076 struct ast_key *(*ast_key_get)(const char *key, int type) =
00077 stub_ast_key_get;
00078
00079 int (*ast_check_signature)(struct ast_key *key, const char *msg, const char *sig) =
00080 stub_ast_check_signature;
00081
00082 int (*ast_check_signature_bin)(struct ast_key *key, const char *msg, int msglen, const unsigned char *sig) =
00083 stub_ast_check_signature_bin;
00084
00085 int (*ast_sign)(struct ast_key *key, char *msg, char *sig) =
00086 stub_ast_sign;
00087
00088 int (*ast_sign_bin)(struct ast_key *key, const char *msg, int msglen, unsigned char *sig) =
00089 stub_ast_sign_bin;
00090
00091 int (*ast_encrypt_bin)(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key) =
00092 stub_ast_encdec_bin;
00093
00094 int (*ast_decrypt_bin)(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key) =
00095 stub_ast_encdec_bin;