const-ify
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8499 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1995, 1996, 1997 Kungliga Tekniska H<>gskolan
|
||||
* Copyright (c) 1995 - 2000 Kungliga Tekniska H<>gskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -60,7 +60,7 @@ typedef struct {
|
||||
OtpAlgID id;
|
||||
char *name;
|
||||
int hashsize;
|
||||
int (*hash)(char *s, size_t len, unsigned char *res);
|
||||
int (*hash)(const char *s, size_t len, unsigned char *res);
|
||||
int (*init)(OtpKey key, char *pwd, char *seed);
|
||||
int (*next)(OtpKey key);
|
||||
} OtpAlgorithm;
|
||||
@@ -82,13 +82,13 @@ void otp_print_hex (OtpKey key, char *str, size_t sz);
|
||||
void otp_print_stddict_extended (OtpKey key, char *str, size_t sz);
|
||||
void otp_print_hex_extended (OtpKey key, char *str, size_t sz);
|
||||
unsigned otp_checksum (OtpKey key);
|
||||
int otp_parse_hex (OtpKey key, char *);
|
||||
int otp_parse_stddict (OtpKey key, char *);
|
||||
int otp_parse_altdict (OtpKey key, char *, OtpAlgorithm *);
|
||||
int otp_parse (OtpKey key, char *, OtpAlgorithm *);
|
||||
int otp_parse_hex (OtpKey key, const char *);
|
||||
int otp_parse_stddict (OtpKey key, const char *);
|
||||
int otp_parse_altdict (OtpKey key, const char *, OtpAlgorithm *);
|
||||
int otp_parse (OtpKey key, const char *, OtpAlgorithm *);
|
||||
int otp_challenge (OtpContext *ctx, char *user, char *str, size_t len);
|
||||
int otp_verify_user (OtpContext *ctx, char *passwd);
|
||||
int otp_verify_user_1 (OtpContext *ctx, char *passwd);
|
||||
int otp_verify_user (OtpContext *ctx, const char *passwd);
|
||||
int otp_verify_user_1 (OtpContext *ctx, const char *passwd);
|
||||
char *otp_error (OtpContext *ctx);
|
||||
|
||||
void *otp_db_open (void);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska H<>gskolan
|
||||
* Copyright (c) 1995 - 2000 Kungliga Tekniska H<>gskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -56,11 +56,11 @@ cmp(const void *a, const void *b)
|
||||
}
|
||||
|
||||
static int
|
||||
get_stdword (char *s, void *v)
|
||||
get_stdword (const char *s, void *v)
|
||||
{
|
||||
struct e e, *r;
|
||||
|
||||
e.s = s;
|
||||
e.s = (char *)s;
|
||||
e.n = -1;
|
||||
r = (struct e *) bsearch (&e, inv_std_dict,
|
||||
sizeof(inv_std_dict)/sizeof(*inv_std_dict),
|
||||
@@ -85,7 +85,7 @@ compress (OtpKey key, unsigned wn[])
|
||||
}
|
||||
|
||||
static int
|
||||
get_altword (char *s, void *a)
|
||||
get_altword (const char *s, void *a)
|
||||
{
|
||||
OtpAlgorithm *alg = (OtpAlgorithm *)a;
|
||||
int ret;
|
||||
@@ -102,8 +102,8 @@ get_altword (char *s, void *a)
|
||||
|
||||
static int
|
||||
parse_words(unsigned wn[],
|
||||
char *str,
|
||||
int (*convert)(char *, void *),
|
||||
const char *str,
|
||||
int (*convert)(const char *, void *),
|
||||
void *arg)
|
||||
{
|
||||
unsigned char *w, *wend, c;
|
||||
@@ -130,8 +130,9 @@ parse_words(unsigned wn[],
|
||||
}
|
||||
|
||||
static int
|
||||
otp_parse_internal (OtpKey key, char *str, OtpAlgorithm *alg,
|
||||
int (*convert)(char *, void *))
|
||||
otp_parse_internal (OtpKey key, const char *str,
|
||||
OtpAlgorithm *alg,
|
||||
int (*convert)(const char *, void *))
|
||||
{
|
||||
unsigned wn[6];
|
||||
|
||||
@@ -144,19 +145,19 @@ otp_parse_internal (OtpKey key, char *str, OtpAlgorithm *alg,
|
||||
}
|
||||
|
||||
int
|
||||
otp_parse_stddict (OtpKey key, char *str)
|
||||
otp_parse_stddict (OtpKey key, const char *str)
|
||||
{
|
||||
return otp_parse_internal (key, str, NULL, get_stdword);
|
||||
}
|
||||
|
||||
int
|
||||
otp_parse_altdict (OtpKey key, char *str, OtpAlgorithm *alg)
|
||||
otp_parse_altdict (OtpKey key, const char *str, OtpAlgorithm *alg)
|
||||
{
|
||||
return otp_parse_internal (key, str, alg, get_altword);
|
||||
}
|
||||
|
||||
int
|
||||
otp_parse_hex (OtpKey key, char *s)
|
||||
otp_parse_hex (OtpKey key, const char *s)
|
||||
{
|
||||
char buf[17], *b;
|
||||
int is[8];
|
||||
@@ -183,7 +184,7 @@ otp_parse_hex (OtpKey key, char *s)
|
||||
}
|
||||
|
||||
int
|
||||
otp_parse (OtpKey key, char *s, OtpAlgorithm *alg)
|
||||
otp_parse (OtpKey key, const char *s, OtpAlgorithm *alg)
|
||||
{
|
||||
int ret;
|
||||
int dohex = 1;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1995, 1996, 1997 Kungliga Tekniska H<>gskolan
|
||||
* Copyright (c) 1995 - 2000 Kungliga Tekniska H<>gskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -39,7 +39,7 @@ RCSID("$Id$");
|
||||
#include "otp_locl.h"
|
||||
|
||||
int
|
||||
otp_verify_user_1 (OtpContext *ctx, char *passwd)
|
||||
otp_verify_user_1 (OtpContext *ctx, const char *passwd)
|
||||
{
|
||||
OtpKey key1, key2;
|
||||
|
||||
@@ -58,7 +58,7 @@ otp_verify_user_1 (OtpContext *ctx, char *passwd)
|
||||
}
|
||||
|
||||
int
|
||||
otp_verify_user (OtpContext *ctx, char *passwd)
|
||||
otp_verify_user (OtpContext *ctx, const char *passwd)
|
||||
{
|
||||
void *dbm;
|
||||
int ret;
|
||||
|
Reference in New Issue
Block a user