secstore.h 841 B

123456789101112131415161718192021222324252627282930
  1. enum{ MAXFILESIZE = 10*1024*1024 };
  2. enum{// PW status bits
  3. Enabled = (1<<0),
  4. STA = (1<<1), // extra SecurID step
  5. };
  6. typedef struct PW {
  7. char *id; // user id
  8. ulong expire; // expiration time (epoch seconds)
  9. ushort status; // Enabled, STA, ...
  10. ushort failed; // number of failed login attempts
  11. char *other; // other information, e.g. sponsor
  12. mpint *Hi; // H(passphrase)^-1 mod p
  13. } PW;
  14. PW *getPW(char *, int);
  15. int putPW(PW *);
  16. void freePW(PW *);
  17. int getpasswd(char*, char*, int);
  18. // *client: SConn, client name, passphrase
  19. // *server: SConn, (partial) 1st msg, PW entry
  20. // *setpass: Username, hashed passphrase, PW entry
  21. int PAKclient(SConn *, char *, char *, char **);
  22. int PAKserver(SConn *, char *, char *, PW **);
  23. char *PAK_Hi(char *, char *, mpint *, mpint *);
  24. #define LOG "secstore"
  25. #define SECSTORE_DIR "/adm/secstore"