home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Headers / bsd / rpc / auth_des.h next >
C/C++ Source or Header  |  1991-07-15  |  2KB  |  80 lines

  1. /*    @(#)auth_des.h    1.2 88/07/29 4.0NFSSRC SMI    */
  2.  
  3. /* 
  4.  * Copyright (c) 1988 by Sun Microsystems, Inc.
  5.  * 1.3 88/02/08 SMI      
  6.  */
  7.  
  8.  
  9. /*
  10.  * auth_des.h, Protocol for DES style authentication for RPC
  11.  */
  12.  
  13. #ifndef _AUTH_DES_
  14. #define _AUTH_DES_
  15.  
  16. /*
  17.  * There are two kinds of "names": fullnames and nicknames
  18.  */
  19. enum authdes_namekind {
  20.     ADN_FULLNAME, 
  21.     ADN_NICKNAME
  22. };
  23.  
  24. /*
  25.  * A fullname contains the network name of the client, 
  26.  * a conversation key and the window
  27.  */
  28. struct authdes_fullname {
  29.     char *name;        /* network name of client, up to MAXNETNAMELEN */
  30.     des_block key;        /* conversation key */
  31.     u_long window;        /* associated window */
  32. };
  33.  
  34.  
  35. /*
  36.  * A credential 
  37.  */
  38. struct authdes_cred {
  39.     enum authdes_namekind adc_namekind;
  40.     struct authdes_fullname adc_fullname;
  41.     u_long adc_nickname;
  42. };
  43.  
  44.  
  45.  
  46. /*
  47.  * A des authentication verifier 
  48.  */
  49. struct authdes_verf {
  50.     union {
  51.         struct timeval adv_ctime;    /* clear time */
  52.         des_block adv_xtime;        /* crypt time */
  53.     } adv_time_u;
  54.     u_long adv_int_u;
  55. };
  56.  
  57. /*
  58.  * des authentication verifier: client variety
  59.  *
  60.  * adv_timestamp is the current time.
  61.  * adv_winverf is the credential window + 1.
  62.  * Both are encrypted using the conversation key.
  63.  */
  64. #define adv_timestamp    adv_time_u.adv_ctime
  65. #define adv_xtimestamp    adv_time_u.adv_xtime
  66. #define adv_winverf    adv_int_u
  67.  
  68. /*
  69.  * des authentication verifier: server variety
  70.  *
  71.  * adv_timeverf is the client's timestamp + client's window
  72.  * adv_nickname is the server's nickname for the client.
  73.  * adv_timeverf is encrypted using the conversation key.
  74.  */
  75. #define adv_timeverf    adv_time_u.adv_ctime
  76. #define adv_xtimeverf    adv_time_u.adv_xtime
  77. #define adv_nickname    adv_int_u
  78.  
  79. #endif /* ndef _AUTH_DES_ */
  80.