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