Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

passwd.c File Reference

#include "services.h"
#include <time.h>
#include <ctype.h>
#include <string.h>
#include "hash/md5.h"
#include "hash/md5pw.h"

Go to the source code of this file.

Defines

#define X_OUTPUT_MAP_SZ   64
#define X_OUTPUT_MAP_SZ   64
#define X_OUTPUT_MAP_SZ   88
#define X_BASE_ENCODING   ULONG_MAX

Typedefs

typedef unsigned char bool
 1 or 0


Functions

unsigned char * toBase64 (const unsigned char *stream, size_t left)
unsigned char * fromBase64 (const char *cStr, int *len)
char * ExpressAsHighIntBase (u_int32_t value)
const char * GetAuthChKey (const char *email, const char *password, time_t timereg, u_int32_t code_arg)
int pwd_too_simple (const char *newp)
int mpwd_too_simple (char *epwd, RegNickList *nick)
const char * PrintPass (u_char pI[], char enc)
 Print a password appropriately encoded according to its encryption type (if applicable).

int isPasswordAcceptable (const char *password, char *reason)
 Is a password acceptable?


Detailed Description

Author:
James Hess <mysidia-snn@flame.org>
Date:
2000, 2001
Id
passwd.c,v 1.1.1.1 2003/07/04 02:56:10 Mysid Exp

Services routines for managing and encoding passwords

Copyright 2000, 2001 James Hess All Rights Reserved.

See the end of this file for licensing information.

Definition in file passwd.c.


Function Documentation

unsigned char* fromBase64 const char *  cStr,
int *  len
 

Decode from base64 - whole lot easier to decode than to encode

Parameters:
cStr Memory area to read character data from
Precondition:
Stream points to a valid NUL-terminated character array of the ASCII character set that is a valid base-64 encoding of binary data
Returns:
A number of octets binary data as decoded from the input. Allocated from the heap, caller must free.

Definition at line 144 of file passwd.c.

References assert, and oalloc().

Referenced by readChanData(), and readNickData().

const char* GetAuthChKey const char *  email,
const char *  password,
time_t  timereg,
u_int32_t  code_arg
 

Precondition:
Email and Password point to valid NUL-terminated character arrays. Timereg is a valid UTC calendar time, and code_arg is a code generated at random.
Returns:
An authentication key for password changes based on a hash of all data
Parameters:
email The user e-mail address
password The value of the nick or channel password structure
code_arg The selected change code

Definition at line 298 of file passwd.c.

Referenced by IpcType::authObjMessage().

int isPasswordAcceptable const char *  password,
char *  reason
 

Is a password acceptable?

This procedure tests whether a password is acceptable or not in terms of technical devices that _need_ to have the password fit into certain ranges.

Definition at line 464 of file passwd.c.

const char* PrintPass u_char  pI[],
char  enc
 

Print a password appropriately encoded according to its encryption type (if applicable).

Parameters:
p Password field
enc Encryption status
Precondition:
pI is a NUL-terminated character array.
Returns:
A pointer to a static NUL-terminated character array containing the printable version of a password

Definition at line 440 of file passwd.c.

References toBase64().

Referenced by IpcType::authObjMessage().

unsigned char* toBase64 const unsigned char *  stream,
size_t  left
 

Encode in base64 - finally got this working, I hope. -Mysid

Parameters:
stream Memory area to read character data from
left Size of the memory area in bytes
Precondition:
Stream points to a valid (data-octet-bearing) character array of size 'left' or higher.
Returns:
A base64-encoded version of binary data read from `stream' up to `left' octets. The version returned will have been allocated from the heap. Freeing it is the caller's responsibility.

Definition at line 42 of file passwd.c.

References assert, and oalloc().

Referenced by PrintPass(), saveChanData(), and saveNickData().


Generated at Sat Oct 25 20:56:12 2003 for Services using Doxygen.
Services Copyr. 1996-2001 Chip Norkus, Max Byrd, Greg Poma, Michael Graff, James Hess, Dafydd James. All rights reserved See LICENSE for licensing information.