| 
									
										
										
										
											2005-10-16 03:08:58 +00:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * 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. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-12-30 21:18:06 +00:00
										 |  |  | /*! \file
 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * \brief Stubs for res_crypto routines | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * \author Mark Spencer <markster@digium.com> | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-06-07 18:54:56 +00:00
										 |  |  | #include "asterisk.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ASTERISK_FILE_VERSION(__FILE__, "$Revision$") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-26 17:36:53 +00:00
										 |  |  | #include "asterisk/crypto.h"
 | 
					
						
							| 
									
										
										
										
											2005-10-16 03:08:58 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | static struct ast_key *stub_ast_key_get(const char *kname, int ktype) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	ast_log(LOG_NOTICE, "Crypto support not loaded!\n"); | 
					
						
							|  |  |  | 	return NULL; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-20 17:52:00 +00:00
										 |  |  | #ifdef SKREP
 | 
					
						
							|  |  |  | #define build_stub(func_name,...) \
 | 
					
						
							|  |  |  | static int stub_ ## func_name(__VA_ARGS__) \ | 
					
						
							|  |  |  | { \ | 
					
						
							| 
									
										
										
										
											2008-03-04 23:04:29 +00:00
										 |  |  | 	ast_log(LOG_NOTICE, "Crypto support not loaded!\n"); \ | 
					
						
							|  |  |  | 	return -1; \ | 
					
						
							| 
									
										
										
										
											2007-05-20 17:52:00 +00:00
										 |  |  | } \ | 
					
						
							|  |  |  | \ | 
					
						
							|  |  |  | int (*func_name)(__VA_ARGS__) = \ | 
					
						
							| 
									
										
										
										
											2008-03-04 23:04:29 +00:00
										 |  |  | 	stub_ ## func_name; | 
					
						
							| 
									
										
										
										
											2007-05-20 17:52:00 +00:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | #define build_stub(func_name,...) \
 | 
					
						
							|  |  |  | static int stub_##func_name(__VA_ARGS__) \ | 
					
						
							|  |  |  | { \ | 
					
						
							| 
									
										
										
										
											2008-03-04 23:04:29 +00:00
										 |  |  | 	ast_log(LOG_NOTICE, "Crypto support not loaded!\n"); \ | 
					
						
							|  |  |  | 	return -1; \ | 
					
						
							| 
									
										
										
										
											2007-05-20 17:52:00 +00:00
										 |  |  | } \ | 
					
						
							|  |  |  | \ | 
					
						
							|  |  |  | int (*func_name)(__VA_ARGS__) = \ | 
					
						
							| 
									
										
										
										
											2008-03-04 23:04:29 +00:00
										 |  |  | 	stub_##func_name; | 
					
						
							| 
									
										
										
										
											2005-10-16 03:08:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-20 17:52:00 +00:00
										 |  |  | struct ast_key *(*ast_key_get)(const char *key, int type) = | 
					
						
							|  |  |  | stub_ast_key_get; | 
					
						
							| 
									
										
										
										
											2005-10-16 03:08:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-20 17:52:00 +00:00
										 |  |  | build_stub(ast_check_signature, struct ast_key *key, const char *msg, const char *sig); | 
					
						
							|  |  |  | build_stub(ast_check_signature_bin, struct ast_key *key, const char *msg, int msglen, const unsigned char *sig); | 
					
						
							|  |  |  | build_stub(ast_sign, struct ast_key *key, char *msg, char *sig); | 
					
						
							|  |  |  | build_stub(ast_sign_bin, struct ast_key *key, const char *msg, int msglen, unsigned char *sig); | 
					
						
							|  |  |  | build_stub(ast_encrypt_bin, unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key); | 
					
						
							|  |  |  | build_stub(ast_decrypt_bin, unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key); |