Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Make.win32 -fcommon, define u64int, sync libsec, libmp, libauthsrv with Plan 9, define usize, add chacha20, libsec: add mising \ #16

Merged
merged 8 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Make.win32
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CC=$(MING)gcc
AS=$(MING)as
RANLIB=$(MING)ranlib
WINDRES=$(MING)windres
CFLAGS=-Wall -Wno-missing-braces -I$(ROOT)/include -I$(ROOT) -I$(ROOT)/kern -c -D_X86_ -DIS_32 -DWINDOWS -DUNICODE -O2
CFLAGS=-Wall -Wno-missing-braces -I$(ROOT)/include -I$(ROOT) -I$(ROOT)/kern -c -D_X86_ -DIS_32 -DWINDOWS -DUNICODE -O2 -fcommon
O=o
FS=fs-win32
IP=win32
Expand Down
39 changes: 23 additions & 16 deletions include/authsrv.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ typedef struct OMSchapreply OMSchapreply;

enum
{
ANAMELEN= 28, /* maximum size of name in previous proto */
AERRLEN= 64, /* maximum size of errstr in previous proto */
DOMLEN= 48, /* length of an authentication domain name */
DESKEYLEN= 7, /* length of a des key for encrypt/decrypt */
CHALLEN= 8, /* length of a plan9 sk1 challenge */
NETCHLEN= 16, /* max network challenge length (used in AS protocol) */
ANAMELEN= 28, /* name max size in previous proto */
AERRLEN= 64, /* errstr max size in previous proto */
DOMLEN= 48, /* authentication domain name length */
DESKEYLEN= 7, /* encrypt/decrypt des key length */
CHALLEN= 8, /* plan9 sk1 challenge length */
NETCHLEN= 16, /* max network challenge length (used in AS protocol) */
CONFIGLEN= 14,
SECRETLEN= 32, /* max length of a secret */
SECRETLEN= 32, /* secret max size */

KEYDBOFF= 8, /* length of random data at the start of key file */
OKEYDBLEN= ANAMELEN+DESKEYLEN+4+2, /* length of an entry in old key file */
KEYDBLEN= OKEYDBLEN+SECRETLEN, /* length of an entry in key file */
KEYDBOFF= 8, /* bytes of random data at key file's start */
OKEYDBLEN= ANAMELEN+DESKEYLEN+4+2, /* old key file entry length */
KEYDBLEN= OKEYDBLEN+SECRETLEN, /* key file entry length */
OMD5LEN= 16,
};

Expand Down Expand Up @@ -133,21 +133,28 @@ extern int passtokey(char*, char*);
* Nvram interface
*/
enum {
NVwrite = 1<<0, /* always prompt and rewrite nvram */
NVwriteonerr = 1<<1, /* prompt and rewrite nvram when corrupt */
NVread = 0, /* just read */
NVwrite = 1<<0, /* always prompt and rewrite nvram */
NVwriteonerr = 1<<1, /* prompt and rewrite nvram when corrupt */
NVwritemem = 1<<2, /* don't prompt, write nvram from argument */
};

/* storage layout */
struct Nvrsafe
{
char machkey[DESKEYLEN];
char machkey[DESKEYLEN]; /* was file server's authid's des key */
uchar machsum;
char authkey[DESKEYLEN];
char authkey[DESKEYLEN]; /* authid's des key from password */
uchar authsum;
/*
* file server config string of device holding full configuration;
* secstore key on non-file-servers.
*/
char config[CONFIGLEN];
uchar configsum;
char authid[ANAMELEN];
char authid[ANAMELEN]; /* auth userid, e.g., bootes */
uchar authidsum;
char authdom[DOMLEN];
char authdom[DOMLEN]; /* auth domain, e.g., cs.bell-labs.com */
uchar authdomsum;
};

Expand Down
4 changes: 4 additions & 0 deletions include/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@
typedef unsigned char p9_uchar;
typedef unsigned int p9_uint;
typedef unsigned int p9_ulong;
typedef unsigned long p9_usize;
typedef int p9_long;
typedef signed char p9_schar;
typedef unsigned short p9_ushort;
typedef unsigned int Rune;
typedef unsigned int p9_u32int;
typedef unsigned long long p9_u64int;
typedef p9_u32int mpdigit;

/* make sure we don't conflict with predefined types */
Expand All @@ -43,10 +45,12 @@ typedef p9_u32int mpdigit;
#define ushort p9_ushort
#define uint p9_uint
#define u32int p9_u32int
#define u64int p9_u64int

/* #define long int rather than p9_long so that "unsigned long" is valid */
#define long int
#define ulong p9_ulong
#define usize p9_usize
#define vlong p9_vlong
#define uvlong p9_uvlong

Expand Down
Loading
Loading