home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_j_p / draft-ietf-oncrpc-auth-03.txt < prev    next >
Text File  |  1996-08-28  |  33KB  |  1,006 lines

  1.  
  2.  
  3.  
  4. ONC RPC Working Group                                  Stephen X. Nahm
  5. INTERNET-DRAFT                                         Sun Microsystems
  6. Category: Informational                                August 28, 1996
  7.  
  8.                    Authentication Mechanisms for ONC RPC
  9.  
  10.                        draft-ietf-oncrpc-auth-03.txt
  11.  
  12.  
  13. ABSTRACT
  14.  
  15. This document describes two authentication mechanisms created by Sun
  16. Microsystems that are commonly used in conjunction with the ONC Remote
  17. Procedure Call (ONC RPC Version 2) protocol.
  18.  
  19. STATUS OF THIS MEMO
  20.  
  21. This document is an Internet-Draft.  Internet-Drafts are working documents
  22. of the Internet Engineering Task Force (IETF), its areas, and its working
  23. groups.  Note that other groups may also distribute working documents as
  24. Internet-Drafts.
  25.  
  26. Internet-Drafts are draft documents valid for a maximum of six months.
  27. This Internet-Draft expires on February 27, 1996.  Internet-Drafts may be
  28. updated, replaced, or obsoleted by other documents at any time. It is not
  29. appropriate to use Internet-Drafts as reference material or to cite them
  30. other than as "work in progress."
  31.  
  32. To learn the current status of any Internet-Draft, please check the "1id-
  33. abstracts.txt" listing contained in the Internet-Drafts Shadow Directories
  34. on ftp.is.co.za (Africa), nic.nordu.net (Europe), munnari.oz.au (Pacific
  35. Rim), ds.internic.net (US East Coast), or ftp.isi.edu (US West Coast).
  36.  
  37. Distribution of this memo is unlimited.
  38.  
  39. WARNING
  40.  
  41. Diffie-Hellman authentication, as documented below, is compromised.  A
  42. large number of attacks are possible on ONC RPC system services that use
  43. non-secure authentication mechanisms [10].  Therefore, truly secure
  44. authentication mechanisms need to be developed for ONC RPC.  Future work is
  45. expected in this area and should be documented in the RFC series.
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60. Expires: February 28, 1996     Informational               [Page 1]
  61.  
  62.  
  63.  
  64. INTERNET-DRAFT     Authentication Mechanisms for ONC RPC       28-August-96
  65.  
  66.  
  67. CONTENTS
  68.  
  69.    1. Introduction
  70.    2. Diffie-Hellman Authentication
  71.    2.1 Naming
  72.    2.2 DH Authentication Verifiers
  73.    2.3 Nicknames and Clock Synchronization
  74.    2.4 DH Authentication Protocol Specification
  75.    2.4.1 The Full Network Name Credential and Verifier (Client)
  76.    2.4.2 The Nickname Credential and Verifier (Client)
  77.    2.4.3 The Nickname Verifier (Server)
  78.    2.5 Diffie-Hellman Encryption
  79.    3. Kerberos-based Authentication
  80.    3.1 Naming
  81.    3.2 Kerberos-based Authentication Protocol Specification
  82.    3.2.1 The Full Network Name Credential and Verifier (Client)
  83.    3.2.2 The Nickname Credential and Verifier (Client)
  84.    3.2.3 The Nickname Verifier (Server)
  85.    4. REFERENCES
  86.    5. AUTHOR'S ADDRESS
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123. Expires: February 28, 1996     Informational               [Page 2]
  124.  
  125.  
  126.  
  127. INTERNET-DRAFT     Authentication Mechanisms for ONC RPC       28-August-96
  128.  
  129.  
  130. 1. Introduction
  131.  
  132. The ONC RPC protocol provides the fields necessary for a client to identify
  133. itself to a service, and vice-versa, in each call and reply message.
  134. Security and access control mechanisms can be built on top of this message
  135. authentication.  Several different authentication protocols can be
  136. supported.
  137.  
  138. This document specifies two authentication protocols created by Sun
  139. Microsystems that are commonly used Diffie-Hellman (DH) authentication and
  140. Kerberos (Version 4) based authentication.
  141.  
  142. As a prerequisite to reading this document, the reader is expected to be
  143. familiar with [1] and [2].  This document uses terminology and definitions
  144. from [1] and [2].
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186. Expires: February 28, 1996     Informational               [Page 3]
  187.  
  188.  
  189.  
  190. INTERNET-DRAFT     Authentication Mechanisms for ONC RPC       28-August-96
  191.  
  192.  
  193. 2. Diffie-Hellman Authentication
  194.  
  195. System authentication (defined in [1]) suffers from some problems.  It is
  196. very unix oriented, and can be easily faked (there is no attempt to provide
  197. cryptographically secure authentication).
  198.  
  199. DH authentication was created to address these problems.  However, it has
  200. been compromised [9].  Whilst the information provided here will be useful
  201. for implementors to ensure interoperability with existing applications that
  202. use DH authentication, it is strongly recommended that new applications use
  203. more secure schemes, and that existing applications that currently use DH
  204. authentication migrate to more robust authentication mechanisms.
  205.  
  206. 2.1 Naming
  207.  
  208. The client is addressed by a simple string of characters instead of by an
  209. operating system specific integer.  This string of characters is known as
  210. the "netname" or network name of the client. The server is not allowed to
  211. interpret the contents of the client's name in any other way except to
  212. identify the client.  Thus, netnames should be unique for every client in
  213. the Internet.
  214.  
  215. It is up to each operating system's implementation of DH authentication to
  216. generate netnames for its users that insure this uniqueness when they call
  217. upon remote servers.  Operating systems already know how to distinguish
  218. users local to their systems. It is usually a simple matter to extend this
  219. mechanism to the network.  For example, a UNIX(tm) user at Sun with a user
  220. ID of 515 might be assigned the following netname: "unix.515@sun.com".
  221. This netname contains three items that serve to insure it is unique.  Going
  222. backwards, there is only one naming domain called "sun.com" in the
  223. Internet.  Within this domain, there is only one UNIX(tm) user with user ID
  224. 515.  However, there may be another user on another operating system, for
  225. example VMS, within the same naming domain that, by coincidence, happens to
  226. have the same user ID. To insure that these two users can be distinguished
  227. we add the operating system name. So one user is "unix.515@sun.com" and the
  228. other is "vms.515@sun.com".  The first field is actually a naming method
  229. rather than an operating system name.  It happens that today there is
  230. almost a one-to-one correspondence between naming methods and operating
  231. systems.  If the world could agree on a naming standard, the first field
  232. could be the name of that standard, instead of an operating system name.
  233.  
  234. 2.2 DH Authentication Verifiers
  235.  
  236. Unlike System authentication, DH authentication does have a verifier so the
  237. server can validate the client's credential (and vice-versa).  The contents
  238. of this verifier is primarily an encrypted timestamp.  The server can
  239. decrypt this timestamp, and if it is within an accepted range relative to
  240. the current time, then the client must have encrypted it correctly.  The
  241. only way the client could encrypt it correctly is to know the "conversation
  242. key" of the RPC session, and if the client knows the conversation key, then
  243. it must be the real client.
  244.  
  245. The conversation key is a DES [5] key which the client generates and passes
  246.  
  247.  
  248.  
  249. Expires: February 28, 1996     Informational               [Page 4]
  250.  
  251.  
  252.  
  253. INTERNET-DRAFT     Authentication Mechanisms for ONC RPC       28-August-96
  254.  
  255.  
  256. to the server in the first RPC call of a session.  The conversation key is
  257. encrypted using a public key scheme in this first transaction.  The
  258. particular public key scheme used in DH authentication is Diffie-Hellman
  259. [3] with 192-bit keys.  The details of this encryption method are described
  260. later.
  261.  
  262. The client and the server need the same notion of the current time in order
  263. for all of this to work, perhaps by using the Network Time Protocol [4].
  264. If network time synchronization cannot be guaranteed, then the client can
  265. determine the server's time before beginning the conversation using a time
  266. request protocol.
  267.  
  268. The way a server determines if a client timestamp is valid is somewhat
  269. complicated. For any other transaction but the first, the server just
  270. checks for two things:
  271.  
  272. (1) the timestamp is greater than the one  previously seen from the same
  273. client.  (2) the timestamp has not expired.
  274.  
  275. A timestamp is expired if the server's time is later than the sum of the
  276. client's timestamp plus what is known as the client's "ttl" (standing for
  277. "time-to-live" - you can think of this as the lifetime for the client's
  278. credential).  The "ttl" is a number the client passes (encrypted) to the
  279. server in its first transaction.
  280.  
  281. In the first transaction, the server checks only that the timestamp has not
  282. expired.  Also, as an added check, the client sends an encrypted item in
  283. the first transaction known as the "ttl verifier" which must be equal to
  284. the time-to-live minus 1, or the server will reject the credential.  If
  285. either check fails, the server rejects the credential with an
  286. authentication status of AUTH_BADCRED, however if the timestamp is earlier
  287. than the previous one seen, the server returns an authentication status of
  288. AUTH_REJECTEDCRED.
  289.  
  290. The client too must check the verifier returned from the server to be sure
  291. it is legitimate.  The server sends back to the client the timestamp it
  292. received from the client, minus one second, encrypted with the conversation
  293. key.  If the client gets anything different than this, it will reject it,
  294. returning an AUTH_INVALIDRESP authentication status to the user.
  295.  
  296. 2.3 Nicknames and Clock Synchronization
  297.  
  298. After the first transaction, the server's DH authentication subsystem
  299. returns in its verifier to the client an integer "nickname" which the
  300. client may use in its further transactions instead of passing its netname.
  301. The nickname could be an index into a table on the server which stores for
  302. each client its netname, decrypted conversation key and ttl.
  303.  
  304. Though they originally were synchronized, the client's and server's clocks
  305. can get out of synchronization again.  When this happens the server returns
  306. to the client an authentication status of AUTH_REJECTEDVERF at which point
  307. the client should attempt to resynchronize.
  308.  
  309.  
  310.  
  311.  
  312. Expires: February 28, 1996     Informational               [Page 5]
  313.  
  314.  
  315.  
  316. INTERNET-DRAFT     Authentication Mechanisms for ONC RPC       28-August-96
  317.  
  318.  
  319. A client may also get a AUTH_BADCRED error when using a nickname that was
  320. previously valid.  The reason is that the server's nickname table is a
  321. limited size, and it may flush entries whenever it wants.  A client should
  322. resend its original full name credential in this case and the server will
  323. give it a new nickname.  If a server crashes, the entire nickname table
  324. gets flushed, and all clients will have to resend their original
  325. credentials.
  326.  
  327. 2.4 DH Authentication Protocol Specification
  328.  
  329. There are two kinds of credentials: one in which the client uses its full
  330. network name, and one in which it uses its "nickname" (just an unsigned
  331. integer) given to it by the server.  The client must use its fullname in
  332. its first transaction with the server, in which the server will return to
  333. the client its nickname.  The client may use its nickname in all further
  334. transactions with the server. There is no requirement to use the nickname,
  335. but it is wise to use it for performance reasons.
  336.  
  337. The following definitions are used for describing the protocol:
  338.  
  339.    enum authdh_namekind {
  340.       ADN_FULLNAME = 0,
  341.       ADN_NICKNAME = 1
  342.    };
  343.  
  344.    typedef opaque des_block[8]; /* 64-bit block of encrypted data */
  345.  
  346.    const MAXNETNAMELEN = 255;   /* maximum length of a netname */
  347.  
  348. The flavor used for all DH authentication credentials and verifiers is
  349. "AUTH_DH", with the numerical value 3.  The opaque data constituting the
  350. client credential encodes the following structure:
  351.  
  352. union authdh_cred switch (authdh_namekind namekind) {
  353. case ADN_FULLNAME:
  354.    authdh_fullname fullname;
  355. case ADN_NICKNAME:
  356.    authdh_nickname nickname;
  357. };
  358.  
  359. The opaque data constituting a verifier that accompanies a client
  360. credential encodes the following structure:
  361.  
  362. union authdh_verf switch (authdh_namekind namekind) {
  363. case ADN_FULLNAME:
  364.    authdh_fullname_verf fullname_verf;
  365. case ADN_NICKNAME:
  366.    authdh_nickname_verf nickname_verf;
  367. };
  368.  
  369. The opaque data constituting a verifier returned by a server in response to
  370. a client request encodes the following structure:
  371.  
  372.  
  373.  
  374.  
  375. Expires: February 28, 1996     Informational               [Page 6]
  376.  
  377.  
  378.  
  379. INTERNET-DRAFT     Authentication Mechanisms for ONC RPC       28-August-96
  380.  
  381.  
  382. struct authdh_server_verf;
  383.  
  384. These structures are described in detail below.
  385.  
  386. 2.4.1 The Full Network Name Credential and Verifier (Client)
  387.  
  388. First, the client creates a conversation key for the session. Next, the
  389. client fills out the following structure:
  390.  
  391.    +---------------------------------------------------------------+
  392.    |   timestamp   |  timestamp    |               |               |
  393.    |   seconds     | micro seconds |      ttl      |   ttl - 1     |
  394.    |   32 bits     |    32 bits    |    32 bits    |   32 bits     |
  395.    +---------------------------------------------------------------+
  396.    0              31              63              95             127
  397.  
  398. The fields are stored in XDR (external data representation) format.  The
  399. timestamp encodes the time since midnight, January 1, 1970.  These 128 bits
  400. of data are then encrypted in the DES CBC mode, using the conversation key
  401. for the session, and with an initialization vector of 0.  This yields:
  402.  
  403.    +---------------------------------------------------------------+
  404.    |               T               |               |               |
  405.    |     T1               T2       |      W1       |     W2        |
  406.    |   32 bits     |    32 bits    |    32 bits    |   32 bits     |
  407.    +---------------------------------------------------------------+
  408.    0              31              63              95             127
  409.  
  410. where T1, T2, W1, and W2 are all 32-bit quantities, and have some
  411. correspondence to the original quantities occupying their positions, but
  412. are now interdependent on each other for proper decryption.  The 64 bit
  413. sequence comprising T1 and T2 is denoted by T.
  414.  
  415. The full network name credential is represented as follows using XDR
  416. notation:
  417.  
  418. struct authdh_fullname {
  419.    string name<MAXNETNAMELEN>;  /* netname of client             */
  420.    des_block key;               /* encrypted conversation key    */
  421.    opaque w1[4];                /* W1                            */
  422. };
  423.  
  424. The conversation key is encrypted using the "common key" using the ECB
  425. mode.  The common key is a DES key that is derived from the Diffie-Hellman
  426. public and private keys, and is described later.
  427.  
  428. The verifier is represented as follows:
  429.  
  430. struct authdh_fullname_verf {
  431.    des_block timestamp;         /* T (the 64 bits of T1 and T2) */
  432.    opaque w2[4];                /* W2                           */
  433. };
  434.  
  435.  
  436.  
  437.  
  438. Expires: February 28, 1996     Informational               [Page 7]
  439.  
  440.  
  441.  
  442. INTERNET-DRAFT     Authentication Mechanisms for ONC RPC       28-August-96
  443.  
  444.  
  445. Note that all of the encrypted quantities (key, w1, w2, timestamp) in the
  446. above structures are opaque.
  447.  
  448. The fullname credential and its associated verifier together contain the
  449. network name of the client, an encrypted conversation key, the ttl, a
  450. timestamp, and a ttl verifier that is one less than the ttl.  The ttl is
  451. actually the lifetime for the credential.  The server will accept the
  452. credential if the current server time is "within" the time indicated in the
  453. timestamp plus the ttl.  Otherwise, the server rejects the credential with
  454. an authentication status of AUTH_BADCRED.  One way to insure that requests
  455. are not replayed would be for the server to insist that timestamps are
  456. greater than the previous one seen, unless it is the first transaction.  If
  457. the timestamp is earlier than the previous one seen, the server returns an
  458. authentication status of AUTH_REJECTEDCRED.
  459.  
  460. The server returns a authdh_server_verf structure, which is described in
  461. detail below.  This structure contains a "nickname", which may be used for
  462. subsequent requests in the current conversation.
  463.  
  464. 2.4.2 The Nickname Credential and Verifier (Client)
  465.  
  466. In transactions following the first, the client may use the shorter
  467. nickname credential and verifier for efficiency.  First, the client fills
  468. out the following structure:
  469.  
  470.    +-------------------------------+
  471.    |   timestamp   |  timestamp    |
  472.    |   seconds     | micro seconds |
  473.    |   32 bits     |    32 bits    |
  474.    +-------------------------------+
  475.    0              31              63
  476.  
  477. The fields are stored in XDR (external data representation) format.  These
  478. 64 bits of data are then encrypted in the DES ECB mode, using the
  479. conversation key for the session.  This yields:
  480.  
  481.    +-------------------------------+
  482.    |     (T1)      |      (T2)     |
  483.    |               T               |
  484.    |             64 bits           |
  485.    +-------------------------------+
  486.    0              31              63
  487.  
  488. The nickname credential is represented as follows using XDR notation:
  489.  
  490. struct authdh_nickname {
  491.    unsigned int nickname;       /* nickname returned by server   */
  492. };
  493.  
  494. The nickname verifier is represented as follows using XDR notation:
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501. Expires: February 28, 1996     Informational               [Page 8]
  502.  
  503.  
  504.  
  505. INTERNET-DRAFT     Authentication Mechanisms for ONC RPC       28-August-96
  506.  
  507.  
  508. struct authdh_nickname_verf {
  509.    des_block timestamp;         /* T (the 64 bits of T1 and T2) */
  510.    opaque w[4];                 /* Set to zero                  */
  511. };
  512.  
  513. The nickname credential may be reject by the server for several reasons.
  514. An authentication status of AUTH_BADCRED indicates that the nickname is no
  515. longer valid. The client should retry the request using the fullname
  516. credential.  AUTH_REJECTEDVERF indicates that the nickname verifier is not
  517. valid.  Again, the client should retry the request using the fullname
  518. credential.
  519.  
  520. 2.4.3 The Nickname Verifier (Server)
  521.  
  522. The server never returns a credential.  It returns only one kind of
  523. verifier, i.e., the nickname verifier.  This has the following XDR
  524. representation:
  525.  
  526. struct authdh_server_verf {
  527.    des_block timestamp_verf; /* timestamp verifier (encrypted)    */
  528.    unsigned int nickname;    /* new client nickname (unencrypted) */
  529. };
  530.  
  531. The timestamp verifier is constructed in exactly the same way as the client
  532. nickname credential.  The server sets the timestamp value to the value the
  533. client sent minus one second and encrypts it in DES ECB mode using the
  534. conversation key.  The server also sends the client a nickname to be used
  535. in future transactions (unencrypted).
  536.  
  537. 2.5 Diffie-Hellman Encryption
  538.  
  539. In this scheme, there are two constants "BASE" and "MODULUS" [3].  The
  540. particular values Sun has chosen for these for the DH authentication
  541. protocol are:
  542.  
  543.    const BASE = 3;
  544.    const MODULUS = "d4a0ba0250b6fd2ec626e7efd637df76c716e22d0944b88b";
  545.  
  546. Note that the modulus is represented above as a hexadecimal string.
  547.  
  548. The way this scheme works is best explained by an example.  Suppose there
  549. are two people "A" and "B" who want to send encrypted messages to each
  550. other.  So, A and B both generate "secret" keys at random which they do not
  551. reveal to anyone.  Let these keys be represented as SK(A) and SK(B).  They
  552. also publish in a public directory their "public" keys. These keys are
  553. computed as follows:
  554.  
  555.    PK(A) = ( BASE ** SK(A) ) mod MODULUS
  556.    PK(B) = ( BASE ** SK(B) ) mod MODULUS
  557.  
  558. The "**" notation is used here to represent exponentiation. Now, both A and
  559. B can arrive at the "common" key between them, represented here as CK(A,
  560. B), without revealing their secret keys.
  561.  
  562.  
  563.  
  564. Expires: February 28, 1996     Informational               [Page 9]
  565.  
  566.  
  567.  
  568. INTERNET-DRAFT     Authentication Mechanisms for ONC RPC       28-August-96
  569.  
  570.  
  571. A computes:
  572.  
  573.    CK(A, B) = ( PK(B) ** SK(A)) mod MODULUS
  574.  
  575. while B computes:
  576.  
  577.    CK(A, B) = ( PK(A) ** SK(B)) mod MODULUS
  578.  
  579. These two can be shown to be equivalent:
  580.  
  581.    (PK(B) ** SK(A)) mod MODULUS = (PK(A) ** SK(B)) mod MODULUS
  582.  
  583. We drop the "mod MODULUS" parts and assume modulo arithmetic to simplify
  584. things:
  585.  
  586.    PK(B) ** SK(A) = PK(A) ** SK(B)
  587.  
  588. Then, replace PK(B) by what B computed earlier and likewise for PK(A).
  589.  
  590.    (BASE ** SK(B)) ** SK(A) = (BASE ** SK(A)) ** SK(B)
  591.  
  592. which leads to:
  593.  
  594.    BASE ** (SK(A) * SK(B)) = BASE ** (SK(A) * SK(B))
  595.  
  596. This common key CK(A, B) is not used to encrypt the timestamps used in the
  597. protocol. Rather, it is used only to encrypt a conversation key which is
  598. then used to encrypt the timestamps.  The reason for doing this is to use
  599. the common key as little as possible, for fear that it could be broken.
  600. Breaking the conversation key is a far less damaging, since conversations
  601. are relatively short-lived.
  602.  
  603. The conversation key is encrypted using 56-bit DES keys, yet the common key
  604. is 192 bits.  To reduce the number of bits, 56 bits are selected from the
  605. common key as follows. The middle-most 8-bytes are selected from the common
  606. key, and then parity is added to the lower order bit of each byte,
  607. producing a 56-bit key with 8 bits of parity.
  608.  
  609. Only 48 bits of the 8-byte conversation key is used in the DH
  610. Authentication scheme.  The least and most significant bits of each byte of
  611. the conversation key are unused.
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627. Expires: February 28, 1996     Informational              [Page 10]
  628.  
  629.  
  630.  
  631. INTERNET-DRAFT     Authentication Mechanisms for ONC RPC       28-August-96
  632.  
  633.  
  634. 3. Kerberos-based Authentication
  635.  
  636. Conceptually, Kerberos-based authentication is very similar to DH
  637. authentication.  The major difference is, Kerberos-based authentication
  638. takes advantage of the fact that Kerberos tickets have encoded in them the
  639. client name and the conversation key.  This RFC does not describe Kerberos
  640. name syntax, protocols and ticket formats.  The reader is referred to [6],
  641. [7], and [8].
  642.  
  643. 3.1 Naming
  644.  
  645. A Kerberos name contains three parts.  The first is the principal name,
  646. which is usually a user's or service's name.  The second is the instance,
  647. which in the case of a user is usually NULL.  Some users may have
  648. privileged instances, however, such as root or admin.  In the case of a
  649. service, the instance is the name of the machine on which it runs; that is,
  650. there can be an NFS service running on the machine ABC, which is different
  651. from the NFS service running on the machine XYZ.  The third part of a
  652. Kerberos name is the realm.  The realm corresponds to the Kerberos service
  653. providing authentication for the principal.  When writing a Kerberos name,
  654. the principal name is separated from the instance (if not NULL) by a
  655. period, and the realm (if not the local realm) follows, preceded by an
  656. ``@'' sign.  The following are examples of valid Kerberos names:
  657.  
  658.    billb
  659.    jis.admin
  660.    srz@lcs.mit.edu
  661.    treese.root@athena.mit.edu
  662.  
  663. 3.2 Kerberos-based Authentication Protocol Specification
  664.  
  665. The Kerberos-based authentication protocol described is based on Kerberos
  666. version 4.
  667.  
  668. There are two kinds of credentials: one in which the client uses its full
  669. network name, and one in which it uses its "nickname" (just an unsigned
  670. integer) given to it by the server.  The client must use its fullname in
  671. its first transaction with the server, in which the server will return to
  672. the client its nickname.  The client may use its nickname in all further
  673. transactions with the server. There is no requirement to use the nickname,
  674. but it is wise to use it for performance reasons.
  675.  
  676. The following definitions are used for describing the protocol:
  677.  
  678.    enum authkerb4_namekind {
  679.       AKN_FULLNAME = 0,
  680.       AKN_NICKNAME = 1
  681.    };
  682.  
  683. The flavor used for all Kerberos-based authentication credentials and
  684. verifiers is "AUTH_KERB4", with numerical value 4.  The opaque data
  685. constituting the client credential encodes the following structure:
  686.  
  687.  
  688.  
  689.  
  690. Expires: February 28, 1996     Informational              [Page 11]
  691.  
  692.  
  693.  
  694. INTERNET-DRAFT     Authentication Mechanisms for ONC RPC       28-August-96
  695.  
  696.  
  697. union authkerb4_cred switch (authkerb4_namekind namekind) {
  698. case AKN_FULLNAME:
  699.    authkerb4_fullname fullname;
  700. case AKN_NICKNAME:
  701.    authkerb4_nickname nickname;
  702. };
  703.  
  704. The opaque data constituting a verifier that accompanies a client
  705. credential encodes the following structure:
  706.  
  707. union authkerb4_verf switch (authkerb4_namekind namekind) {
  708. case AKN_FULLNAME:
  709.    authkerb4_fullname_verf fullname_verf;
  710. case AKN_NICKNAME:
  711.    authkerb4_nickname_verf nickname_verf;
  712. };
  713.  
  714. The opaque data constituting a verifier returned by a server in response to
  715. a client request encodes the following structure:
  716.  
  717. struct authkerb4_server_verf;
  718.  
  719. These structures are described in detail below.
  720.  
  721. 3.2.1 The Full Network Name Credential and Verifier (Client)
  722.  
  723. First, the client must obtain a Kerberos ticket from the Kerberos Server.
  724. The ticket contains a Kerberos session key, which will become the
  725. conversation key.  Next, the client fills out the following structure:
  726.  
  727.    +---------------------------------------------------------------+
  728.    |   timestamp   |  timestamp    |               |               |
  729.    |   seconds     | micro seconds |      ttl      |   ttl - 1     |
  730.    |   32 bits     |    32 bits    |    32 bits    |   32 bits     |
  731.    +---------------------------------------------------------------+
  732.    0              31              63              95             127
  733.  
  734. The fields are stored in XDR (external data representation) format.  The
  735. timestamp encodes the time since midnight, January 1, 1970.  "ttl" is
  736. identical in meaning to the corresponding field in Diffie-Hellman
  737. authentication: the credential "time-to-live" for the conversation being
  738. initiated.  These 128 bits of data are then encrypted in the DES CBC mode,
  739. using the conversation key, and with an initialization vector of 0.  This
  740. yields:
  741.  
  742.    +---------------------------------------------------------------+
  743.    |               T               |               |               |
  744.    |     T1               T2       |      W1       |     W2        |
  745.    |   32 bits     |    32 bits    |    32 bits    |   32 bits     |
  746.    +---------------------------------------------------------------+
  747.    0              31              63              95             127
  748.  
  749. where T1, T2, W1, and W2 are all 32-bit quantities, and have some
  750.  
  751.  
  752.  
  753. Expires: February 28, 1996     Informational              [Page 12]
  754.  
  755.  
  756.  
  757. INTERNET-DRAFT     Authentication Mechanisms for ONC RPC       28-August-96
  758.  
  759.  
  760. correspondence to the original quantities occupying their positions, but
  761. are now interdependent on each other for proper decryption.  The 64 bit
  762. sequence comprising T1 and T2 is denoted by T.
  763.  
  764. The full network name credential is represented as follows using XDR
  765. notation:
  766.  
  767. struct authkerb4_fullname {
  768.    opaque ticket<>;         /* kerberos ticket for the server */
  769.    opaque w1[4];            /* W1                             */
  770. };
  771.  
  772. The verifier is represented as follows:
  773.  
  774. struct authkerb4_fullname_verf {
  775.    des_block timestamp;         /* T (the 64 bits of T1 and T2) */
  776.    opaque w2[4];                /* W2                           */
  777. };
  778.  
  779. Note that all of the client-encrypted quantities (w1, w2, timestamp) in the
  780. above structures are opaque.  The client does not encrypt the Kerberos
  781. ticket for the server.
  782.  
  783. The fullname credential and its associated verifier together contain the
  784. Kerberos ticket (which contains the client name and the conversation key),
  785. the ttl, a timestamp, and a ttl verifier that is one less than the ttl.
  786. The ttl is actually the lifetime for the credential.  The server will
  787. accept the credential if the current server time is "within" the time
  788. indicated in the timestamp plus the ttl.  Otherwise, the server rejects the
  789. credential with an authentication status of AUTH_BADCRED.  One way to
  790. insure that requests are not replayed would be for the server to insist
  791. that timestamps are greater than the previous one seen, unless it is the
  792. first transaction.  If the timestamp is earlier than the previous one seen,
  793. the server returns an authentication status of AUTH_REJECTEDCRED.
  794.  
  795. The server returns a authkerb4_server_verf structure, which is described in
  796. detail below.  This structure contains a "nickname", which may be used for
  797. subsequent requests in the current session.
  798.  
  799. 3.2.2 The Nickname Credential and Verifier (Client)
  800.  
  801. In transactions following the first, the client may use the shorter
  802. nickname credential and verifier for efficiency.  First, the client fills
  803. out the following structure:
  804.  
  805.    +-------------------------------+
  806.    |   timestamp   |  timestamp    |
  807.    |   seconds     | micro seconds |
  808.    |   32 bits     |    32 bits    |
  809.    +-------------------------------+
  810.    0              31              63
  811.  
  812. The fields are stored in XDR (external data representation) format.  These
  813.  
  814.  
  815.  
  816. Expires: February 28, 1996     Informational              [Page 13]
  817.  
  818.  
  819.  
  820. INTERNET-DRAFT     Authentication Mechanisms for ONC RPC       28-August-96
  821.  
  822.  
  823. 64 bits of data are then encrypted in the DES ECB mode, using the
  824. conversation key for the session.  This yields:
  825.  
  826.    +-------------------------------+
  827.    |     (T1)      |      (T2)     |
  828.    |               T               |
  829.    |             64 bits           |
  830.    +-------------------------------+
  831.    0              31              63
  832.  
  833. The nickname credential is represented as follows using XDR notation:
  834.  
  835. struct authkerb4_nickname {
  836.    unsigned int nickname;       /* nickname returned by server   */
  837. };
  838.  
  839. The nickname verifier is represented as follows using XDR notation:
  840.  
  841. struct authkerb4_nickname_verf {
  842.    des_block timestamp;         /* T (the 64 bits of T1 and T2) */
  843.    opaque w[4];                 /* Set to zero                  */
  844. };
  845.  
  846. The nickname credential may be reject by the server for several reasons.
  847. An authentication status of AUTH_BADCRED indicates that the nickname is no
  848. longer valid. The client should retry the request using the fullname
  849. credential.  AUTH_REJECTEDVERF indicates that the nickname verifier is not
  850. valid.  Again, the client should retry the request using the fullname
  851. credential.  AUTH_TIMEEXPIRE indicates that the session's Kerberos ticket
  852. has expired.  The client should initiate a new session by obtaining a new
  853. Kerberos ticket.
  854.  
  855. 3.2.3 The Nickname Verifier (Server)
  856.  
  857. The server never returns a credential.  It returns only one kind of
  858. verifier, i.e., the nickname verifier.  This has the following XDR
  859. representation:
  860.  
  861. struct authkerb4_server_verf {
  862.    des_block timestamp_verf; /* timestamp verifier (encrypted)    */
  863.    unsigned int nickname;    /* new client nickname (unencrypted) */
  864. };
  865.  
  866. The timestamp verifier is constructed in exactly the same way as the client
  867. nickname credential.  The server sets the timestamp value to the value the
  868. client sent minus one second and encrypts it in DES ECB mode using the
  869. conversation key.  The server also sends the client a nickname to be used
  870. in future transactions (unencrypted).
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879. Expires: February 28, 1996     Informational              [Page 14]
  880.  
  881.  
  882.  
  883. INTERNET-DRAFT     Authentication Mechanisms for ONC RPC       28-August-96
  884.  
  885.  
  886. 3.2.4 Kerberos-specific Authentication Status Values
  887.  
  888. The server may return to the client one of the following errors in the
  889. authentication status field:
  890.  
  891. AUTH_DECODE             The server is unable to decode the authenticator
  892.                         of the client's ticket.
  893.  
  894. AUTH_TIMEEXPIRE         The client's ticket has expired.
  895.  
  896. AUTH_TKT_FILE           The server was unable to find the ticket file.  The
  897.                         client should create a new session by obtaining a
  898.                         new ticket.
  899.  
  900. AUTH_NET_ADDR           The network address of the client does not match the
  901.                         address contained in the ticket.
  902.  
  903. AUTH_KERB_GENERIC       Any other Kerberos-specific error.
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942. Expires: February 28, 1996     Informational              [Page 15]
  943.  
  944.  
  945.  
  946. INTERNET-DRAFT     Authentication Mechanisms for ONC RPC       28-August-96
  947.  
  948.  
  949. 4. REFERENCES
  950.  
  951. [1]  Srinivasan, R., "Remote Procedure Call Protocol Version 2", RFC-1831,
  952.      Sun Microsystems, 1995.
  953.  
  954. [2]  Srinivasan, R., "XDR: External Data Representation Standard",
  955.      RFC-1832, Sun Microsystems, 1995.
  956.  
  957. [3]  Diffie & Hellman, "New Directions in Cryptography", IEEE
  958.      Transactions on Information Theory IT-22, November 1976.
  959.  
  960. [4]  Mills, D., "Network Time Protocol (Version 3)", RFC-1305,
  961.      University of Delaware, March 1992.
  962.  
  963. [5]  National Bureau of Standards, "Data Encryption Standard", Federal
  964.      Information Processing Standards Publication 46, January 1977.
  965.  
  966. [6]  Miller, S., Neuman, C., Schiller, J., and  J. Saltzer, "Section
  967.      E.2.1: Kerberos  Authentication and Authorization System",
  968.      M.I.T. Project Athena, Cambridge, Massachusetts, December 21,
  969.      1987.
  970.  
  971. [7]  Steiner, J., Neuman, C., and J. Schiller, "Kerberos: An
  972.      Authentication Service for Open Network Systems", pp. 191-202 in
  973.      Usenix Conference Proceedings, Dallas, Texas, February, 1988.
  974.  
  975. [8]  Kohl, J. and Neuman, C., "The Kerberos Network Authentication
  976.      Service (V5)", RFC-1510, September 1993.
  977.  
  978. [9]  La Macchia, B.A., and Odlyzko, A.M., "Computation of Discrete
  979.      Logarithms in Prime Fields", pp. 47-62 in "Designs, Codes and
  980.      Cryptography", Kluwer Academic Publishers, 1991.
  981.  
  982. [10] Cheswick, W.R., and Bellovin, S.M., "Firewalls and Internet Security,"
  983.      Addison-Wesley, 1995.
  984.  
  985. 15. AUTHOR'S ADDRESS
  986.  
  987. Stephen X. Nahm
  988. Sun Microsystems, Inc.
  989. 2550 Garcia Avenue
  990. Mountain View, CA 94043
  991.  
  992. Phone: +1 (415) 786-5086
  993.  
  994. E-mail: sxn@sun.com
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005. Expires: February 28, 1996     Informational              [Page 16]
  1006.