1 \input texinfo @c -*-texinfo-*-
2 @c Copyright (C) 2002, 2003 Simon Josefsson
4 @c This file is part of the shishi
5 @c Permission is granted to copy, distribute and/or modify this document
6 @c under the terms of the GNU Free Documentation License, Version 1.1
7 @c or any later version published by the Free Software Foundation;
8 @c with the Invariant Sections being with no Invariant Sections, with the
9 @c no Front-Cover Texts, and with the no Back-Cover Texts.
10 @c A copy of the license is included in the section entitled ``GNU
11 @c Free Documentation License'' in the file 'fdl.texi'.
13 @setfilename shishi.info
14 @documentencoding ISO-8859-1
16 @settitle The Shishi Manual
18 @c Unify some of the indices.
23 This is @cite{The Shishi Manual}, last updated @value{UPDATED}, for
24 Version @value{VERSION} of Shishi.
26 Copyright @copyright{} 2002, 2003 Simon Josefsson.
29 Permission is granted to copy, distribute and/or modify this document
30 under the terms of the GNU Free Documentation License, Version 1.1 or
31 any later version published by the Free Software Foundation; with no
32 Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
33 and with the Back-Cover Texts as in (a) below. A copy of the license
34 is included in the section entitled ``GNU Free Documentation
37 (a) The FSF's Back-Cover Text is: ``You have freedom to copy and
38 modify this GNU Manual, like GNU software. Copies published by the
39 Free Software Foundation raise funds for GNU development.''
43 @dircategory Net Utilities
45 * shishi: (shishi). A Kerberos 5 implementation
49 @title The Shishi Manual
50 @subtitle for version @value{VERSION}, @value{UPDATED}
51 @author Simon Josefsson (@email{bug-shishi@@josefsson.org})
53 @vskip 0pt plus 1filll
66 * Introduction:: How to use this manual.
67 * User Manual:: Using Shishi as end-user.
68 * Administration Manual:: Administrating server aspects of Shishi.
69 * Reference Manual:: Detailed description of config files, etc.
70 * Programming Manual:: Calling Shishi from a programming language.
71 * Acknowledgements:: Whom to blame.
75 * Copying This Manual:: How you can copy and share this manual.
76 * Copying:: How you can copy and share the source.
80 * Concept Index:: Index of concepts and programs.
81 * Function and Data Index:: Index of functions, variables and data types.
85 @c **********************************************************
86 @c ******************** Introduction **********************
87 @c **********************************************************
91 Shishi implements the Kerberos 5 network security system.
95 * Features and Status::
97 * Cryptographic Overview::
98 * Supported Platforms::
99 * Downloading and Installing::
104 @node Getting Started
105 @section Getting Started
107 This manual documents the Shishi application and library programming
108 interface. All commands, functions and data types provided by Shishi
111 The reader is assumed to possess basic familiarity with network
112 security and the Kerberos 5 security system.
114 This manual can be used in several ways. If read from the beginning
115 to the end, it gives a good introduction into the library and how it
116 can be used in an application. Forward references are included where
117 necessary. Later on, the manual can be used as a reference manual to
118 get just the information needed about any particular interface of the
119 library. Experienced programmers might want to start looking at the
120 examples at the end of the manual, and then only read up those parts
121 of the interface which are unclear.
123 @node Features and Status
124 @section Features and Status
126 Shishi might have a couple of advantages over other packages doing a
130 @item It's Free Software
131 Anybody can use, modify, and redistribute it under the terms of the GNU
132 General Public License (@pxref{Copying}).
134 @item It's thread-safe
135 The library uses no global variables.
137 @item It's internationalized
138 It handles non-ASCII username and passwords and user visible strings
139 used in the library (error messages) can be translated into the users'
143 It should work on all Unix like operating systems, including Windows.
147 Shishi is far from feature complete, it is not even a full RFC 1510
148 implementation yet. However, some basic functionality is implemented.
149 A few implemented feature are mentioned below.
153 @item Initial authentication (AS) from raw key or password.
154 This step is typically used to acquire a ticket granting ticket and,
155 less commonly, a server ticket.
157 @item Subsequent authentication (TGS).
158 This step is typically used to acquire a server ticket, by
159 authenticating yourself using the ticket granting ticket.
161 @item Client-Server authentication (AP).
162 This step is used by clients and servers to prove to each other who
163 they are, using negotiated tickets.
165 @item Integrity protected communication (SAFE).
166 This step is used by clients and servers to exchange integrity
167 protected data with each other. The key is typically agreed on using
168 the Client-Server authentication step.
170 @item Ticket cache, supporting multiple principals and realms.
171 As tickets have a life time of typically several hours, they are
172 managed in disk files. There can be multiple ticket caches, and each
173 ticket cache can store tickets for multiple clients (users), servers,
174 encryption types, etc. Functionality is provided for locating the
175 proper ticket for every use.
177 @item Most standard cryptographic primitives.
178 The believed most secure algorithms are supported
179 (@pxref{Cryptographic Overview}).
181 @item Telnet client and server.
182 This is used to remotely login to other machines, after authenticating
183 yourself with a ticket.
186 This is used to login locally on a machine.
188 @item KDC addresses located using DNS SRV RRs.
190 @item Modularized low-level crypto interface.
191 Currently Nettle and Libgcrypt are supported. If you wish to add
192 support for another low-level cryptographic library, you only have to
193 implement a few APIs to DES, AES, MD5, SHA1, HMAC, etc, look at
194 @file{lib/nettle.c} or @file{lib/libgcrypt.c} as a starting pointer.
198 The following table summarize what the current objectives are (i.e.,
199 the todo list) and an estimate on how long it will take to implement
200 the feature. If you like to start working on anything, please let me
201 know so work duplication can be avoided.
205 @item Pre-authentication support (week).
207 @item Cross-realm support (week).
209 @item PKINIT (use libksba, weeks)
211 @item Finish GSSAPI support via GSSLib (weeks)
212 Shishi will not support GSSLib natively, but a separate project
213 ``GSSLib'' is under way to produce a generic GSS implementation, and
214 it will use Shishi to implement the Kerberos 5 mechanism.
216 @item Port to cyclone (cyclone need to mature first)
218 @item Modularize ASN.1 library so it can be replaced (days).
219 Almost done, all ASN.1 functionality is found in lib/asn1.c, although
220 the interface is rather libtasn1 centric.
222 @item KDC (initiated, weeks)
224 @item Set/Change password protocol (weeks?)
226 @item Port applications to use Shishi (indefinite)
228 @item Improve documentation
230 @item Improve internationalization
232 @item Add AP-REQ replay cache (week).
234 @item Study benefits by introducing a PA-TGS-REP.
235 This would provide mutual authentication of the KDC in a way that is
236 easier to analyze. Currently the mutual authentication property is
237 only implicit from successful decryption of the KDC-REP and the 4 byte
240 @item GUI applet for managing tickets.
247 This section describes RFC 1510 from a protocol point of
248 view@footnote{The text is a lightly adapted version of the
249 introduction section from RFC 1510 by J. Kohl and C. Neuman, September
250 1993, unclear copyrights, but presumably owned by The Internet
253 Kerberos provides a means of verifying the identities of principals,
254 (e.g., a workstation user or a network server) on an open
255 (unprotected) network. This is accomplished without relying on
256 authentication by the host operating system, without basing trust on
257 host addresses, without requiring physical security of all the hosts
258 on the network, and under the assumption that packets traveling along
259 the network can be read, modified, and inserted at will. (Note,
260 however, that many applications use Kerberos' functions only upon the
261 initiation of a stream-based network connection, and assume the
262 absence of any "hijackers" who might subvert such a connection. Such
263 use implicitly trusts the host addresses involved.) Kerberos performs
264 authentication under these conditions as a trusted third- party
265 authentication service by using conventional cryptography, i.e.,
266 shared secret key. (shared secret key - Secret and private are often
267 used interchangeably in the literature. In our usage, it takes two
268 (or more) to share a secret, thus a shared DES key is a secret key.
269 Something is only private when no one but its owner knows it. Thus,
270 in public key cryptosystems, one has a public and a private key.)
272 The authentication process proceeds as follows: A client sends a
273 request to the authentication server (AS) requesting "credentials" for
274 a given server. The AS responds with these credentials, encrypted in
275 the client's key. The credentials consist of 1) a "ticket" for the
276 server and 2) a temporary encryption key (often called a "session
277 key"). The client transmits the ticket (which contains the client's
278 identity and a copy of the session key, all encrypted in the server's
279 key) to the server. The session key (now shared by the client and
280 server) is used to authenticate the client, and may optionally be used
281 to authenticate the server. It may also be used to encrypt further
282 communication between the two parties or to exchange a separate
283 sub-session key to be used to encrypt further communication.
285 The implementation consists of one or more authentication servers
286 running on physically secure hosts. The authentication servers
287 maintain a database of principals (i.e., users and servers) and their
288 secret keys. Code libraries provide encryption and implement the
289 Kerberos protocol. In order to add authentication to its
290 transactions, a typical network application adds one or two calls to
291 the Kerberos library, which results in the transmission of the
292 necessary messages to achieve authentication.
294 The Kerberos protocol consists of several sub-protocols (or
295 exchanges). There are two methods by which a client can ask a
296 Kerberos server for credentials. In the first approach, the client
297 sends a cleartext request for a ticket for the desired server to the
298 AS. The reply is sent encrypted in the client's secret key. Usually
299 this request is for a ticket-granting ticket (TGT) which can later be
300 used with the ticket-granting server (TGS). In the second method, the
301 client sends a request to the TGS. The client sends the TGT to the
302 TGS in the same manner as if it were contacting any other application
303 server which requires Kerberos credentials. The reply is encrypted in
304 the session key from the TGT.
306 Once obtained, credentials may be used to verify the identity of the
307 principals in a transaction, to ensure the integrity of messages
308 exchanged between them, or to preserve privacy of the messages. The
309 application is free to choose whatever protection may be necessary.
311 To verify the identities of the principals in a transaction, the
312 client transmits the ticket to the server. Since the ticket is sent
313 "in the clear" (parts of it are encrypted, but this encryption doesn't
314 thwart replay) and might be intercepted and reused by an attacker,
315 additional information is sent to prove that the message was
316 originated by the principal to whom the ticket was issued. This
317 information (called the authenticator) is encrypted in the session
318 key, and includes a timestamp. The timestamp proves that the message
319 was recently generated and is not a replay. Encrypting the
320 authenticator in the session key proves that it was generated by a
321 party possessing the session key. Since no one except the requesting
322 principal and the server know the session key (it is never sent over
323 the network in the clear) this guarantees the identity of the client.
325 The integrity of the messages exchanged between principals can also be
326 guaranteed using the session key (passed in the ticket and contained
327 in the credentials). This approach provides detection of both replay
328 attacks and message stream modification attacks. It is accomplished
329 by generating and transmitting a collision-proof checksum (elsewhere
330 called a hash or digest function) of the client's message, keyed with
331 the session key. Privacy and integrity of the messages exchanged
332 between principals can be secured by encrypting the data to be passed
333 using the session key passed in the ticket, and contained in the
336 @node Cryptographic Overview
337 @section Cryptographic Overview
339 Shishi implements several of the standard cryptographic primitives.
340 Here are the names of the supported encryption suites, with some notes
341 on their status and there associated checksum suite. They are ordered
342 by increased security as perceived by the author.
352 @code{NULL} is a dummy encryption suite for debugging. Encryption and
353 decryption are identity functions. No integrity protection. It is
354 weak. It is associated with the @code{NULL} checksum.
358 @code{des-cbc-crc} is DES encryption and decryption with 56 bit keys
359 and 8 byte blocks in CBC mode. The keys can be derived from passwords
360 by an obscure application specific algorithm. Data is integrity
361 protected with an unkeyed but encrypted @code{CRC32}-like checksum.
362 It is weak. It is associated with the @code{rsa-md5-des} checksum.
366 @code{des-cbc-md4} is DES encryption and decryption with 56 bit keys
367 and 8 byte blocks in CBC mode. The keys can be derived from passwords
368 by an obscure application specific algorithm. Data is integrity
369 protected with an unkeyed but encrypted MD4 hash. It is weak. It is
370 associated with the @code{rsa-md4-des} checksum.
374 @code{des-cbc-md5} is DES encryption and decryption with 56 bit keys
375 and 8 byte blocks in CBC mode. The keys can be derived from passwords
376 by an obscure application specific algorithm. Data is integrity
377 protected with an unkeyed but encrypted MD5 hash. It is weak. It is
378 associated with the @code{rsa-md5-des} checksum. This is the
379 strongest RFC 1510 interoperable mechanism.
381 @item des3-cbc-sha1-kd
383 @code{des3-cbc-sha1-kd} is DES encryption and decryption with three 56
384 bit keys (effective key size 112 bits) and 8 byte blocks in CBC
385 mode. The keys can be derived from passwords by a algorithm based on
386 the paper "A Better Key Schedule For DES-like Ciphers"
387 @footnote{@url{http://www.research.att.com/~smb/papers/ides.pdf}} by
388 Uri Blumenthal and Steven M. Bellovin (it is not clear if the
389 algorithm, and the way it is used, is used by any other protocols,
390 although it seems unlikely). Data is integrity protected with a keyed
391 SHA1 hash in HMAC mode. It has no security proof, but is assumed to
392 provide adequate security in the sense that knowledge on how to crack
393 it is not known to the public. Note that the key derivation function
394 is not widely used outside of Kerberos, hence not widely studied. It
395 is associated with the @code{hmac-sha1-des3-kd} checksum.
397 @item aes128-cts-hmac-sha1-96
398 @item aes256-cts-hmac-sha1-96.
400 @code{aes128-cts-hmac-sha1-96} and @code{aes256-cts-hmac-sha1-96} is
401 AES encryption and decryption with 128 bit and 256 bit key,
402 respectively, and 16 byte blocks in CBC mode with Cipher Text
403 Stealing. Cipher Text Stealing means data length of encrypted data is
404 preserved (pure CBC add up to 7 pad characters). The keys can be
405 derived from passwords with RSA Laboratories PKCS#5 Password Based Key
407 2@footnote{@url{http://www.rsasecurity.com/rsalabs/pkcs/pkcs-5/}},
408 which is allegedly provably secure in a random oracle model. Data is
409 integrity protected with a keyed SHA1 hash, in HMAC mode, truncated to
410 96 bits. There is no security proof, but the schemes are assumed to
411 provide adequate security in the sense that knowledge on how to crack
412 them is not known to the public. Note that AES has yet to receive the
413 test of time, and the CBC variation used is not widely standardized
414 (hence not widely studied). It is associated with the
415 @code{hmac-sha1-96-aes128} and @code{hmac-sha1-96-aes256} checksums,
420 The protocol do not include any way to negotiate which checksum
421 mechanisms to use, so in most cases the associated checksum will be
422 used. However, checksum mechanisms can be used with other encryption
423 mechanisms, as long as they are compatible in terms of key format etc.
424 Here are the names of the supported checksum mechanisms, with some
425 notes on their status and the compatible encryption mechanisms. They
426 are ordered by increased security as perceived by the author.
432 @code{NULL} is a dummy checksum suite for debugging. It provides no
433 integrity. It is weak. It is compatible with the @code{NULL}
434 encryption mechanism.
438 @code{rsa-md4} is a unkeyed MD4 hash computed over the message. Since
439 it is unkeyed, it is in general a weak checksum, however applications
440 can, with care, use it non-weak ways (e.g., by including the hash in
441 other messages that are encrypted or checksummed). It is compatible
442 with all encryption mechanisms.
446 @code{rsa-md4-des} is a DES CBC encryption of one block of random data
447 and a unkeyed MD4 hash computed over the random data and the message
448 to integrity protect. The key used is derived from the base protocol
449 key by XOR with a constant. It is weak. It is compatible with the
450 @code{des-cbc-crc}, @code{des-cbc-md4}, @code{des-cbc-md5} encryption
455 @code{rsa-md5} is a unkeyed MD5 hash computed over the message. Since
456 it is unkeyed, it is in general a weak checksum, however applications
457 can, with care, use it non-weak ways (e.g., by including the hash in
458 other messages that are encrypted or checksummed). It is compatible
459 with all encryption mechanisms.
463 @code{rsa-md5-des} is a DES CBC encryption of one block of random data
464 and a unkeyed MD5 hash computed over the random data and the message
465 to integrity protect. The key used is derived from the base protocol
466 key by XOR with a constant. It is weak. It is compatible with the
467 @code{des-cbc-crc}, @code{des-cbc-md4}, @code{des-cbc-md5} encryption
470 @item hmac-sha1-des3-kd
472 @code{hmac-sha1-des3-kd} is a keyed SHA1 hash in HMAC mode computed
473 over the message. The key is derived from the base protocol by the
474 simplified key derivation function (similar to the password key
475 derivation functions of @code{des3-cbc-sha1-kd}). It has no security
476 proof, but is assumed to provide good security, if the key derivation
477 function is good. It is compatible with the @code{des3-cbc-sha1-kd}
478 encryption mechanism.
480 @item hmac-sha1-96-aes128
481 @item hmac-sha1-96-aes256
483 @code{hmac-sha1-96-aes*} are keyed SHA1 hashes in HMAC mode computed
484 over the message and then truncated to 96 bits. The key is derived
485 from the base protocol by the simplified key derivation function
486 (similar to the password key derivation functions of
487 @code{des3-cbc-sha1-kd}). It has no security proof, but is assumed to
488 provide good security, if the key derivation function is good. It is
489 compatible with the @code{aes*-cts-hmac-sha1-96} encryption
495 @node Supported Platforms
496 @section Supported Platforms
498 Shishi has at some point in time been tested on the following
499 platforms. Online build reports for each platforms and Shishi version
500 is available at @url{http://josefsson.org/autobuild/}.
504 @item Debian GNU/Linux 3.0 (Woody)
507 GCC 2.95.4 and GNU Make. This is the main development platform.
508 @code{alphaev67-unknown-linux-gnu}, @code{alphaev6-unknown-linux-gnu},
509 @code{arm-unknown-linux-gnu}, @code{armv4l-unknown-linux-gnu},
510 @code{hppa-unknown-linux-gnu}, @code{hppa64-unknown-linux-gnu},
511 @code{i686-pc-linux-gnu}, @code{ia64-unknown-linux-gnu},
512 @code{m68k-unknown-linux-gnu}, @code{mips-unknown-linux-gnu},
513 @code{mipsel-unknown-linux-gnu}, @code{powerpc-unknown-linux-gnu},
514 @code{s390-ibm-linux-gnu}, @code{sparc-unknown-linux-gnu},
515 @code{sparc64-unknown-linux-gnu}.
517 @item Debian GNU/Linux 2.1
520 GCC 2.95.4 and GNU Make. @code{armv4l-unknown-linux-gnu}.
525 Tru64 UNIX C compiler and Tru64 Make. @code{alphaev67-dec-osf5.1},
526 @code{alphaev68-dec-osf5.1}.
531 GCC 2.96 and GNU Make. @code{alphaev6-unknown-linux-gnu},
532 @code{alphaev67-unknown-linux-gnu}.
534 @item SuSE Linux 7.2a
537 GCC 3.0 and GNU Make. @code{ia64-unknown-linux-gnu}.
542 GCC 3.2.2 and GNU Make. @code{x86_64-unknown-linux-gnu} (AMD64
545 @item RedHat Linux 7.2
548 GCC 2.96 and GNU Make. @code{alphaev6-unknown-linux-gnu},
549 @code{alphaev67-unknown-linux-gnu}, @code{ia64-unknown-linux-gnu}.
551 @item RedHat Linux 8.0
554 GCC 3.2 and GNU Make. @code{i686-pc-linux-gnu}.
556 @item RedHat Advanced Server 2.1
557 @cindex RedHat Advanced Server
559 GCC 2.96 and GNU Make. @code{i686-pc-linux-gnu}.
561 @item Slackware Linux 8.0.01
564 GCC 2.95.3 and GNU Make. @code{i686-pc-linux-gnu}.
566 @item Mandrake Linux 9.0
569 GCC 3.2 and GNU Make. @code{i686-pc-linux-gnu}.
574 MIPS C compiler, IRIX Make. @code{mips-sgi-irix6.5}.
579 IBM C for AIX compiler, AIX Make. @code{rs6000-ibm-aix4.3.2.0}.
581 @c @item Microsoft Windows 2000 (Cygwin)
584 @c GCC 3.2, GNU make. @code{i686-pc-cygwin}.
589 HP-UX C compiler and HP Make. @code{ia64-hp-hpux11.22},
590 @code{hppa2.0w-hp-hpux11.11}.
592 @item SUN Solaris 2.8
595 Sun WorkShop Compiler C 6.0 and SUN Make. @code{sparc-sun-solaris2.8}.
600 GCC 2.95.3 and GNU Make. @code{alpha-unknown-netbsd1.6},
601 @code{i386-unknown-netbsdelf1.6}.
603 @item OpenBSD 3.1 and 3.2
606 GCC 2.95.3 and GNU Make. @code{alpha-unknown-openbsd3.1},
607 @code{i386-unknown-openbsd3.1}.
609 @item FreeBSD 4.7 and 4.8
612 GCC 2.95.4 and GNU Make. @code{alpha-unknown-freebsd4.7},
613 @code{alpha-unknown-freebsd4.8}, @code{i386-unknown-freebsd4.7},
614 @code{i386-unknown-freebsd4.8}.
618 If you use Shishi on, or port Shishi to, a new platform please report
619 it to the author (@pxref{Bug Reports}).
621 @node Downloading and Installing
622 @section Downloading and Installing
626 The package can be downloaded from several places, including
627 @url{http://josefsson.org/shishi/releases/}. The latest version is
628 stored in a file, e.g., @samp{shishi-0.0.42.tar.gz} where the
629 @samp{0.0.42} indicate the highest version number.
631 The package is then extracted, configured and built like many other
632 packages that use Autoconf. For detailed information on configuring
633 and building it, refer to the @file{INSTALL} file that is part of the
634 distribution archive.
636 Here is an example terminal session that download, configure, build
637 and install the package. You will need a few basic tools, such as
638 @samp{sh}, @samp{make} and @samp{cc}.
641 $ wget -q http://josefsson.org/shishi/releases/shishi-0.0.4.tar.gz
642 $ tar xfz shishi-0.0.4.tar.gz
652 After this you should be prepared to continue with the user,
653 administration or programming manual, depending on how you want to use
658 @cindex Reporting Bugs
660 If you think you have found a bug in Shishi, please investigate it and
665 @item Please make sure that the bug is really in Shishi, and
666 preferably also check that it hasn't already been fixed in the latest
669 @item You have to send us a test case that makes it possible for us to
672 @item You also have to explain what is wrong; if you get a crash, or
673 if the results printed are not good and in that case, in what way.
674 Make sure that the bug report includes all information you would need
675 to fix this kind of bug for someone else.
679 Please make an effort to produce a self-contained report, with
680 something definite that can be tested or debugged. Vague queries or
681 piecemeal messages are difficult to act on and don't help the
684 If your bug report is good, we will do our best to help you to get a
685 corrected version of the software; if the bug report is poor, we won't
686 do anything about it (apart from asking you to send better bug
689 If you think something in this manual is unclear, or downright
690 incorrect, or if the language needs to be improved, please also send a
693 Send your bug report to:
695 @center @samp{bug-shishi@@josefsson.org}
698 @section Contributing
702 If you want to submit a patch for inclusion -- from solve a typo you
703 discovered, up to adding support for a new feature -- you should
704 submit it as a bug report (@pxref{Bug Reports}). There are some
705 things that you can do to increase the chances for it to be included
706 in the official package.
708 Unless your patch is very small (say, under 10 lines) we require that
709 you assign the copyright of your work to the Free Software Foundation.
710 This is to protect the freedom of the project. If you have not
711 already signed papers, we will send you the necessary information when
712 you submit your contribution.
714 For contributions that doesn't consist of actual programming code, the
715 only guidelines are common sense. Use it.
717 For code contributions, a number of style guides will help you:
722 Follow the GNU Standards document (@pxref{top, GNU Coding Standards,,
725 If you normally code using another coding standard, there is no
726 problem, but you should use @samp{indent} to reformat the code
727 (@pxref{top, GNU Indent,, indent}) before submitting your work.
729 @item Use the unified diff format @samp{diff -u}.
732 The only valid reason for ever aborting the execution of the program
733 is due to memory allocation errors, but for that you should call
734 @samp{xalloc_die} to allow the application to recover if it wants to.
736 @item Design with thread safety in mind.
737 Don't use global variables. Don't even write to per-handle global
738 variables unless the documented behaviour of the function you write is
739 to write to the per-handle global variable.
741 @item Avoid using the C math library.
742 It causes problems for embedded implementations, and in most
743 situations it is very easy to avoid using it.
745 @item Document your functions.
746 Use comments before each function headers, that, if properly
747 formatted, are extracted into Texinfo manuals and GTK-DOC web pages.
749 @item Supply a ChangeLog and NEWS entries, where appropriate.
753 @c **********************************************************
754 @c ******************** User Manual **********************
755 @c **********************************************************
758 @cindex End-user Shishi usage
760 Usually Shishi interacts with you to get some initial authentication
761 information like a password, and then contacts a server to receive a
762 so called ticket granting ticket. From now on, you rarely interacts
763 with Shishi directly. Applications that needs security services
764 instruct the Shishi library to use the ticket granting ticket to get
765 new tickets for various servers. An example could be if you log on to
766 a host remotely via @samp{telnet}. The host usually requires
767 authentication before permitting you in. The @samp{telnet} client
768 uses the ticket granting ticket to get a ticket for the server, and
769 then use this ticket to authenticate you against the server (typically
770 the server is also authenticated to you). You perform the initial
771 authentication by typing @command{shishi} at the prompt. Sometimes it
772 is necessary to supply options telling Shishi what your principal name
773 (user name in the Kerberos realm) or realm is. In the example, I
774 specify the client name @code{simon@@JOSEFSSON.ORG}.
778 $ shishi simon@@JOSEFSSON.ORG
779 Enter password for `simon@@JOSEFSSON.ORG':
780 simon@@JOSEFSSON.ORG:
781 Authtime: Fri Aug 15 04:44:49 2003
782 Endtime: Fri Aug 15 05:01:29 2003
783 Server: krbtgt/JOSEFSSON.ORG key des3-cbc-sha1-kd (16)
784 Ticket key: des3-cbc-sha1-kd (16) protected by des3-cbc-sha1-kd (16)
785 Ticket flags: INITIAL (512)
790 As you can see, Shishi also prints a short description of the ticket
793 A logical next step is to display all tickets you have received (by
794 the way, the tickets are usually stored as text in
795 @file{~/.shishi/tickets}). This is achieved by typing @command{shishi
801 Tickets in `/home/jas/.shishi/tickets':
804 Authtime: Fri Aug 15 04:49:46 2003
805 Endtime: Fri Aug 15 05:06:26 2003
806 Server: krbtgt/JOSEFSSON.ORG key des-cbc-md5 (3)
807 Ticket key: des-cbc-md5 (3) protected by des-cbc-md5 (3)
808 Ticket flags: INITIAL (512)
811 Authtime: Fri Aug 15 04:49:46 2003
812 Starttime: Fri Aug 15 04:49:49 2003
813 Endtime: Fri Aug 15 05:06:26 2003
814 Server: host/latte.josefsson.org key des-cbc-md5 (3)
815 Ticket key: des-cbc-md5 (3) protected by des-cbc-md5 (3)
822 As you can see, I had a ticket for the server
823 @samp{host/latte.josefsson.org} which was generated by
824 @samp{telnet}:ing to that host.
826 If, for some reason, you want to manually get a ticket for a specific
827 server, you can use the @command{shishi --server-name} command.
828 Normally, however, the application that uses Shishi will take care of
829 getting a ticket for the appropriate server, so you normally wouldn't
834 $ shishi --server-name=user/billg --encryption-type=des-cbc-md4
836 Authtime: Fri Aug 15 04:49:46 2003
837 Starttime: Fri Aug 15 04:54:33 2003
838 Endtime: Fri Aug 15 05:06:26 2003
839 Server: user/billg key des-cbc-md4 (2)
840 Ticket key: des-cbc-md4 (2) protected by des-cbc-md5 (3)
845 As you can see, I acquired a ticket for @samp{user/billg} with a
846 @samp{des-cbc-md4} (@pxref{Cryptographic Overview}) encryption key
847 specified with the @samp{--encryption-type} parameter.
849 To wrap up this introduction, lets see how you can remove tickets.
850 You may want to do this if you leave your terminal for lunch or
851 similar, and don't want someone to be able to copy the file and then
852 use your credentials. Note that this only destroy the tickets
853 locally, it does not contact any server and tell it that these
854 credentials are no longer valid. So if someone stole your ticket
855 file, you must contact your administrator and have them reset your
856 account, simply using this parameter is not sufficient.
860 $ shishi --server-name=imap/latte.josefsson.org --destroy
862 $ shishi --server-name=foobar --destroy
870 Since the @samp{--server-name} parameter takes a long to type, it is
871 possible to type the server name directly, after the client name. The
872 following example demonstrate a AS-REQ followed by a TGS-REQ for a
873 specific server (assuming you did not have any tickets from the
878 $ src/shishi simon@@latte.josefsson.org imap/latte.josefsson.org
879 Enter password for `simon@@latte.josefsson.org':
880 simon@@latte.josefsson.org:
881 Acquired: Wed Aug 27 17:21:06 2003
882 Expires: Wed Aug 27 17:37:46 2003
883 Server: imap/latte.josefsson.org key aes256-cts-hmac-sha1-96 (18)
884 Ticket key: aes256-cts-hmac-sha1-96 (18) protected by aes256-cts-hmac-sha1-96 (18)
885 Ticket flags: FORWARDED PROXIABLE (12)
890 Refer to the reference manual for all available parameters
891 (@pxref{Parameters for shishi}). The rest of this section contains
892 description of more specialized usage modes that can be ignored by
895 @section Proxiable and Proxy Tickets
897 At times it may be necessary for a principal to allow a service to
898 perform an operation on its behalf. The service must be able to take
899 on the identity of the client, but only for a particular purpose. A
900 principal can allow a service to take on the principal's identity for
901 a particular purpose by granting it a proxy.
903 The process of granting a proxy using the proxy and proxiable flags is
904 used to provide credentials for use with specific services. Though
905 conceptually also a proxy, users wishing to delegate their identity in
906 a form usable for all purpose MUST use the ticket forwarding mechanism
907 described in the next section to forward a ticket-granting ticket.
909 The PROXIABLE flag in a ticket is normally only interpreted by the
910 ticket-granting service. It can be ignored by application servers.
911 When set, this flag tells the ticket-granting server that it is OK to
912 issue a new ticket (but not a ticket-granting ticket) with a different
913 network address based on this ticket. This flag is set if requested by
914 the client on initial authentication. By default, the client will
915 request that it be set when requesting a ticket-granting ticket, and
916 reset when requesting any other ticket.
918 This flag allows a client to pass a proxy to a server to perform a
919 remote request on its behalf (e.g. a print service client can give the
920 print server a proxy to access the client's files on a particular file
921 server in order to satisfy a print request).
923 In order to complicate the use of stolen credentials, Kerberos tickets
924 are usually valid from only those network addresses specifically
925 included in the ticket[4]. When granting a proxy, the client MUST
926 specify the new network address from which the proxy is to be used, or
927 indicate that the proxy is to be issued for use from any address.
929 The PROXY flag is set in a ticket by the TGS when it issues a proxy
930 ticket. Application servers MAY check this flag and at their option
931 they MAY require additional authentication from the agent presenting
932 the proxy in order to provide an audit trail.
934 Here is how you would acquire a PROXY ticket for the service
935 @samp{imap/latte.josefsson.org}:
939 $ shishi jas@@JOSEFSSON.ORG imap/latte.josefsson.org --proxy
940 Enter password for `jas@@JOSEFSSON.ORG':
941 libshishi: warning: KDC bug: Reply encrypted using wrong key.
943 Authtime: Mon Sep 8 20:02:35 2003
944 Starttime: Mon Sep 8 20:02:36 2003
945 Endtime: Tue Sep 9 04:02:35 2003
946 Server: imap/latte.josefsson.org key des3-cbc-sha1-kd (16)
947 Ticket key: des3-cbc-sha1-kd (16) protected by des3-cbc-sha1-kd (16)
948 Ticket flags: PROXY (16)
953 As you noticed, this asked for your password. The reason is that
954 proxy tickets must be acquired using a proxiable ticket granting
955 ticket, which was not present. If you often need to get proxy
956 tickets, you may acquire a proxiable ticket granting ticket from the
962 Enter password for `jas@@JOSEFSSON.ORG':
964 Authtime: Mon Sep 8 20:04:27 2003
965 Endtime: Tue Sep 9 04:04:27 2003
966 Server: krbtgt/JOSEFSSON.ORG key des3-cbc-sha1-kd (16)
967 Ticket key: des3-cbc-sha1-kd (16) protected by des3-cbc-sha1-kd (16)
968 Ticket flags: PROXIABLE INITIAL (520)
972 Then you should be able to acquire proxy tickets based on that ticket
973 granting ticket, as follows:
977 $ shishi jas@@JOSEFSSON.ORG imap/latte.josefsson.org --proxy
978 libshishi: warning: KDC bug: Reply encrypted using wrong key.
980 Authtime: Mon Sep 8 20:04:27 2003
981 Starttime: Mon Sep 8 20:04:32 2003
982 Endtime: Tue Sep 9 04:04:27 2003
983 Server: imap/latte.josefsson.org key des3-cbc-sha1-kd (16)
984 Ticket key: des3-cbc-sha1-kd (16) protected by des3-cbc-sha1-kd (16)
985 Ticket flags: PROXY (16)
990 @section Forwardable and Forwarded Tickets
992 Authentication forwarding is an instance of a proxy where the service
993 that is granted is complete use of the client's identity. An example
994 where it might be used is when a user logs in to a remote system and
995 wants authentication to work from that system as if the login were
998 The FORWARDABLE flag in a ticket is normally only interpreted by the
999 ticket-granting service. It can be ignored by application servers.
1000 The FORWARDABLE flag has an interpretation similar to that of the
1001 PROXIABLE flag, except ticket-granting tickets may also be issued with
1002 different network addresses. This flag is reset by default, but users
1003 MAY request that it be set by setting the FORWARDABLE option in the AS
1004 request when they request their initial ticket-granting ticket.
1006 This flag allows for authentication forwarding without requiring the
1007 user to enter a password again. If the flag is not set, then
1008 authentication forwarding is not permitted, but the same result can
1009 still be achieved if the user engages in the AS exchange specifying
1010 the requested network addresses and supplies a password.
1012 The FORWARDED flag is set by the TGS when a client presents a ticket
1013 with the FORWARDABLE flag set and requests a forwarded ticket by
1014 specifying the FORWARDED KDC option and supplying a set of addresses
1015 for the new ticket. It is also set in all tickets issued based on
1016 tickets with the FORWARDED flag set. Application servers may choose to
1017 process FORWARDED tickets differently than non-FORWARDED tickets.
1019 If addressless tickets are forwarded from one system to another,
1020 clients SHOULD still use this option to obtain a new TGT in order to
1021 have different session keys on the different systems.
1023 Here is how you would acquire a FORWARDED ticket for the service
1024 @samp{host/latte.josefsson.org}:
1028 $ shishi jas@@JOSEFSSON.ORG host/latte.josefsson.org --forwarded
1029 Enter password for `jas@@JOSEFSSON.ORG':
1030 libshishi: warning: KDC bug: Reply encrypted using wrong key.
1032 Authtime: Mon Sep 8 20:07:11 2003
1033 Starttime: Mon Sep 8 20:07:12 2003
1034 Endtime: Tue Sep 9 04:07:11 2003
1035 Server: host/latte.josefsson.org key des3-cbc-sha1-kd (16)
1036 Ticket key: des3-cbc-sha1-kd (16) protected by des3-cbc-sha1-kd (16)
1037 Ticket flags: FORWARDED (4)
1042 As you noticed, this asked for your password. The reason is that
1043 forwarded tickets must be acquired using a forwardable ticket granting
1044 ticket, which was not present. If you often need to get forwarded
1045 tickets, you may acquire a forwardable ticket granting ticket from the
1050 $ shishi --forwardable
1051 Enter password for `jas@@JOSEFSSON.ORG':
1053 Authtime: Mon Sep 8 20:08:53 2003
1054 Endtime: Tue Sep 9 04:08:53 2003
1055 Server: krbtgt/JOSEFSSON.ORG key des3-cbc-sha1-kd (16)
1056 Ticket key: des3-cbc-sha1-kd (16) protected by des3-cbc-sha1-kd (16)
1057 Ticket flags: FORWARDABLE INITIAL (514)
1062 Then you should be able to acquire forwarded tickets based on that
1063 ticket granting ticket, as follows:
1067 $ shishi jas@@JOSEFSSON.ORG host/latte.josefsson.org --forwarded
1068 libshishi: warning: KDC bug: Reply encrypted using wrong key.
1070 Authtime: Mon Sep 8 20:08:53 2003
1071 Starttime: Mon Sep 8 20:08:57 2003
1072 Endtime: Tue Sep 9 04:08:53 2003
1073 Server: host/latte.josefsson.org key des3-cbc-sha1-kd (16)
1074 Ticket key: des3-cbc-sha1-kd (16) protected by des3-cbc-sha1-kd (16)
1075 Ticket flags: FORWARDED (4)
1081 @c **********************************************************
1082 @c **************** Administration Manual *****************
1083 @c **********************************************************
1084 @node Administration Manual
1085 @chapter Administration Manual
1087 This section describe how you get the KDC server up and running to
1088 answer queries from clients.
1090 First you must create a user database. Currently this is rather
1091 simplistic, and the database only contains cryptographic keys. Use
1092 the @samp{shishi --string-to-key} command to generate keys, and store
1093 them in the @file{shishid.keys} file. The file path is
1094 @file{/usr/local/etc/shishid.keys} by default, although you can use
1095 @samp{shishid -k} to specify another location.
1097 Create a random key for the Kerberos Ticket Granting Service for your
1102 $ shishi --string-to-key --random \
1103 krbtgt/latte.josefsson.org@@latte.josefsson.org | \
1104 tee /usr/local/etc/shishid.keys
1105 -----BEGIN SHISHI KEY-----
1106 Keytype: 18 (aes256-cts-hmac-sha1-96)
1107 Principal: krbtgt/latte.josefsson.org
1108 Realm: latte.josefsson.org
1110 oconxMTf59B5bvTylY+KE4mchA/gtmYI2Qok+48tnSM=
1111 -----END SHISHI KEY-----
1116 Create a key for a user from a specified password:
1120 $ shishi --string-to-key=fnord \
1121 simon@@latte.josefsson.org | tee --append \
1122 /usr/local/etc/shishid.keys
1123 -----BEGIN SHISHI KEY-----
1124 Keytype: 18 (aes256-cts-hmac-sha1-96)
1126 Realm: latte.josefsson.org
1128 c1rqwvYwuDFrABvqWVq9bWUsQWg/xbErsIUmLN+3lYM=
1129 -----END SHISHI KEY-----
1134 There is nothing special with a ticket granting key, you could have
1135 created it based on a password similar to the user key. However,
1136 please keep in mind that passwords typically have little entropy.
1138 Finally, create a random key for a service:
1142 $ shishi --string-to-key --random \
1143 imap/latte.josefsson.org@@latte.josefsson.org | \
1144 tee --append /usr/local/etc/shishid.keys
1145 -----BEGIN SHISHI KEY-----
1146 Keytype: 18 (aes256-cts-hmac-sha1-96)
1147 Principal: imap/latte.josefsson.org
1148 Realm: latte.josefsson.org
1150 ts2v0QHWyW9FyXbWtCvLPqdEc60qPq5Yvat3p82rp5c=
1151 -----END SHISHI KEY-----
1156 You are now ready to start the KDC. Refer to the reference manual for
1157 available parameters (@pxref{Parameters for shishid}).
1165 Then you can use @samp{shishi} as usual to acquire tickets
1166 (@pxref{User Manual}). The following example demonstrate a AS-REQ for
1167 @samp{krbtgt/latte.josefsson.org} followed by a TGS-REQ for
1168 @samp{imap/latte.josefsson.org}.
1172 $ shishi simon@@latte.josefsson.org imap/latte.josefsson.org
1173 Enter password for `simon@@latte.josefsson.org':
1174 simon@@latte.josefsson.org:
1175 Acquired: Wed Aug 27 17:16:37 2003
1176 Expires: Wed Aug 27 17:33:17 2003
1177 Server: imap/latte.josefsson.org key aes256-cts-hmac-sha1-96 (18)
1178 Ticket key: aes256-cts-hmac-sha1-96 (18) protected by aes256-cts-hmac-sha1-96 (18)
1179 Ticket flags: FORWARDED PROXIABLE (12)
1184 @c **********************************************************
1185 @c **************** Reference Manual **********************
1186 @c **********************************************************
1187 @node Reference Manual
1188 @chapter Reference Manual
1190 This chapter describes in high detail all parameters, configuration
1194 * Configuration file:: Meaning of tokens used in configuration file.
1195 * Parameters for shishi:: Command line parameters for 'shishi'.
1196 * Parameters for shishid:: Command line parameters for 'shishid'.
1199 @node Configuration file
1200 @section Configuration file
1202 The valid configuration file tokens are described here. The user
1203 configuration file is typically located in
1204 @file{~/.shishi/shishi.conf} (compare @samp{shishi
1205 --configuration-file}) and the system configuration is typicall
1206 located in @file{/usr/local/etc/shishi.conf}. All tokens are valid in
1207 both files, and have the same meaning. However, as the system file is
1208 supposed to apply to all users on a system, it would not make sense to
1209 use some tokens in both files. For example, the
1210 @samp{default-principal} is rarely useful in a system configuration
1213 @subsection @samp{default-realm}
1214 Specify the default realm, by default the hostname of the host is
1218 default-realm JOSEFSSON.ORG
1221 @subsection @samp{default-principal}
1223 Specify the default principal, by default the login username is
1227 default-principal jas
1230 @subsection @samp{client-kdc-etypes}
1232 Specify which encryption types client asks server to respond in during
1233 AS/TGS exchanges. List valid encryption types, in preference order.
1234 Supported algorithms include aes256-cts-hmac-sha1-96,
1235 aes128-cts-hmac-sha1-96, des3-cbc-sha1-kd, des-cbc-md5, des-cbc-md4,
1236 des-cbc-crc and null. This option also indicates which encryption
1237 types are accepted by the client when receiving the response. Note
1238 that the preference order is not cryptographically protected, so a man
1239 in the middle can modify the order without being detected. Thus, only
1240 specify encryption types you trust completely here. The default only
1241 includes aes256-cts-hmac-sha1-96, as suggested by RFC1510bis. E.g.,
1244 client-kdc-etypes=aes256-cts-hmac-sha1-96 des3-cbc-sha1-kd des-cbc-md5
1247 @subsection @samp{verbose}, @samp{verbose-asn1}, @samp{verbose-noice}, @samp{verbose-crypto}
1249 Enable verbose library messages. E.g.,
1256 @subsection @samp{realm-kdc}
1258 Specify KDC addresses for realms. Value is
1259 @samp{REALM,KDCADDRESS[/PROTOCOL][,KDCADDRESS[/PROTOCOL]...]}.
1261 KDCADDRESS is the hostname or IP address of KDC.
1263 Optional PROTOCOL is udp for UDP, tcp for TCP, and TLS for TLS
1264 connections. By default UDP is tried first, and TCP used as a
1265 fallback if the KRB_ERR_RESPONSE_TOO_BIG error is received.
1267 If not specified, Shishi tries to locate the KDC using SRV RRs,
1268 which is recommended. This option should normally only be
1269 used during experiments, or to access badly maintained realms.
1272 realm-kdc=JOSEFSSON.ORG,ristretto.josefsson.org
1275 @subsection @samp{server-realm}
1277 Specify realm for servers. Value is
1278 @samp{REALM,SERVERREGEXP[,SERVERREGEXP...]}.
1280 SERVERREGEXP is a regular expression matching servers in the realm.
1281 The first match is used. E.g.,
1284 server-realm=JOSEFSSON.ORG,.josefsson.org
1287 Note: currently not used.
1289 @subsection @samp{kdc-timeout}, @samp{kdc-retries}
1291 How long shishi waits for a response from a KDC before continuing to
1292 next KDC for realm. The default is 5 seconds. E.g.,
1298 How many times shishi sends a request to a KDC before giving up. The
1299 default is 3 times. E.g.,
1305 @subsection @samp{stringprocess}
1307 How username and passwords entered from the terminal, or taken from
1308 the command line, are processed.
1310 "none": no processing is used.
1312 "stringprep": convert from locale charset to UTF-8 and process using
1313 experimental RFC 1510 stringprep profile.
1315 It can also be a string indicating a character set supported by
1316 iconv via libstringprep, in which case data is converted from locale
1317 charset into the indicated character set. E.g., UTF-8, ISO-8859-1,
1318 KOI-8, EBCDIC-IS-FRISS are supported on GNU systems. On some systems
1319 you can use "locale -m" to list available character sets. By default,
1320 the "none" setting is used which is consistent with RFC 1510 that is
1321 silent on the issue. In practice, however, converting to UTF-8
1322 improves interoperability.
1330 @subsection @samp{ticket-life}
1331 Specify default ticket life time.
1333 The string can be in almost any common format. It can contain month
1334 names, time zones, `am' and `pm', `yesterday', `ago', `next', etc.
1335 Refer to the "Date input formats" in the GNU CoreUtils package for
1336 entire story (@pxref{Date input formats, ,Date input formats,
1337 coreutils, GNU CoreUtils}). As an extra feature, if the resulting
1338 string you specify has expired within the last 24 hours, an extra day
1339 is added to it. This allows you to specify "17:00" to always mean the
1340 next 17:00, even if your system clock happens to be 17:30.
1342 The default is 8 hours.
1347 #ticket-life=8 hours
1352 @subsection @samp{renew-life}
1354 Specify how long a renewable ticket should remain renewable.
1356 See ticket-life for the syntax. The extra feature that handles
1357 negative values within the last 2 hours is not active here.
1359 The default is 7 days.
1365 #renew-life=friday 17:00
1369 @node Parameters for shishi
1370 @section Parameters for shishi
1372 If no command is given, Shishi try to make sure you have a ticket
1373 granting ticket for the default realm, and then display it.
1375 Mandatory or optional arguments to long options are also mandatory or optional
1376 for any corresponding short options.
1379 Usage: shishi [OPTION...] [CLIENT [SERVER]] [OPTION...]
1380 or: shishi [OPTION...] --list [CLIENT [SERVER]]
1381 or: shishi [OPTION...] --destroy [CLIENT [SERVER]]
1382 or: shishi [OPTION...] --string-to-key [CLIENT] [OPTION...]
1383 or: shishi [OPTION...]
1384 Shishi -- A Kerberos 5 implementation
1386 --client-name=NAME Client name. Default is login username.
1387 -d, --destroy Destroy tickets in local cache, subject to
1388 --client-name and --server-name limiting.
1389 -e, --endtime=STRING Specify when ticket validity should expire. The
1390 time syntax may be relative (to the start time),
1391 such as "20 hours", or absolute, such as
1392 "2001-02-03 04:05:06 CET". The default is 8 hours
1393 after the start time.
1394 -E, --encryption-type=ETYPE,[ETYPE...]
1395 Encryption types to use. ETYPE is either
1396 registered name or integer.
1397 --force-as Force AS mode. Default is to use TGS iff a TGT is
1399 --force-tgs Force TGS mode. Default is to use TGS iff a TGT is
1401 --forwardable Get a forwardable ticket, i.e., one that can be
1402 used to get forwarded tickets.
1403 --forwarded Get a forwarded ticket.
1404 -l, --list List tickets in local cache, subject to
1405 --server-name limiting.
1406 --proxiable Get a proxiable ticket, i.e., one that can be used
1407 to get proxy tickets.
1408 --proxy Get a proxy ticket.
1409 --realm=REALM Realm of server. Default is DNS domain of local
1410 host. For AS, this also indicates realm of client.
1411 --renew-till=STRING Specify renewable life of ticket. Implies
1412 --renewable. Accepts same time syntax as
1413 --endtime. If --renewable is specified, the
1414 default is 1 week after the start time.
1415 --renewable Get a renewable ticket.
1416 -R, --renew Renew ticket. Use --server-name to specify
1417 ticket, default is the most recent renewable
1418 ticket granting ticket for the default realm.
1419 --server=[FAMILY:]ADDRESS:SERVICE/TYPE
1420 Send all requests to HOST instead of using normal
1421 logic to locate KDC addresses (discouraged).
1422 --server-name=NAME Server name. Default is "krbtgt/REALM" where REALM
1423 is server realm (see --realm).
1424 -s, --starttime=STRING Specify when ticket should start to be valid.
1425 Accepts same time syntax as --endtime. The default
1426 is to become valid immediately.
1427 --ticket-granter=NAME Service name in ticket to use for authenticating
1428 request. Only for TGS. Defaults to
1429 "krbtgt/REALM@@REALM" where REALM is server realm
1432 Options for low-level cryptography (CRYPTO-OPTIONS):
1433 --client-name=NAME Username. Default is login name.
1434 --key-version=INTEGER Version number of key. Default is 0.
1435 --parameter=STRING String-to-key parameter. This data is specific for
1436 each encryption algorithm and rarely needed.
1437 --random Generate key from random data.
1438 --realm=REALM Realm of principal. Defaults to DNS domain of
1440 --salt=SALT Salt to use for --string-to-key. Defaults to
1441 concatenation of realm and (unwrapped) client
1443 --string-to-key[=[PASSWORD]]
1444 Convert password into Kerberos key. Note that
1445 --client-name, --realm, and --salt influence the
1449 --configuration-file=FILE Read user configuration from file. Default
1450 is ~/.shishi/config.
1451 -c, --ticket-file=FILE Read tickets from FILE. Default is
1452 $HOME/.shishi/tickets.
1453 -o, --library-options=STRING Parse STRING as a configuration file
1455 -q, --quiet, --silent Don't produce any output.
1456 --system-configuration-file=FILE
1457 Read system wide configuration from file. Default
1458 is /usr/local/etc/shishi.conf.
1459 --ticket-write-file=FILE Write tickets to FILE. Default is to write
1460 them back to ticket file.
1461 -v, --verbose Produce verbose output. Use multiple times to
1462 increase amount of verbose output.
1463 CLIENT Set client name and realm from NAME. The
1464 --client-name and --realm parameters can be used
1465 to override part of NAME.
1466 SERVER Set server name and realm from NAME. The
1467 --server-name and --server-realm parameters can be
1468 used to override part of SERVER.
1470 -?, --help Give this help list
1471 --usage Give a short usage message
1472 -V, --version Print program version
1475 @node Parameters for shishid
1476 @section Parameters for shishid
1478 If no parameters are specified, @samp{shishid} listens on the defaults
1479 interfaces and answers incoming requests using the keys in the default
1482 Mandatory or optional arguments to long options are also mandatory or optional
1483 for any corresponding short options.
1486 -c, --configuration-file=FILE Read configuration from file. Default is
1487 /usr/local/etc/shishi.conf.
1488 -k, --key-file=FILE Read keys from file. Default is
1489 /usr/local/etc/shishid.keys.
1490 -l, --listen=[FAMILY:]ADDRESS:SERVICE/TYPE,...
1491 What to listen on. Family is "IPv4" or "IPv6", if
1492 absent the family is decided by
1493 gethostbyname(ADDRESS). An address of "*"
1494 indicates all addresses on the local host. The
1495 default is "IPv4:*:kerberos/udp,
1496 IPv4:*:kerberos/tcp, IPv6:*:kerberos/udp,
1497 IPv6:*:kerberos/tcp".
1498 -q, -s, --quiet, --silent Don't produce any output.
1499 -u, --setuid=NAME After binding socket, set user identity.
1500 -v, --verbose Produce verbose output.
1501 -?, --help Give this help list
1502 --usage Give a short usage message
1503 -V, --version Print program version
1506 @c **********************************************************
1507 @c *************** Programming Manual *********************
1508 @c **********************************************************
1509 @node Programming Manual
1510 @chapter Programming Manual
1511 @cindex Application Programming Interface (API)
1513 This chapter describes all the publicly available functions in the
1517 * Preparation:: What you should do before using the library.
1518 * Initialization Functions:: Creating library handle, configuration file.
1519 * Ticket Set Functions:: High-level ticket management functions.
1520 * AP-REQ and AP-REP Functions:: Client/Server authentication functions.
1521 * SAFE and PRIV Functions:: Client/Server session data functions.
1522 * Ticket Functions:: Medium-level ticket manipulation functions.
1523 * AS Functions:: Medium-level initial authentication functions.
1524 * TGS Functions:: Medium-level authentication functions.
1525 * Ticket (ASN.1) Functions:: Low-level Ticket functions.
1526 * AS/TGS Functions:: Low-level KDC functions; AS and TGS.
1527 * Authenticator Functions:: Low-level authenticator functions.
1528 * Cryptographic Functions:: Low-level cryptographic functions.
1529 * Utility Functions:: Utilities for use in the global context.
1530 * Error Handling:: Error codes and such.
1531 * Examples:: Example code.
1532 * Generic Security Service:: If you want to use the GSS API instead.
1536 @section Preparation
1538 To use `Libshishi', you have to perform some changes to your sources
1539 and the build system. The necessary changes are small and explained
1540 in the following sections. At the end of this chapter, it is
1541 described how the library is initialized, and how the requirements of
1542 the library are verified.
1544 A faster way to find out how to adapt your application for use with
1545 `Libshishi' may be to look at the examples at the end of this manual
1552 * Building the source::
1559 All interfaces (data types and functions) of the library are defined
1560 in the header file `shishi.h'. You must include this in all programs
1561 using the library, either directly or through some other header file,
1568 The name space of `Libshishi' is @code{shishi_*} for function names,
1569 @code{Shishi*} for data types and @code{SHISHI_*} for other symbols. In
1570 addition the same name prefixes with one prepended underscore are
1571 reserved for internal use and should never be used by an application.
1573 @node Initialization
1574 @subsection Initialization
1576 `Libshishi' must be initialized before it can be used. The library is
1577 initialized by calling @code{shishi_init} (@pxref{Initialization
1578 Functions}). The resources allocated by the initialization process
1579 can be released if the application no longer has a need to call
1580 `Libshishi' functions, this is done by calling @code{shishi_done}.
1582 In order to take advantage of the internationalisation features in
1583 `Libshishi', such as translated error messages, the application must
1584 set the current locale using @code{setlocale} before initializing
1588 @subsection Version Check
1590 It is often desirable to check that the version of `Libshishi' used is
1591 indeed one which fits all requirements. Even with binary
1592 compatibility new features may have been introduced but due to problem
1593 with the dynamic linker an old version is actually used. So you may
1594 want to check that the version is okay right after program startup.
1596 @include shishi-api-version.texi
1598 The normal way to use the function is to put something similar to the
1599 following early in your @code{main}:
1602 if (!shishi_check_version (SHISHI_VERSION))
1604 printf ("shishi_check_version failed:\n"
1605 "Header file incompatible with shared library.\n");
1610 @node Building the source
1611 @subsection Building the source
1612 @cindex Compiling your application
1614 If you want to compile a source file including the `shishi.h' header
1615 file, you must make sure that the compiler can find it in the
1616 directory hierarchy. This is accomplished by adding the path to the
1617 directory in which the header file is located to the compilers include
1618 file search path (via the @option{-I} option).
1620 However, the path to the include file is determined at the time the
1621 source is configured. To solve this problem, `Libshishi' uses the
1622 external package @command{pkg-config} that knows the path to the
1623 include file and other configuration options. The options that need
1624 to be added to the compiler invocation at compile time are output by
1625 the @option{--cflags} option to @command{pkg-config shishi}. The
1626 following example shows how it can be used at the command line:
1629 gcc -c foo.c `pkg-config shishi --cflags`
1632 Adding the output of @samp{pkg-config shishi --cflags} to the
1633 compilers command line will ensure that the compiler can find the
1634 `Libshishi' header file.
1636 A similar problem occurs when linking the program with the library.
1637 Again, the compiler has to find the library files. For this to work,
1638 the path to the library files has to be added to the library search path
1639 (via the @option{-L} option). For this, the option @option{--libs} to
1640 @command{pkg-config shishi} can be used. For convenience, this option
1641 also outputs all other options that are required to link the program
1642 with the `Libshishi' libararies (in particular, the @samp{-lshishi}
1643 option). The example shows how to link @file{foo.o} with the `Libshishi'
1644 library to a program @command{foo}.
1647 gcc -o foo foo.o `pkg-config shishi --libs`
1650 Of course you can also combine both examples to a single command by
1651 specifying both options to @command{pkg-config}:
1654 gcc -o foo foo.c `pkg-config shishi --cflags --libs`
1657 @node Autoconf tests
1658 @subsection Autoconf tests
1659 @cindex Autoconf tests
1660 @cindex Configure tests
1662 If you work on a project that uses Autoconf (@pxref{top, GNU
1663 Autoconf,, autoconf}) to help find installed libraries, the
1664 suggestions in the previous section are not the entire story. There
1665 are a few methods to detect and incorporate Shishi into your Autoconf
1666 based package. The preferred approach, is to use Libtool in your
1667 project, and use the normal Autoconf header file and library tests.
1669 @subsubsection Autoconf test via @samp{pkg-config}
1671 If your audience is a typical GNU/Linux desktop, you can often assume
1672 they have the @samp{pkg-config} tool installed, in which you can use
1673 its Autoconf M4 macro to find and set up your package for use with
1674 Shishi. The following illustrate this scenario.
1677 AC_ARG_ENABLE(kerberos_v5,
1678 AC_HELP_STRING([--disable-kerberos_v5],
1679 [don't use the KERBEROS_V5 mechanism]),
1680 kerberos_v5=$enableval)
1681 if test "$kerberos_v5" != "no" ; then
1682 PKG_CHECK_MODULES(SHISHI, shishi >= 0.0.0,
1685 if test "$kerberos_v5" != "yes" ; then
1687 AC_MSG_WARN([shishi not found, disabling Kerberos 5])
1690 AC_DEFINE(USE_KERBEROS_V5, 1,
1691 [Define to 1 if you want Kerberos 5.])
1694 AC_MSG_CHECKING([if Kerberos 5 should be used])
1695 AC_MSG_RESULT($kerberos_v5)
1698 @subsubsection Standalone Autoconf test using Libtool
1700 If your package uses Libtool(@pxref{top, GNU Libtool,, libtool}), you
1701 can use the normal Autoconf tests to find the Shishi library and rely
1702 on the Libtool dependency tracking to include the proper dependency
1703 libraries (e.g., Libidn). The following illustrate this scenario.
1706 AC_CHECK_HEADER(shishi.h,
1707 AC_CHECK_LIB(shishi, shishi_check_version,
1708 [kerberos5=yes AC_SUBST(SHISHI_LIBS, -lshishi)],
1711 AC_ARG_ENABLE(kerberos5,
1712 AC_HELP_STRING([--disable-kerberos5],
1713 [disable Kerberos 5 unconditionally]),
1714 kerberos5=$enableval)
1715 if test "$kerberos5" != "no" ; then
1716 AC_DEFINE(USE_KERBEROS_V5, 1,
1717 [Define to 1 if you want Kerberos 5.])
1719 AC_MSG_WARN([Shishi not found, disabling Kerberos 5])
1721 AC_MSG_CHECKING([if Kerberos 5 should be used])
1722 AC_MSG_RESULT($kerberos5)
1725 @subsubsection Standalone Autoconf test
1727 If your package does not use Libtool, as well as detecting the Shishi
1728 library as in the previous case, you must also detect whatever
1729 dependencies Shishi requires to work (e.g., libidn). Since the
1730 dependencies are in a state of flux, we do not provide an example and
1731 we do not recommend this approach, unless you are experienced
1734 @node Initialization Functions
1735 @section Initialization Functions
1737 @include shishi-api-init.texi
1740 @node Ticket Set Functions
1741 @section Ticket Set Functions
1743 A ``ticket set'' is, as the name implies, a collection of tickets.
1744 Functions are provided to read tickets from file into a ticket set, to
1745 query number of tickets in the set, to extract a given ticket from the
1746 set, to search the ticket set for tickets matching certain criterium,
1747 to write the ticket set to a file, etc. High level functions for
1748 performing a initial authentication (@pxref{AS Functions}) or
1749 subsequent authentication (@pxref{TGS Functions}) and storing the new
1750 ticket in the ticket set are also provided.
1752 To manipulate each individual ticket, @xref{Ticket Functions}. For
1753 low-level ASN.1 manipulation see @xref{Ticket (ASN.1) Functions}.
1755 @include shishi-api-tkts.texi
1758 @node AP-REQ and AP-REP Functions
1759 @section AP-REQ and AP-REP Functions
1761 The ``AP-REQ'' and ``AP-REP'' are ASN.1 structures used by application
1762 client and servers to prove to each other who they are. The
1763 structures contain auxilliary information, together with an
1764 authenticator (@pxref{Authenticator Functions}) which is the real
1765 cryptographic proof. The following illustrates the AP-REQ and AP-REP
1769 AP-REQ ::= [APPLICATION 14] SEQUENCE {
1770 pvno [0] INTEGER (5),
1771 msg-type [1] INTEGER (14),
1772 ap-options [2] APOptions,
1774 authenticator [4] EncryptedData {Authenticator,
1775 { keyuse-pa-TGSReq-authenticator
1776 | keyuse-APReq-authenticator }}
1779 AP-REP ::= [APPLICATION 15] SEQUENCE {
1780 pvno [0] INTEGER (5),
1781 msg-type [1] INTEGER (15),
1782 enc-part [2] EncryptedData {EncAPRepPart,
1783 { keyuse-EncAPRepPart }}
1786 EncAPRepPart ::= [APPLICATION 27] SEQUENCE {
1787 ctime [0] KerberosTime,
1788 cusec [1] Microseconds,
1789 subkey [2] EncryptionKey OPTIONAL,
1790 seq-number [3] UInt32 OPTIONAL
1794 @include shishi-api-ap.texi
1797 @node SAFE and PRIV Functions
1798 @section SAFE and PRIV Functions
1800 The ``KRB-SAFE'' is an ASN.1 structure used by application client and
1801 servers to exchange integrity protected data. The integrity
1802 protection is keyed, usually with a key agreed on via the AP exchange
1803 (@pxref{AP-REQ and AP-REP Functions}). The following illustrates the
1804 KRB-SAFE ASN.1 structure.
1807 KRB-SAFE ::= [APPLICATION 20] SEQUENCE {
1808 pvno [0] INTEGER (5),
1809 msg-type [1] INTEGER (20),
1810 safe-body [2] KRB-SAFE-BODY,
1814 KRB-SAFE-BODY ::= SEQUENCE {
1815 user-data [0] OCTET STRING,
1816 timestamp [1] KerberosTime OPTIONAL,
1817 usec [2] Microseconds OPTIONAL,
1818 seq-number [3] UInt32 OPTIONAL,
1819 s-address [4] HostAddress,
1820 r-address [5] HostAddress OPTIONAL
1824 @include shishi-api-safe.texi
1826 The ``KRB-PRIV'' is an ASN.1 structure used by application client and
1827 servers to exchange confidential data. The confidentiality is keyed,
1828 usually with a key agreed on via the AP exchange (@pxref{AP-REQ and
1829 AP-REP Functions}). The following illustrates the KRB-PRIV ASN.1
1833 KRB-PRIV ::= [APPLICATION 21] SEQUENCE {
1834 pvno [0] INTEGER (5),
1835 msg-type [1] INTEGER (21),
1836 -- NOTE: there is no [2] tag
1837 enc-part [3] EncryptedData -- EncKrbPrivPart
1840 EncKrbPrivPart ::= [APPLICATION 28] SEQUENCE {
1841 user-data [0] OCTET STRING,
1842 timestamp [1] KerberosTime OPTIONAL,
1843 usec [2] Microseconds OPTIONAL,
1844 seq-number [3] UInt32 OPTIONAL,
1845 s-address [4] HostAddress -- sender's addr --,
1846 r-address [5] HostAddress OPTIONAL -- recip's addr
1850 @include shishi-api-priv.texi
1853 @node Ticket Functions
1854 @section Ticket Functions
1856 @include shishi-api-tkt.texi
1860 @section AS Functions
1862 The Authentication Service (AS) is used to get an initial ticket using
1863 e.g. your password. The following illustrates the AS-REQ and AS-REP
1869 AS-REQ ::= KDC-REQ {10}
1871 KDC-REQ {INTEGER:tagnum} ::= [APPLICATION tagnum] SEQUENCE {
1872 pvno [1] INTEGER (5) -- first tag is [1], not [0] --,
1873 msg-type [2] INTEGER (tagnum),
1874 padata [3] SEQUENCE OF PA-DATA OPTIONAL,
1875 req-body [4] KDC-REQ-BODY
1878 KDC-REQ-BODY ::= SEQUENCE {
1879 kdc-options [0] KDCOptions,
1880 cname [1] PrincipalName OPTIONAL
1881 -- Used only in AS-REQ --,
1884 -- Also client's in AS-REQ --,
1885 sname [3] PrincipalName OPTIONAL,
1886 from [4] KerberosTime OPTIONAL,
1887 till [5] KerberosTime,
1888 rtime [6] KerberosTime OPTIONAL,
1890 etype [8] SEQUENCE OF Int32 -- EncryptionType
1891 -- in preference order --,
1892 addresses [9] HostAddresses OPTIONAL,
1893 enc-authorization-data [10] EncryptedData {
1895 { keyuse-TGSReqAuthData-sesskey
1896 | keyuse-TGSReqAuthData-subkey }
1898 additional-tickets [11] SEQUENCE OF Ticket OPTIONAL
1903 AS-REP ::= KDC-REP {11, EncASRepPart, {keyuse-EncASRepPart}}
1905 KDC-REP {INTEGER:tagnum,
1907 UInt32:KeyUsages} ::= [APPLICATION tagnum] SEQUENCE {
1908 pvno [0] INTEGER (5),
1909 msg-type [1] INTEGER (tagnum),
1910 padata [2] SEQUENCE OF PA-DATA OPTIONAL,
1912 cname [4] PrincipalName,
1914 enc-part [6] EncryptedData {TypeToEncrypt, KeyUsages}
1917 EncASRepPart ::= [APPLICATION 25] EncKDCRepPart
1919 EncKDCRepPart ::= SEQUENCE {
1920 key [0] EncryptionKey,
1921 last-req [1] LastReq,
1923 key-expiration [3] KerberosTime OPTIONAL,
1924 flags [4] TicketFlags,
1925 authtime [5] KerberosTime,
1926 starttime [6] KerberosTime OPTIONAL,
1927 endtime [7] KerberosTime,
1928 renew-till [8] KerberosTime OPTIONAL,
1930 sname [10] PrincipalName,
1931 caddr [11] HostAddresses OPTIONAL
1935 @include shishi-api-as.texi
1939 @section TGS Functions
1941 The Ticket Granting Service (TGS) is used to get subsequent tickets,
1942 authenticated by other tickets (so called ticket granting tickets).
1943 The following illustrates the TGS-REQ and TGS-REP ASN.1 structures.
1948 TGS-REQ ::= KDC-REQ {12}
1950 KDC-REQ {INTEGER:tagnum} ::= [APPLICATION tagnum] SEQUENCE {
1951 pvno [1] INTEGER (5) -- first tag is [1], not [0] --,
1952 msg-type [2] INTEGER (tagnum),
1953 padata [3] SEQUENCE OF PA-DATA OPTIONAL,
1954 req-body [4] KDC-REQ-BODY
1957 KDC-REQ-BODY ::= SEQUENCE {
1958 kdc-options [0] KDCOptions,
1959 cname [1] PrincipalName OPTIONAL
1960 -- Used only in AS-REQ --,
1963 -- Also client's in AS-REQ --,
1964 sname [3] PrincipalName OPTIONAL,
1965 from [4] KerberosTime OPTIONAL,
1966 till [5] KerberosTime,
1967 rtime [6] KerberosTime OPTIONAL,
1969 etype [8] SEQUENCE OF Int32 -- EncryptionType
1970 -- in preference order --,
1971 addresses [9] HostAddresses OPTIONAL,
1972 enc-authorization-data [10] EncryptedData {
1974 { keyuse-TGSReqAuthData-sesskey
1975 | keyuse-TGSReqAuthData-subkey }
1977 additional-tickets [11] SEQUENCE OF Ticket OPTIONAL
1982 TGS-REP ::= KDC-REP {13, EncTGSRepPart,
1983 { keyuse-EncTGSRepPart-sesskey
1984 | keyuse-EncTGSRepPart-subkey }}
1986 KDC-REP {INTEGER:tagnum,
1988 UInt32:KeyUsages} ::= [APPLICATION tagnum] SEQUENCE {
1989 pvno [0] INTEGER (5),
1990 msg-type [1] INTEGER (tagnum),
1991 padata [2] SEQUENCE OF PA-DATA OPTIONAL,
1993 cname [4] PrincipalName,
1995 enc-part [6] EncryptedData {TypeToEncrypt, KeyUsages}
1998 EncTGSRepPart ::= [APPLICATION 26] EncKDCRepPart
2000 EncKDCRepPart ::= SEQUENCE {
2001 key [0] EncryptionKey,
2002 last-req [1] LastReq,
2004 key-expiration [3] KerberosTime OPTIONAL,
2005 flags [4] TicketFlags,
2006 authtime [5] KerberosTime,
2007 starttime [6] KerberosTime OPTIONAL,
2008 endtime [7] KerberosTime,
2009 renew-till [8] KerberosTime OPTIONAL,
2011 sname [10] PrincipalName,
2012 caddr [11] HostAddresses OPTIONAL
2016 @include shishi-api-tgs.texi
2019 @node Ticket (ASN.1) Functions
2020 @section Ticket (ASN.1) Functions
2022 @include shishi-api-ticket.texi
2024 @node AS/TGS Functions
2025 @section AS/TGS Functions
2027 The Authentication Service (AS) is used to get an initial ticket using
2028 e.g. your password. The Ticket Granting Service (TGS) is used to get
2029 subsequent tickets using other tickets. Protocol wise the procedures
2030 are very similar, which is the reason they are described together.
2031 The following illustrates the AS-REQ, TGS-REQ and AS-REP, TGS-REP
2032 ASN.1 structures. Most of the functions use the mnemonic ``KDC''
2033 instead of either AS or TGS, which means the function operates on both
2034 AS and TGS types. Only where the distinction between AS and TGS is
2035 important are the AS and TGS names used. Remember, these are
2036 low-level functions, and normal applications will likely be satisfied
2037 with the AS (@pxref{AS Functions}) and TGS (@pxref{TGS Functions})
2038 interfaces, or the even more high-level Ticket Set (@pxref{Ticket Set
2039 Functions}) interface.
2044 AS-REQ ::= KDC-REQ {10}
2045 TGS-REQ ::= KDC-REQ {12}
2047 KDC-REQ {INTEGER:tagnum} ::= [APPLICATION tagnum] SEQUENCE {
2048 pvno [1] INTEGER (5) -- first tag is [1], not [0] --,
2049 msg-type [2] INTEGER (tagnum),
2050 padata [3] SEQUENCE OF PA-DATA OPTIONAL,
2051 req-body [4] KDC-REQ-BODY
2054 KDC-REQ-BODY ::= SEQUENCE {
2055 kdc-options [0] KDCOptions,
2056 cname [1] PrincipalName OPTIONAL
2057 -- Used only in AS-REQ --,
2060 -- Also client's in AS-REQ --,
2061 sname [3] PrincipalName OPTIONAL,
2062 from [4] KerberosTime OPTIONAL,
2063 till [5] KerberosTime,
2064 rtime [6] KerberosTime OPTIONAL,
2066 etype [8] SEQUENCE OF Int32 -- EncryptionType
2067 -- in preference order --,
2068 addresses [9] HostAddresses OPTIONAL,
2069 enc-authorization-data [10] EncryptedData {
2071 { keyuse-TGSReqAuthData-sesskey
2072 | keyuse-TGSReqAuthData-subkey }
2074 additional-tickets [11] SEQUENCE OF Ticket OPTIONAL
2079 AS-REP ::= KDC-REP {11, EncASRepPart, {keyuse-EncASRepPart}}
2080 TGS-REP ::= KDC-REP {13, EncTGSRepPart,
2081 { keyuse-EncTGSRepPart-sesskey
2082 | keyuse-EncTGSRepPart-subkey }}
2084 KDC-REP {INTEGER:tagnum,
2086 UInt32:KeyUsages} ::= [APPLICATION tagnum] SEQUENCE {
2087 pvno [0] INTEGER (5),
2088 msg-type [1] INTEGER (tagnum),
2089 padata [2] SEQUENCE OF PA-DATA OPTIONAL,
2091 cname [4] PrincipalName,
2093 enc-part [6] EncryptedData {TypeToEncrypt, KeyUsages}
2096 EncASRepPart ::= [APPLICATION 25] EncKDCRepPart
2097 EncTGSRepPart ::= [APPLICATION 26] EncKDCRepPart
2099 EncKDCRepPart ::= SEQUENCE {
2100 key [0] EncryptionKey,
2101 last-req [1] LastReq,
2103 key-expiration [3] KerberosTime OPTIONAL,
2104 flags [4] TicketFlags,
2105 authtime [5] KerberosTime,
2106 starttime [6] KerberosTime OPTIONAL,
2107 endtime [7] KerberosTime,
2108 renew-till [8] KerberosTime OPTIONAL,
2110 sname [10] PrincipalName,
2111 caddr [11] HostAddresses OPTIONAL
2115 @include shishi-api-kdc.texi
2118 @node Authenticator Functions
2119 @section Authenticator Functions
2121 An ``Authenticator'' is a ASN.1 structure that work as a proof that an
2122 entity owns a ticket. It is usually embedded in the AP-REQ structure
2123 (@pxref{AP-REQ and AP-REP Functions}), and you most likely want to use
2124 an AP-REQ instead of a Authenticator in normal applications. The
2125 following illustrates the Authenticator ASN.1 structure.
2128 Authenticator ::= [APPLICATION 2] SEQUENCE {
2129 authenticator-vno [0] INTEGER (5),
2131 cname [2] PrincipalName,
2132 cksum [3] Checksum OPTIONAL,
2133 cusec [4] Microseconds,
2134 ctime [5] KerberosTime,
2135 subkey [6] EncryptionKey OPTIONAL,
2136 seq-number [7] UInt32 OPTIONAL,
2137 authorization-data [8] AuthorizationData OPTIONAL
2141 @include shishi-api-authenticator.texi
2144 @node Cryptographic Functions
2145 @section Cryptographic Functions
2147 Underneath the high-level functions described earlier, cryptographic
2148 operations are happening. If you need to access these cryptographic
2149 primitives directly, this section describes the functions available.
2151 Most cryptographic operations need keying material, and cryptographic
2152 keys have been isolated into it's own data structure
2153 @code{Shishi_key}. The following illustrates it's contents, but note
2154 that you cannot access it's elements directly but must use the
2155 accessor functions described below.
2160 int type; /* RFC 1510 encryption integer type */
2161 char *value; /* Cryptographic key data */
2162 int version; /* RFC 1510 ``kvno'' */
2166 All functions that operate on this data structure are described now.
2168 @include shishi-api-key.texi
2170 Applications that run uninteractively may need keying material. In
2171 these cases, the keys are stored in a file, a file that is normally
2172 stored on the local host. The file should be protected from
2173 unauthorized access. The file is in ASCII format and contains keys as
2174 outputed by @code{shishi_key_print}. All functions that handle these
2175 keys sets are described now.
2177 @include shishi-api-keys.texi
2179 The previous functions require that the filename is known. For some
2180 applications, servers, it makes sense to provide a system default.
2181 These key sets used by server applications are known as ``hostkeys''.
2182 Here are the functions that operate on hostkeys (they are mostly
2183 wrappers around generic key sets).
2185 @include shishi-api-hostkeys.texi
2187 After creating the key structure, it can be used to encrypt and
2188 decrypt data, calculate checksum on data etc. All available functions
2191 @include shishi-api-crypto.texi
2193 Also included in Shishi is an interface to the really low-level
2194 cryptographic primitives. They map directly on the underlying
2195 cryptographic library used (e.g., Nettle) and is used internally by
2198 @include shishi-api-nettle.texi
2201 @node Utility Functions
2202 @section Utility Functions
2204 @include shishi-api-utility.texi
2207 @node Error Handling
2208 @section Error Handling
2209 @cindex Error Handling
2211 Most functions in `Libshishi' are returning an error if they fail.
2212 For this reason, the application should always catch the error
2213 condition and take appropriate measures, for example by releasing the
2214 resources and passing the error up to the caller, or by displaying a
2215 descriptive message to the user and cancelling the operation.
2217 Some error values do not indicate a system error or an error in the
2218 operation, but the result of an operation that failed properly.
2221 * Error Values:: A list of all error values used.
2222 * Error Functions:: Error handling related functions.
2226 @subsection Error Values
2228 Errors are returned as an @code{int}. Except for the SHISHI_OK case,
2229 an application should always use the constants instead of their
2230 numeric value. Applications are encouraged to use the constants even
2231 for SHISHI_OK as it improves readability. Possible values are:
2235 This value indicates success. The value of this error is guaranteed
2236 to always be @code{0} so you may use it in boolean constructs.
2238 @include shishi-api-error-labels.texi
2242 @node Error Functions
2243 @subsection Error Functions
2245 @include shishi-api-error.texi
2251 This section will be extended to contain walk-throughs of example code
2252 that demonstrate how `Shishi' is used to write your own applications
2253 that support Kerberos 5. The rest of the current section consists of
2254 some crude hints for the example client/server applications that is
2255 part of Shishi, taken from an email but saved here for lack of a
2256 better place to put it.
2258 There are two programs: 'client' and 'server' in src/.
2260 The client output an AP-REQ, waits for an AP-REP, and then simply
2261 reads data from stdin.
2263 The server waits for an AP-REQ, parses it and prints an AP-REP, and
2264 then read data from stdin.
2266 Both programs accept a Kerberos server name as the first command line
2267 argument. Your KDC must know this server, since the client tries to
2268 get a ticket for it (first it gets a ticket granting ticket for the
2269 default username), and you must write the key for the server into
2270 /usr/local/etc/shishi.keys on the Shishi format, e.g.:
2273 -----BEGIN SHISHI KEY-----
2274 Keytype: 16 (des3-cbc-sha1-kd)
2275 Principal: sample/latte.josefsson.org
2276 Realm: JOSEFSSON.ORG
2278 8W0VrQQBpxlACPQEqN91EHxbvFFo2ltt
2279 -----END SHISHI KEY-----
2282 You must extract the proper encryption key from the KDC in some way.
2283 (This part will be easier when Shishi include a KDC, a basic one isn't
2284 far away, give me a week or to.)
2286 The intention is that the data read, after the authentication phase,
2287 should be protected using KRB_SAFE (see RFC) but I haven't added this
2290 @node Generic Security Service
2291 @section Generic Security Service
2292 @cindex Generic Security Service
2296 As an alternative to the native Shishi programming API, it is possible
2297 to program Shishi through the Generic Security Services (GSS) API.
2298 The advantage of using GSS-API in your security application, instead
2299 of the native Shishi API, is that it will be easier to port your
2300 application between different Kerberos 5 implementations, and even
2301 beyond Kerberos 5 to different security systems, that support GSS-API.
2302 In the free software world, however, almost the only widely used
2303 security system that supports GSS-API is Kerberos 5, so the last
2304 advantage is somewhat academic. But if you are porting applications
2305 using GSS-API for other Kerberos 5 implementations, or want a more
2306 mature and stable API than the native Shishi API, you may find using
2307 Shishi's GSS-API interface compelling. Note that GSS-API only offer
2308 basic services, for more advanced uses you must use the native API.
2310 Since the GSS-API is not specific to Shishi, it is distributed
2311 independently from Shishi. Further information on the GSS project can
2312 be found at @url{http://josefsson.org/gss/}.
2314 @c **********************************************************
2315 @c ******************* Acknowledgements *******************
2316 @c **********************************************************
2317 @node Acknowledgements
2318 @chapter Acknowledgements
2320 Shishi uses Libtasn1 by Fabio Fiorina, Libnettle by Niels Möller,
2321 Libgcrypt and Libgpg-error by Werner Koch, Libidn by Simon Josefsson,
2322 cvs2cl by Karl Fogel, and gdoc by Michael Zucchi.
2324 Several GNU packages simplified development considerably, those
2325 packages include Autoconf, Automake, Libtool, Gnulib, Gettext, Indent,
2326 CVS, Texinfo, Help2man and Emacs.
2328 Several people reported bugs, sent patches or suggested improvements,
2329 see the file THANKS.
2331 This manual borrows text from the Kerberos 5 specification.
2333 @c **********************************************************
2334 @c ******************* Appendices *************************
2335 @c **********************************************************
2337 @node Copying This Manual
2338 @appendix Copying This Manual
2341 * GNU Free Documentation License:: License for copying this manual.
2349 @unnumbered Concept Index
2353 @node Function and Data Index
2354 @unnumbered Function and Data Index