hcrypto: Add exports for more crypto algorithms

Export some additional algorithms so we can make use
of them elsewhere in the code.

Change-Id: I676318a872a1e7b537112a3d60dac2edff478ae6
Allow some rfc3961 functionality to be disabled

It conflicts with v5gen in rxkad/ticket5.c

Also add include guards, which were missed previously.

Change-Id: If5155661deb5adf73329eb8b90021512c01a290f
libafsrpc: link afsrpc.dll to afsrfc3961.lib

Change-Id: I5bf48ed29522c0cbdc43dda63487012f14d39bbf
Update the WiX installer to know about afsrfc3961.dll
Use rfc3961 library to decrypt kerberos 5 tickets

Decrypt tickets with non-des enctypes by calling out to the rfc3961 library.
This requires the security object to be given an enhanced get_key callback
that supports looking up keys by enctype.
Include a wrapper around afsconf_GetKeyByTypes so rxkad doesn't have
to know anything about libauth internals/interfaces

Change-Id: Id2b085fb41e2ed3576ec66b2914c03e78c0077ec
Asetkey now handles afsconf_rxkad_krb5 keys too

afsconf_rxkad_krb5 keys can hold any kerberos enctype, not just des.
Allow asetkey to copy them into KeyFileExt and print them, too.

Change-Id: I11a7dc7770da58c8381accd7fa2164cdfcea43ae
Krb5 ticket support for server-to-server and localauth

Create a tkt_MakeTicket5 that creates a native krb5 rxkad token with
a service key supported by the rfc3961 library (session keys must be
provided as DES)

Update GenericAuth to search for rxkad_krb5 keys and call tkt_MakeTicket5
if it finds any.

Change-Id: Ia9543fdcffcbf3ca899a003908662ff3daa8ee07
Derive DES/fcrypt session key from other key types

If a kerberos 5 ticket has a session key with a non-DES enctype,
use the NIST SP800-108 KDF in counter mode with HMAC_MD5 as the PRF to
construct a DES key to be used by rxkad.

To satisfy the requirements of the KDF, DES3 keys are first compressed into a
168 bit form by reversing the RFC3961 random-to-key algorithm

Windows has three additional places to get tokens, who knew?

Change-Id: I4dc8e83a641f9892b31c109fb9025251de3dcb27
Use the string form of key types in asetkey

Check for rxkad-k5 keys in the six-argument form and warn they are
unsupported.  Do sanity-checking on the type.

Change-Id: I571fcf88744dec271265e6a47f7d9831f867115b
Update the asetkey man page for rxkad-k5

Also add the usage for the six-argument form while here.

Update some generic text to account for the existence of rxkad-k5,
and mention that the Update Server is not the only thing which can copy
around KeyFiles.  Give an example of the seven-argument form's usage for
rxkad-k5.
Add support for deriving DES keys to klog.krb5

Change-Id: I5b58585661f34ec501ad8db8f92b659f32919366
Use -nofork when starting bosserver via systemd

Systemd does not expect the started process to fork unless
"Type=forking" is given. Use -nofork to run BOS in foreground and allow
systemd to track its state.

Change-Id: I024be12b410d6b8299edd16f309d816a3df469ed
Reviewed-on: http://gerrit.openafs.org/10087
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Michael Laß <lass@mail.uni-paderborn.de>
Tested-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Merge branch 'rxkad-kdf-master' into HEAD

Merge the current OpenAFS master branch with the branch on which
OpenAFS-SA-2013-003 and OpenAFS-SA-2013-004 were developed.
Windows: fix cm_ServerEqual bug

must check svr2 not svr1 in the second uuid check.

Change-Id: I570b06c630a18c31001b3ca3ab09c870c7cbc355
Reviewed-on: http://gerrit.openafs.org/10086
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Windows: fix building of aklog

patchset 7e4e06b87a09197816b0e1ae132e38dc30090574 was misapplied
to src/WINNT/aklog/aklog.c resulting in a Windows build failure.

Change-Id: I789ee1464f1f2e695d043d7a25a9f7566068733a
Reviewed-on: http://gerrit.openafs.org/10105
Tested-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
aix: link afs_dynamic_kerbauth to rfc3961

Change-Id: Ie06fc83382e18f2e90a5f3874a8bb71afa0c4748
Reviewed-on: http://gerrit.openafs.org/10106
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Windows: fix cm_ServerFindByUUID

opr_uuid_equal() returns non-zero if equal.

Change-Id: I6777d4536d002ec227454aa014278e0fc32eb14d
Reviewed-on: http://gerrit.openafs.org/10090
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
rxkad: remove warnings from der-protos.h

der-protos.h was generated from Heimdal headers which in turn were
auto-generated.  The included a large number of function prototypes
of the form

  ret-type func(parm-list, type */* comment */);

where the combination of */* is ambiguous.  Does it mean an end comment
followed by a pointer declaration or a pointer declaration followed by
a begin comment.  This combination generates warnings on Windows.  The
bug was fixed in Heimdal's code generator.  Fixing it here by editing
the code.

Change-Id: Ie66a5c70b0144173d70433adfbe3ed453672af81
Reviewed-on: http://gerrit.openafs.org/10101
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
volume_inline.h: Down with assert, again

Commit 34767c6a0f914960c9a1efabe69dd9c312a2b400 replaced all assert
calls in this file with osi_Assert (now opr_Assert), but shortly
thereafter, commit db6ee95864a8fc5f33b7e95c19c8ff5058d37e92 added
VTimedWaitStateChange_r with two new assert calls.  These are
precarious in a public header; fix them to opr_Assert like the ones in
VWaitStateChange_r.

Change-Id: If2055355b45a09940d69dace59ec18bd6a0cc6fa
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/10094
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Linux: Remove extra "goto out" from tmpfs fix

Remove a stray "goto out" that should not have been applied in
this spot along with the tmpfs fix.

Thanks to Stephan Wiesand for pointing it out.

Change-Id: I6f798029a948446b974456648513ea7db4469561
Reviewed-on: http://gerrit.openafs.org/9953
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>