-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrypt.h
More file actions
51 lines (36 loc) · 1.67 KB
/
crypt.h
File metadata and controls
51 lines (36 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
*
* mooproxy - a smart proxy for MUD/MOO connections
* Copyright 2001-2011 Marcel Moreaux
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 dated June, 1991.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef MOOPROXY__HEADER__CRYPT
#define MOOPROXY__HEADER__CRYPT
#include "world.h"
/* Prompt the user for an authentication string, twice. Compare the strings,
* and if they're not equal, complain. Otherwise, create an MD5 hash (with
* random salt) from the string, and print that. */
extern void prompt_to_md5hash( void );
/* Check if str looks like an MD5 hash. This is not foolproof; it is intended
* to protect from simple mistakes.
* Returns 1 if str looks like a MD5 hash, and 0 if not. */
extern int looks_like_md5hash( char *str );
/* Checks if str is the correct authentication string for wld.
* If wld->auth_literal exists, str is checked against this.
* Otherwise, it's hashed and checked against wld->auth_hash.
* If str matches, and wld->auth_literal does not exist, it is created.
* Returns 1 if str matches, 0 if it doesn't. */
extern int world_match_authentication( World *wld, const char *str );
/* Matches str against md5hash.
* Returns 1 if str matches, 0 if it doesn't. */
extern int match_string_md5hash( const char *str, const char *md5hash );
#endif /* ifndef MOOPROXY__HEADER__CRYPT */