libauthsrv: export common readcons() routine and introduce PASSWDLEN constant

drawterm, factotum, secstore and the auth commands
all had ther own implementation of readcons. we
want to have one common function for this to avoid
the duplication, so putting that in libauthsrv.

introduce PASSWDLEN which makes the use more explicit
than ANAMELEN.
This commit is contained in:
cinap_lenrek 2016-07-31 20:04:02 +02:00
parent d91c4e407d
commit cf37a1010f
5 changed files with 129 additions and 93 deletions

View file

@ -26,6 +26,7 @@ enum
NETCHLEN= 16, /* max network challenge length (used in AS protocol) */
CONFIGLEN= 14,
SECRETLEN= 32, /* secret max size */
PASSWDLEN= 28, /* password max size */
NONCELEN= 32,
@ -102,8 +103,8 @@ struct Authenticator
struct Passwordreq
{
char num;
char old[ANAMELEN];
char new[ANAMELEN];
char old[PASSWDLEN];
char new[PASSWDLEN];
char changesecret;
char secret[SECRETLEN]; /* new secret */
};
@ -187,6 +188,7 @@ struct Nvrsafe
extern uchar nvcsum(void*, int);
extern int readnvram(Nvrsafe*, int);
extern char* readcons(char*, char*, int);
/*
* call up auth server