Anope IRC Services  Version 1.8
Functions | Variables
encrypt.c File Reference
#include "services.h"
#include "encrypt.h"
Include dependency graph for encrypt.c:

Go to the source code of this file.

Functions

void encmodule_encrypt (int(*func)(const char *src, int len, char *dest, int size))
 
void encmodule_encrypt_check_len (int(*func)(int passlen, int bufsize))
 
void encmodule_decrypt (int(*func)(const char *src, char *dest, int size))
 
void encmodule_check_password (int(*func)(const char *plaintext, const char *password))
 
int enc_encrypt (const char *src, int len, char *dest, int size)
 
int enc_encrypt_check_len (int passlen, int bufsize)
 
int enc_decrypt (const char *src, char *dest, int size)
 
int enc_check_password (const char *plaintext, const char *password)
 

Variables

Encryption encryption
 

Function Documentation

int enc_check_password ( const char *  plaintext,
const char *  password 
)

Check an input password `plaintext' against a stored, encrypted password `password'. Return value is: 1 if the password matches 0 if the password does not match -1 if an error occurred while checking

Definition at line 95 of file encrypt.c.

References encryption_::check_password.

Referenced by do_ghost(), do_group(), do_identify(), do_recover(), and do_release().

int enc_decrypt ( const char *  src,
char *  dest,
int  size 
)

Decrypt encrypted string `src' into buffer `dest' of length `len'. Returns 1 (not 0) on success, 0 if the encryption algorithm does not allow decryption, and -1 if another failure occurred (e.g. destination buffer too small).

Definition at line 80 of file encrypt.c.

References encryption_::decrypt.

Referenced by db_mysql_secure(), do_confirm(), do_getpass(), do_register(), do_saset_password(), do_sendpass(), and do_set_password().

int enc_encrypt ( const char *  src,
int  len,
char *  dest,
int  size 
)

Encrypt string `src' of length `len', placing the result in buffer `dest' of size `size'. Returns 0 on success, -1 on error.

Definition at line 50 of file encrypt.c.

References encryption_::encrypt.

Referenced by do_register(), do_saset_password(), do_set_password(), and load_ns_req_db().

int enc_encrypt_check_len ( int  passlen,
int  bufsize 
)

Check whether the result of encrypting a password of length `passlen' will fit in a buffer of size `bufsize'. Returns 0 if the encrypted password would fit in the buffer, otherwise returns the maximum length password that would fit (this value will be smaller than `passlen'). If the result of encrypting even a 1-byte password would exceed the specified buffer size, generates a fatal error.

Definition at line 66 of file encrypt.c.

References encryption_::encrypt_check_len.

Referenced by do_register(), do_saset_password(), and do_set_password().

void encmodule_check_password ( int(*)(const char *plaintext, const char *password)  func)

Definition at line 36 of file encrypt.c.

References encryption_::check_password.

Referenced by AnopeFini(), and AnopeInit().

void encmodule_decrypt ( int(*)(const char *src, char *dest, int size)  func)

Definition at line 31 of file encrypt.c.

References encryption_::decrypt.

Referenced by AnopeFini(), and AnopeInit().

void encmodule_encrypt ( int(*)(const char *src, int len, char *dest, int size)  func)

Definition at line 20 of file encrypt.c.

References encryption_::encrypt.

Referenced by AnopeFini(), and AnopeInit().

void encmodule_encrypt_check_len ( int(*)(int passlen, int bufsize)  func)

Definition at line 26 of file encrypt.c.

References encryption_::encrypt_check_len.

Referenced by AnopeFini(), and AnopeInit().

Variable Documentation

Encryption encryption

Definition at line 17 of file encrypt.c.