#include "asterisk.h"
#include <unistd.h>
#include <stdlib.h>
#include "asterisk/crypto.h"
#include "asterisk/logger.h"
Go to the source code of this file.
Functions | |
static int | stub_ast_check_signature (struct ast_key *key, const char *msg, const char *sig) |
static int | stub_ast_check_signature_bin (struct ast_key *key, const char *msg, int msglen, const unsigned char *sig) |
static int | stub_ast_encdec_bin (unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key) |
static struct ast_key * | stub_ast_key_get (const char *kname, int ktype) |
static int | stub_ast_sign (struct ast_key *key, char *msg, char *sig) |
static int | stub_ast_sign_bin (struct ast_key *key, const char *msg, int msglen, unsigned char *sig) |
Variables | |
int(*) | ast_check_signature (struct ast_key *key, const char *msg, const char *sig) |
Check the authenticity of a message signature using a given public key. | |
int(*) | ast_check_signature_bin (struct ast_key *key, const char *msg, int msglen, const unsigned char *sig) |
Check the authenticity of a message signature using a given public key. | |
int(*) | ast_decrypt_bin (unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key) |
int(*) | ast_encrypt_bin (unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key) |
ast_key *(*) | ast_key_get (const char *key, int type) |
Retrieve a key. | |
int(*) | ast_sign (struct ast_key *key, char *msg, char *sig) |
int(*) | ast_sign_bin (struct ast_key *key, const char *msg, int msglen, unsigned char *sig) |
Definition in file cryptostub.c.
static int stub_ast_check_signature | ( | struct ast_key * | key, | |
const char * | msg, | |||
const char * | sig | |||
) | [static] |
Definition at line 46 of file cryptostub.c.
References ast_log(), and LOG_NOTICE.
00047 { 00048 ast_log(LOG_NOTICE, "Crypto support not loaded!\n"); 00049 return -1; 00050 }
static int stub_ast_check_signature_bin | ( | struct ast_key * | key, | |
const char * | msg, | |||
int | msglen, | |||
const unsigned char * | sig | |||
) | [static] |
Definition at line 52 of file cryptostub.c.
References ast_log(), and LOG_NOTICE.
00053 { 00054 ast_log(LOG_NOTICE, "Crypto support not loaded!\n"); 00055 return -1; 00056 }
static int stub_ast_encdec_bin | ( | unsigned char * | dst, | |
const unsigned char * | src, | |||
int | srclen, | |||
struct ast_key * | key | |||
) | [static] |
Definition at line 70 of file cryptostub.c.
References ast_log(), and LOG_NOTICE.
00071 { 00072 ast_log(LOG_NOTICE, "Crypto support not loaded!\n"); 00073 return -1; 00074 }
static struct ast_key* stub_ast_key_get | ( | const char * | kname, | |
int | ktype | |||
) | [static] |
Definition at line 40 of file cryptostub.c.
References ast_log(), and LOG_NOTICE.
00041 { 00042 ast_log(LOG_NOTICE, "Crypto support not loaded!\n"); 00043 return NULL; 00044 }
static int stub_ast_sign | ( | struct ast_key * | key, | |
char * | msg, | |||
char * | sig | |||
) | [static] |
Definition at line 58 of file cryptostub.c.
References ast_log(), and LOG_NOTICE.
00059 { 00060 ast_log(LOG_NOTICE, "Crypto support not loaded!\n"); 00061 return -1; 00062 }
static int stub_ast_sign_bin | ( | struct ast_key * | key, | |
const char * | msg, | |||
int | msglen, | |||
unsigned char * | sig | |||
) | [static] |
Definition at line 64 of file cryptostub.c.
References ast_log(), and LOG_NOTICE.
00065 { 00066 ast_log(LOG_NOTICE, "Crypto support not loaded!\n"); 00067 return -1; 00068 }
int(*) ast_check_signature(struct ast_key *key, const char *msg, const char *sig) |
Initial value:
Check the authenticity of a message signature using a given public key.
key | a public key to use to verify | |
msg | the message that has been signed | |
sig | the proposed valid signature in mime64-like encoding |
Definition at line 79 of file cryptostub.c.
Referenced by authenticate_verify(), crypto_init(), and register_verify().
int(*) ast_check_signature_bin(struct ast_key *key, const char *msg, int msglen, const unsigned char *sig) |
Initial value:
Check the authenticity of a message signature using a given public key.
key | a public key to use to verify | |
msg | the message that has been signed | |
sig | the proposed valid signature in raw binary representation |
Definition at line 82 of file cryptostub.c.
Referenced by __ast_check_signature(), check_key(), and crypto_init().
int(*) ast_decrypt_bin(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key) |
Initial value:
key | a private key to use to decrypt | |
src | the message to decrypt | |
srclen | the length of the message to decrypt | |
dst | a pointer to a buffer of at least srclen bytes in which the decrypted answer will be stored |
Definition at line 94 of file cryptostub.c.
Referenced by check_key(), and crypto_init().
int(*) ast_encrypt_bin(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key) |
Initial value:
key | a private key to use to encrypt | |
src | the message to encrypt | |
srclen | the length of the message to encrypt | |
dst | a pointer to a buffer of at least srclen * 1.5 bytes in which the encrypted answer will be stored |
Definition at line 91 of file cryptostub.c.
Referenced by crypto_init(), and update_key().
struct ast_key*(*) ast_key_get(const char *key, int type) |
Initial value:
Retrieve a key.
name | of the key we are retrieving | |
int | type of key (AST_KEY_PUBLIC or AST_KEY_PRIVATE) |
Definition at line 76 of file cryptostub.c.
Referenced by authenticate(), authenticate_verify(), check_key(), crypto_init(), register_verify(), and update_key().
Initial value:
key | a private key to use to create the signature | |
msg | the message to sign | |
sig | a pointer to a buffer of at least 256 bytes in which the mime64-like encoded signature will be stored |
Definition at line 85 of file cryptostub.c.
Referenced by authenticate(), and crypto_init().
int(*) ast_sign_bin(struct ast_key *key, const char *msg, int msglen, unsigned char *sig) |
Initial value:
key | a private key to use to create the signature | |
msg | the message to sign | |
sig | a pointer to a buffer of at least 128 bytes in which the raw encoded signature will be stored |
Definition at line 88 of file cryptostub.c.
Referenced by __ast_sign(), crypto_init(), and update_key().