[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
shishi lib/authorize.c lib/crypto-ctx.c lib/cry...
From: |
shishi-commit |
Subject: |
shishi lib/authorize.c lib/crypto-ctx.c lib/cry... |
Date: |
Sun, 28 Sep 2003 19:38:03 -0400 |
CVSROOT: /cvsroot/shishi
Module name: shishi
Branch:
Changes by: Simon Josefsson <address@hidden> 03/09/28 19:38:03
Modified files:
lib : authorize.c crypto-ctx.c crypto-des.c
crypto-rc4.c crypto.c error.c init.c kdcrep.c
kdcreq.c kerberos5.asn1 libgcrypt.c nettle.c
password.c priv.c shishi.h.in tkt.c tkts.c
src : shishi.c
tests : crypto.c
Log message:
Indent.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/authorize.c.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/crypto-ctx.c.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/crypto-des.c.diff?tr1=1.55&tr2=1.56&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/crypto-rc4.c.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/crypto.c.diff?tr1=1.90&tr2=1.91&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/error.c.diff?tr1=1.29&tr2=1.30&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/init.c.diff?tr1=1.47&tr2=1.48&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/kdcrep.c.diff?tr1=1.37&tr2=1.38&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/kdcreq.c.diff?tr1=1.50&tr2=1.51&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/kerberos5.asn1.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/libgcrypt.c.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/nettle.c.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/password.c.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/priv.c.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/shishi.h.in.diff?tr1=1.178&tr2=1.179&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/tkt.c.diff?tr1=1.26&tr2=1.27&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/tkts.c.diff?tr1=1.29&tr2=1.30&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/src/shishi.c.diff?tr1=1.67&tr2=1.68&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/tests/crypto.c.diff?tr1=1.24&tr2=1.25&r1=text&r2=text
Patches:
Index: shishi/lib/authorize.c
diff -u shishi/lib/authorize.c:1.1 shishi/lib/authorize.c:1.2
--- shishi/lib/authorize.c:1.1 Sun Sep 28 12:05:31 2003
+++ shishi/lib/authorize.c Sun Sep 28 19:38:02 2003
@@ -37,8 +37,8 @@
int
shishi_authorized_p (Shishi * handle, Shishi_tkt * tkt, const char *authzname)
{
- char cname[BUFSIZ]; /* XXX */
- size_t cnamelen = sizeof(cname);
+ char cname[BUFSIZ]; /* XXX */
+ size_t cnamelen = sizeof (cname);
int rc;
rc = shishi_encticketpart_cname_get (handle,
Index: shishi/lib/crypto-ctx.c
diff -u shishi/lib/crypto-ctx.c:1.3 shishi/lib/crypto-ctx.c:1.4
--- shishi/lib/crypto-ctx.c:1.3 Wed Sep 24 07:25:38 2003
+++ shishi/lib/crypto-ctx.c Sun Sep 28 19:38:02 2003
@@ -23,11 +23,11 @@
struct Shishi_crypto
{
- Shishi * handle;
- Shishi_key * key;
+ Shishi *handle;
+ Shishi_key *key;
int keyusage;
int32_t etype;
- char * iv;
+ char *iv;
size_t ivlen;
};
@@ -56,9 +56,7 @@
Shishi_crypto *
shishi_crypto (Shishi * handle,
Shishi_key * key,
- int keyusage,
- int32_t etype,
- const char * iv, size_t ivlen)
+ int keyusage, int32_t etype, const char *iv, size_t ivlen)
{
Shishi_crypto *ctx;
int rc;
@@ -110,10 +108,9 @@
int rc;
rc = shishi_encrypt_ivupdate_etype (ctx->handle, ctx->key, ctx->keyusage,
- ctx->etype, ctx->iv, ctx->ivlen,
- &ivout, &ivoutlen,
- in, inlen,
- out, outlen);
+ ctx->etype, ctx->iv, ctx->ivlen,
+ &ivout, &ivoutlen,
+ in, inlen, out, outlen);
if (rc == SHISHI_OK)
{
free (ctx->iv);
@@ -154,8 +151,7 @@
rc = shishi_decrypt_ivupdate_etype (ctx->handle, ctx->key, ctx->keyusage,
ctx->etype, ctx->iv, ctx->ivlen,
&ivout, &ivoutlen,
- in, inlen,
- out, outlen);
+ in, inlen, out, outlen);
if (rc == SHISHI_OK)
{
free (ctx->iv);
Index: shishi/lib/crypto-des.c
diff -u shishi/lib/crypto-des.c:1.55 shishi/lib/crypto-des.c:1.56
--- shishi/lib/crypto-des.c:1.55 Sat Sep 20 07:06:10 2003
+++ shishi/lib/crypto-des.c Sun Sep 28 19:38:02 2003
@@ -182,9 +182,9 @@
const char *in, size_t inlen, char **out, size_t * outlen)
{
return des_encrypt_checksum (handle, key, keyusage,
- shishi_key_value (key), shishi_key_length (key),
- ivout, ivoutlen, in, inlen, out, outlen,
- SHISHI_DES_CBC_CRC);
+ shishi_key_value (key),
+ shishi_key_length (key), ivout, ivoutlen, in,
+ inlen, out, outlen, SHISHI_DES_CBC_CRC);
}
static int
Index: shishi/lib/crypto-rc4.c
diff -u shishi/lib/crypto-rc4.c:1.13 shishi/lib/crypto-rc4.c:1.14
--- shishi/lib/crypto-rc4.c:1.13 Sun Sep 21 09:01:54 2003
+++ shishi/lib/crypto-rc4.c Sun Sep 28 19:38:03 2003
@@ -23,7 +23,8 @@
#include "crypto.h"
-static int arcfour_keyusage (int keyusage)
+static int
+arcfour_keyusage (int keyusage)
{
/* From draft-brezak-win2k-krb-rc4-hmac-04.txt:
*
@@ -88,12 +89,13 @@
static int
arcfour_hmac_encrypt (Shishi * handle,
- Shishi_key * key,
- int keyusage,
- const char *iv,
- size_t ivlen,
- char **ivout, size_t * ivoutlen,
- const char *in, size_t inlen, char **out, size_t * outlen)
+ Shishi_key * key,
+ int keyusage,
+ const char *iv,
+ size_t ivlen,
+ char **ivout, size_t * ivoutlen,
+ const char *in, size_t inlen, char **out,
+ size_t * outlen)
{
int export = shishi_key_type (key) == SHISHI_ARCFOUR_HMAC_EXP;
int arcfourkeyusage = arcfour_keyusage (keyusage);
@@ -176,7 +178,8 @@
if (VERBOSECRYPTONOICE (handle))
{
- puts ("random"); _shishi_hexprint (pt, 8);
+ puts ("random");
+ _shishi_hexprint (pt, 8);
}
err = shishi_hmac_md5 (handle, K2, 16, pt, ptlen, &cksum);
@@ -185,7 +188,8 @@
if (VERBOSECRYPTONOICE (handle))
{
- puts ("cksum"); _shishi_hexprint (cksum, 16);
+ puts ("cksum");
+ _shishi_hexprint (cksum, 16);
}
err = shishi_hmac_md5 (handle, K1, 16, cksum, 16, &K3);
@@ -215,11 +219,11 @@
if (ivoutlen)
/* size = sbox[256] + int8_t i + int8_t j */
- *ivoutlen = 256 + 2*8;
+ *ivoutlen = 256 + 2 * 8;
err = SHISHI_OK;
- done:
+done:
free (cksum);
free (K3);
free (pt);
@@ -230,12 +234,13 @@
static int
arcfour_hmac_decrypt (Shishi * handle,
- Shishi_key * key,
- int keyusage,
- const char *iv,
- size_t ivlen,
- char **ivout, size_t * ivoutlen,
- const char *in, size_t inlen, char **out, size_t * outlen)
+ Shishi_key * key,
+ int keyusage,
+ const char *iv,
+ size_t ivlen,
+ char **ivout, size_t * ivoutlen,
+ const char *in, size_t inlen, char **out,
+ size_t * outlen)
{
int export = shishi_key_type (key) == SHISHI_ARCFOUR_HMAC_EXP;
int arcfourkeyusage = arcfour_keyusage (keyusage);
@@ -302,13 +307,15 @@
_shishi_hexprint (K3, 16);
}
- err = shishi_arcfour (handle, 1, K3, 16, iv, ivout, in + 16, inlen - 16,
&pt);
+ err =
+ shishi_arcfour (handle, 1, K3, 16, iv, ivout, in + 16, inlen - 16, &pt);
if (err)
goto done;
if (VERBOSECRYPTONOICE (handle))
{
- puts ("cksum pt"); _shishi_hexprint (pt, inlen - 16);
+ puts ("cksum pt");
+ _shishi_hexprint (pt, inlen - 16);
}
err = shishi_hmac_md5 (handle, K2, 16, pt, inlen - 16, &cksum);
@@ -317,8 +324,10 @@
if (VERBOSECRYPTONOICE (handle))
{
- puts ("cksum"); _shishi_hexprint (cksum, 16);
- puts ("cksumin"); _shishi_hexprint (in, 16);
+ puts ("cksum");
+ _shishi_hexprint (cksum, 16);
+ puts ("cksumin");
+ _shishi_hexprint (in, 16);
}
if (memcmp (cksum, in, 16) != 0)
@@ -333,11 +342,11 @@
if (ivoutlen)
/* size = sbox[256] + int8_t i + int8_t j */
- *ivoutlen = 256 + 2*8;
+ *ivoutlen = 256 + 2 * 8;
err = SHISHI_OK;
- done:
+done:
free (cksum);
free (K3);
free (K1);
@@ -347,13 +356,13 @@
static int
arcfour_hmac_exp_encrypt (Shishi * handle,
- Shishi_key * key,
- int keyusage,
- const char *iv,
- size_t ivlen,
- char **ivout, size_t * ivoutlen,
- const char *in, size_t inlen,
- char **out, size_t * outlen)
+ Shishi_key * key,
+ int keyusage,
+ const char *iv,
+ size_t ivlen,
+ char **ivout, size_t * ivoutlen,
+ const char *in, size_t inlen,
+ char **out, size_t * outlen)
{
return arcfour_hmac_encrypt (handle, key, keyusage, iv, ivlen,
ivout, ivoutlen, in, inlen, out, outlen);
@@ -362,13 +371,13 @@
static int
arcfour_hmac_exp_decrypt (Shishi * handle,
- Shishi_key * key,
- int keyusage,
- const char *iv,
- size_t ivlen,
- char **ivout, size_t * ivoutlen,
- const char *in, size_t inlen,
- char **out, size_t * outlen)
+ Shishi_key * key,
+ int keyusage,
+ const char *iv,
+ size_t ivlen,
+ char **ivout, size_t * ivoutlen,
+ const char *in, size_t inlen,
+ char **out, size_t * outlen)
{
return arcfour_hmac_decrypt (handle, key, keyusage, iv, ivlen,
ivout, ivoutlen, in, inlen, out, outlen);
@@ -378,11 +387,11 @@
static int
arcfour_hmac_md5_checksum (Shishi * handle,
- Shishi_key * key,
- int keyusage,
- int cksumtype,
- const char *in, size_t inlen,
- char **out, size_t * outlen)
+ Shishi_key * key,
+ int keyusage,
+ int cksumtype,
+ const char *in, size_t inlen,
+ char **out, size_t * outlen)
{
int arcfourkeyusage = arcfour_keyusage (keyusage);
char *Ksign = NULL;
@@ -407,7 +416,8 @@
if (VERBOSECRYPTONOICE (handle))
{
- puts ("Ksign"); _shishi_hexprint (Ksign, 16);
+ puts ("Ksign");
+ _shishi_hexprint (Ksign, 16);
}
ptlen = 4 + inlen;
@@ -417,7 +427,8 @@
if (VERBOSECRYPTONOICE (handle))
{
- puts ("pt"); _shishi_hexprint (pt, ptlen);
+ puts ("pt");
+ _shishi_hexprint (pt, ptlen);
}
err = shishi_md5 (handle, pt, ptlen, &tmp);
@@ -426,7 +437,8 @@
if (VERBOSECRYPTONOICE (handle))
{
- puts ("md"); _shishi_hexprint (tmp, 16);
+ puts ("md");
+ _shishi_hexprint (tmp, 16);
}
*outlen = 16;
@@ -436,12 +448,13 @@
if (VERBOSECRYPTONOICE (handle))
{
- puts ("hmac"); _shishi_hexprint (*out, 16);
+ puts ("hmac");
+ _shishi_hexprint (*out, 16);
}
err = SHISHI_OK;
- done:
+done:
free (Ksign);
free (pt);
free (tmp);
@@ -450,8 +463,8 @@
static int
arcfour_hmac_random_to_key (Shishi * handle,
- const char *random, size_t randomlen,
- Shishi_key * outkey)
+ const char *random, size_t randomlen,
+ Shishi_key * outkey)
{
if (randomlen != shishi_key_length (outkey))
{
@@ -466,11 +479,11 @@
static int
arcfour_hmac_string_to_key (Shishi * handle,
- const char *string,
- size_t stringlen,
- const char *salt,
- size_t saltlen,
- const char *parameter, Shishi_key * outkey)
+ const char *string,
+ size_t stringlen,
+ const char *salt,
+ size_t saltlen,
+ const char *parameter, Shishi_key * outkey)
{
char *tmp, *md;
size_t tmplen, i;
Index: shishi/lib/crypto.c
diff -u shishi/lib/crypto.c:1.90 shishi/lib/crypto.c:1.91
--- shishi/lib/crypto.c:1.90 Sun Sep 21 09:30:38 2003
+++ shishi/lib/crypto.c Sun Sep 28 19:38:03 2003
@@ -257,7 +257,7 @@
memset (pt + inlen, 0, padzerolen);
}
else
- pt = (char*) in;
+ pt = (char *) in;
switch (shishi_key_type (key))
{
@@ -660,20 +660,32 @@
return -1;
}
-static struct {
+static struct
+{
char *name;
int type;
-} cipher_aliases[] = {
- { "des-crc", SHISHI_DES_CBC_CRC },
- { "des-md4", SHISHI_DES_CBC_MD4 },
- { "des-md5", SHISHI_DES_CBC_MD5 },
- { "des", SHISHI_DES_CBC_MD5 },
- { "des3", SHISHI_DES3_CBC_HMAC_SHA1_KD },
- { "3des", SHISHI_DES3_CBC_HMAC_SHA1_KD },
- { "aes128", SHISHI_AES128_CTS_HMAC_SHA1_96 },
- { "aes256", SHISHI_AES256_CTS_HMAC_SHA1_96 },
- { "aes", SHISHI_AES256_CTS_HMAC_SHA1_96 },
- { "arcfour", SHISHI_ARCFOUR_HMAC }
+} cipher_aliases[] =
+{
+ {
+ "des-crc", SHISHI_DES_CBC_CRC},
+ {
+ "des-md4", SHISHI_DES_CBC_MD4},
+ {
+ "des-md5", SHISHI_DES_CBC_MD5},
+ {
+ "des", SHISHI_DES_CBC_MD5},
+ {
+ "des3", SHISHI_DES3_CBC_HMAC_SHA1_KD},
+ {
+ "3des", SHISHI_DES3_CBC_HMAC_SHA1_KD},
+ {
+ "aes128", SHISHI_AES128_CTS_HMAC_SHA1_96},
+ {
+ "aes256", SHISHI_AES256_CTS_HMAC_SHA1_96},
+ {
+ "aes", SHISHI_AES256_CTS_HMAC_SHA1_96},
+ {
+ "arcfour", SHISHI_ARCFOUR_HMAC}
};
/**
Index: shishi/lib/error.c
diff -u shishi/lib/error.c:1.29 shishi/lib/error.c:1.30
--- shishi/lib/error.c:1.29 Tue Sep 9 17:55:10 2003
+++ shishi/lib/error.c Sun Sep 28 19:38:03 2003
@@ -248,7 +248,7 @@
shishi_info (Shishi * handle, const char *format, ...)
{
va_list ap;
- char * out;
+ char *out;
int type;
va_start (ap, format);
@@ -283,7 +283,7 @@
shishi_warn (Shishi * handle, const char *format, ...)
{
va_list ap;
- char * out;
+ char *out;
int type;
va_start (ap, format);
Index: shishi/lib/init.c
diff -u shishi/lib/init.c:1.47 shishi/lib/init.c:1.48
--- shishi/lib/init.c:1.47 Sat Sep 13 07:30:46 2003
+++ shishi/lib/init.c Sun Sep 28 19:38:03 2003
@@ -190,8 +190,7 @@
static int
init_read (Shishi * handle,
const char *tktsfile,
- const char *systemcfgfile,
- const char *usercfgfile)
+ const char *systemcfgfile, const char *usercfgfile)
{
int rc = SHISHI_OK;
Index: shishi/lib/kdcrep.c
diff -u shishi/lib/kdcrep.c:1.37 shishi/lib/kdcrep.c:1.38
--- shishi/lib/kdcrep.c:1.37 Sun Sep 7 10:41:55 2003
+++ shishi/lib/kdcrep.c Sun Sep 28 19:38:03 2003
@@ -727,7 +727,8 @@
free (cipher);
if (res != SHISHI_OK)
{
- shishi_error_printf (handle, "KDCRep decryption failed, wrong
password?");
+ shishi_error_printf (handle,
+ "KDCRep decryption failed, wrong password?");
return res;
}
Index: shishi/lib/kdcreq.c
diff -u shishi/lib/kdcreq.c:1.50 shishi/lib/kdcreq.c:1.51
--- shishi/lib/kdcreq.c:1.50 Thu Sep 18 17:54:09 2003
+++ shishi/lib/kdcreq.c Sun Sep 28 19:38:03 2003
@@ -569,7 +569,7 @@
* Return value: Returns SHISHI_OK iff successful.
**/
int
-shishi_kdcreq_options (Shishi * handle, Shishi_asn1 kdcreq, uint32_t *flags)
+shishi_kdcreq_options (Shishi * handle, Shishi_asn1 kdcreq, uint32_t * flags)
{
return shishi_asn1_read_bitstring (handle, kdcreq,
"req-body.kdc-options", flags);
@@ -614,8 +614,7 @@
**/
int
shishi_kdcreq_options_set (Shishi * handle,
- Shishi_asn1 kdcreq,
- uint32_t options)
+ Shishi_asn1 kdcreq, uint32_t options)
{
int res;
@@ -639,8 +638,7 @@
**/
int
shishi_kdcreq_options_add (Shishi * handle,
- Shishi_asn1 kdcreq,
- uint32_t option)
+ Shishi_asn1 kdcreq, uint32_t option)
{
int options;
int res;
Index: shishi/lib/kerberos5.asn1
diff -u shishi/lib/kerberos5.asn1:1.3 shishi/lib/kerberos5.asn1:1.4
--- shishi/lib/kerberos5.asn1:1.3 Fri Sep 19 05:43:07 2003
+++ shishi/lib/kerberos5.asn1 Sun Sep 28 19:38:03 2003
@@ -1,28 +1,108 @@
--- kerberos.asn1 Kerberos ASN.1 Module
--- Copyright (C) 2002, 2003 Simon Josefsson
---
--- This file is part of Shishi.
---
--- Shishi is free software; you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation; either version 2 of the License, or
--- (at your option) any later version.
---
--- Shishi is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with Shishi; if not, write to the Free Software
--- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
---
-
--- This module is based on the one given in appendix A of RFC1510bis
--- (draft-ietf-krb-wg-kerberos-clarifications-04.txt) which exhibits
--- no copyright notice, but is presumable owned by ISOC via IETF.
-
--- The modifications are to make libtasn1's parser accept it.
+-- kerberos.asn1 Kerberos ASN .1 Module-- Copyright (C) 2002,
+ 2003 Simon Josefsson-- -- This file is part of Shishi. --
+ --Shishi is free software;
+ you can redistribute it
+ and /
+ or
+ modify--
+ it
+ under
+ the
+ terms
+ of
+ the
+ GNU
+ General
+ Public
+ License
+ as
+ published
+ by--
+ the
+ Free
+ Software
+ Foundation;
+ either
+ version
+ 2
+ of
+ the
+ License,
+ or-- (at your option)
+ any later
+ version. -- --
+ Shishi
+ is
+ distributed
+ in
+ the
+ hope
+ that
+ it
+ will
+ be
+ useful, --
+ but
+ WITHOUT
+ ANY
+ WARRANTY;
+ without even the implied warranty
+ of--
+ MERCHANTABILITY
+ or
+ FITNESS
+ FOR
+ A
+ PARTICULAR
+ PURPOSE.
+ See
+ the--
+ GNU
+ General
+ Public
+ License for
+ more
+ details. -- --
+ You
+ should
+ have
+ received
+ a
+ copy
+ of
+ the
+ GNU
+ General
+ Public
+ License--
+ along
+ with
+ Shishi; if not
+ , write to the Free Software-- Foundation, Inc., 59 Temple Place,
+ Suite 330, Boston,
+ MA 02111 - 1307 USA-- --
+ This module is based on the one given in appendix A of
+ RFC1510bis-- (draft - ietf - krb - wg - kerberos - clarifications -
+ 04. txt) which
+ exhibits--
+ no
+ copyright
+ notice,
+ but
+ is
+ presumable
+ owned
+ by
+ ISOC
+ via
+ IETF. --
+ The
+ modifications
+ are
+ to
+ make
+ libtasn1
+ 's parser accept it.
Kerberos5 {
iso(1) identified-organization(3) dod(6) internet(1)
@@ -168,8 +248,12 @@
cname [1] PrincipalName OPTIONAL
-- Used only in AS-REQ --,
realm [2] Realm
- -- Server's realm
- -- Also client's in AS-REQ --,
+ -- Server'
+ s
+ realm--
+ Also
+ client
+ 's in AS-REQ --,
sname [3] PrincipalName OPTIONAL,
from [4] KerberosTime OPTIONAL,
till [5] KerberosTime,
@@ -317,8 +401,14 @@
timestamp [1] KerberosTime OPTIONAL,
usec [2] Microseconds OPTIONAL,
seq-number [3] UInt32 OPTIONAL,
- s-address [4] HostAddress -- sender's addr --,
- r-address [5] HostAddress OPTIONAL -- recip's addr
+ s-address [4] HostAddress -- sender'
+ s
+ addr--,
+ r -
+ address[5] HostAddress
+ OPTIONAL--
+ recip
+ 's addr
}
KRB-CRED ::= [APPLICATION 22] SEQUENCE {
@@ -379,39 +469,37 @@
PA-ENC-TIMESTAMP ::= EncryptedData -- PA-ENC-TS-ENC
PA-ENC-TS-ENC ::= SEQUENCE {
- patimestamp [0] KerberosTime -- client's time --,
- pausec [1] Microseconds OPTIONAL
-}
+ patimestamp [0] KerberosTime -- client'
+ s
+ time--,
+ pausec[1] Microseconds
+ OPTIONAL}
-ETYPE-INFO-ENTRY ::= SEQUENCE {
- etype [0] Int32,
- salt [1] OCTET STRING OPTIONAL
+ETYPE -
+ INFO -
+ ENTRY:: = SEQUENCE {
+ etype[0] Int32,
+ salt[1] OCTET STRING OPTIONAL
}
-ETYPE-INFO ::= SEQUENCE OF ETYPE-INFO-ENTRY
-
-ETYPE-INFO2-ENTRY ::= SEQUENCE {
- etype [0] Int32,
- salt [1] KerberosString OPTIONAL,
- s2kparams [2] OCTET STRING OPTIONAL
+ETYPE - INFO:: = SEQUENCE OF ETYPE - INFO - ENTRY
+ ETYPE - INFO2 - ENTRY:: = SEQUENCE {
+ etype[0] Int32,
+ salt[1] KerberosString OPTIONAL,
+ s2kparams[2] OCTET STRING OPTIONAL
}
-ETYPE-INFO2 ::= SEQUENCE SIZE (1..MAX) OF ETYPE-INFO2-ENTRY
-
-AD-IF-RELEVANT ::= AuthorizationData
-
-AD-KDCIssued ::= SEQUENCE {
- ad-checksum [0] Checksum,
- i-realm [1] Realm OPTIONAL,
- i-sname [2] PrincipalName OPTIONAL,
- elements [3] AuthorizationData
+ETYPE - INFO2:: = SEQUENCE SIZE (1..MAX) OF ETYPE - INFO2 - ENTRY
+ AD - IF - RELEVANT:: = AuthorizationData AD - KDCIssued:: = SEQUENCE {
+ ad - checksum[0] Checksum,
+ i - realm[1] Realm OPTIONAL,
+ i - sname[2] PrincipalName OPTIONAL,
+ elements[3] AuthorizationData
}
-AD-AND-OR ::= SEQUENCE {
- condition-count [0] INTEGER,
- elements [1] AuthorizationData
+AD - AND - OR:: = SEQUENCE {
+ condition - count[0] INTEGER,
+ elements[1] AuthorizationData
}
-AD-MANDATORY-FOR-KDC ::= AuthorizationData
-
-END
+AD - MANDATORY - FOR - KDC:: = AuthorizationData END
Index: shishi/lib/libgcrypt.c
diff -u shishi/lib/libgcrypt.c:1.18 shishi/lib/libgcrypt.c:1.19
--- shishi/lib/libgcrypt.c:1.18 Sun Sep 21 09:02:47 2003
+++ shishi/lib/libgcrypt.c Sun Sep 28 19:38:03 2003
@@ -43,7 +43,7 @@
}
err = gcry_control (GCRYCTL_DISABLE_SECMEM, NULL, 0);
- if (err != GPG_ERR_NO_ERROR)
+ if (err != GPG_ERR_NO_ERROR)
{
shishi_warn (handle, "gcry_control (GCRYCTL_DISABLE_SECMEM)"
" failed: %s", gcry_strerror (err));
@@ -51,9 +51,10 @@
}
err = gcry_control (GCRYCTL_INITIALIZATION_FINISHED, NULL, 0);
- if (err != GPG_ERR_NO_ERROR)
+ if (err != GPG_ERR_NO_ERROR)
{
- shishi_warn (handle, "gcry_control (GCRYCTL_INITIALIZATION_FINISHED)"
+ shishi_warn (handle,
+ "gcry_control (GCRYCTL_INITIALIZATION_FINISHED)"
" failed: %s", gcry_strerror (err));
return SHISHI_CRYPTO_INTERNAL_ERROR;
}
@@ -73,9 +74,7 @@
}
int
-shishi_crc (Shishi * handle,
- const char *in, size_t inlen,
- char *out[4])
+shishi_crc (Shishi * handle, const char *in, size_t inlen, char *out[4])
{
gcry_md_hd_t hd;
gpg_error_t err;
@@ -112,9 +111,7 @@
}
int
-shishi_md4 (Shishi * handle,
- const char *in, size_t inlen,
- char *out[16])
+shishi_md4 (Shishi * handle, const char *in, size_t inlen, char *out[16])
{
gcry_md_hd_t hd;
gpg_error_t err;
@@ -145,9 +142,7 @@
}
int
-shishi_md5 (Shishi * handle,
- const char *in, size_t inlen,
- char *out[16])
+shishi_md5 (Shishi * handle, const char *in, size_t inlen, char *out[16])
{
gcry_md_hd_t hd;
gpg_error_t err;
@@ -179,9 +174,8 @@
int
shishi_hmac_md5 (Shishi * handle,
- const char *key, size_t keylen,
- const char *in, size_t inlen,
- char *outhash[16])
+ const char *key, size_t keylen,
+ const char *in, size_t inlen, char *outhash[16])
{
gcry_md_hd_t mdh;
size_t hlen = gcry_md_get_algo_dlen (GCRY_MD_MD5);
@@ -223,8 +217,7 @@
int
shishi_hmac_sha1 (Shishi * handle,
const char *key, size_t keylen,
- const char *in, size_t inlen,
- char *outhash[20])
+ const char *in, size_t inlen, char *outhash[20])
{
gcry_md_hd_t mdh;
size_t hlen = gcry_md_get_algo_dlen (GCRY_MD_SHA1);
@@ -267,8 +260,7 @@
shishi_des_cbc_mac (Shishi * handle,
const char key[8],
const char iv[8],
- const char *in, size_t inlen,
- char *out[8])
+ const char *in, size_t inlen, char *out[8])
{
gcry_cipher_hd_t ch;
gpg_error_t err;
@@ -310,7 +302,7 @@
return SHISHI_OK;
- done:
+done:
gcry_cipher_close (ch);
return res;
}
@@ -320,9 +312,7 @@
int decryptp,
const char *key, size_t keylen,
const char *iv,
- char **ivout,
- const char *in, size_t inlen,
- char **out)
+ char **ivout, const char *in, size_t inlen, char **out)
{
size_t ivlen = gcry_cipher_get_algo_blklen (algo);
gcry_cipher_hd_t ch;
@@ -390,8 +380,7 @@
shishi_arcfour (Shishi * handle, int decryptp,
const char *key, size_t keylen,
const char iv[258], char *ivout[258],
- const char *in, size_t inlen,
- char **out)
+ const char *in, size_t inlen, char **out)
{
/* XXX Support iv/ivout. */
return libgcrypt_dencrypt (handle, GCRY_CIPHER_ARCFOUR, 0,
@@ -403,9 +392,7 @@
shishi_des (Shishi * handle, int decryptp,
const char key[8],
const char iv[8],
- char *ivout[8],
- const char *in, size_t inlen,
- char **out)
+ char *ivout[8], const char *in, size_t inlen, char **out)
{
return libgcrypt_dencrypt (handle, GCRY_CIPHER_DES, 0, GCRY_CIPHER_MODE_CBC,
decryptp, key, 8, iv, ivout, in, inlen, out);
@@ -415,21 +402,18 @@
shishi_3des (Shishi * handle, int decryptp,
const char key[24],
const char iv[8],
- char *ivout[8],
- const char *in, size_t inlen,
- char **out)
+ char *ivout[8], const char *in, size_t inlen, char **out)
{
- return libgcrypt_dencrypt (handle, GCRY_CIPHER_3DES, 0, GCRY_CIPHER_MODE_CBC,
- decryptp, key, 24, iv, ivout, in, inlen, out);
+ return libgcrypt_dencrypt (handle, GCRY_CIPHER_3DES, 0,
+ GCRY_CIPHER_MODE_CBC, decryptp, key, 24, iv,
+ ivout, in, inlen, out);
}
int
shishi_aes_cts (Shishi * handle, int decryptp,
const char *key, size_t keylen,
const char iv[16],
- char *ivout[16],
- const char *in, size_t inlen,
- char **out)
+ char *ivout[16], const char *in, size_t inlen, char **out)
{
return libgcrypt_dencrypt (handle, GCRY_CIPHER_AES, GCRY_CIPHER_CBC_CTS,
GCRY_CIPHER_MODE_CBC, decryptp,
Index: shishi/lib/nettle.c
diff -u shishi/lib/nettle.c:1.16 shishi/lib/nettle.c:1.17
--- shishi/lib/nettle.c:1.16 Sun Sep 21 09:07:46 2003
+++ shishi/lib/nettle.c Sun Sep 28 19:38:03 2003
@@ -228,7 +228,7 @@
*out = xmalloc (4);
(*out)[0] = crc & 0xFF;
- (*out)[1] = (crc >> 8) & 0xFF;
+ (*out)[1] = (crc >> 8) & 0xFF;
(*out)[2] = (crc >> 16) & 0xFF;
(*out)[3] = (crc >> 24) & 0xFF;
@@ -249,8 +249,7 @@
**/
int
shishi_md4 (Shishi * handle,
- const char *in, size_t inlen,
- char *out[MD4_DIGEST_SIZE])
+ const char *in, size_t inlen, char *out[MD4_DIGEST_SIZE])
{
struct md4_ctx md4;
@@ -276,8 +275,7 @@
**/
int
shishi_md5 (Shishi * handle,
- const char *in, size_t inlen,
- char *out[MD5_DIGEST_SIZE])
+ const char *in, size_t inlen, char *out[MD5_DIGEST_SIZE])
{
struct md5_ctx md5;
@@ -305,9 +303,8 @@
**/
int
shishi_hmac_md5 (Shishi * handle,
- const char *key, size_t keylen,
- const char *in, size_t inlen,
- char *outhash[MD5_DIGEST_SIZE])
+ const char *key, size_t keylen,
+ const char *in, size_t inlen, char *outhash[MD5_DIGEST_SIZE])
{
struct hmac_md5_ctx ctx;
@@ -367,8 +364,7 @@
shishi_des_cbc_mac (Shishi * handle,
const char key[DES_KEY_SIZE],
const char iv[DES_BLOCK_SIZE],
- const char *in, size_t inlen,
- char *out[DES_BLOCK_SIZE])
+ const char *in, size_t inlen, char *out[DES_BLOCK_SIZE])
{
struct CBC_MAC_CTX (struct des_ctx, DES_BLOCK_SIZE) des;
int rc;
@@ -418,8 +414,7 @@
shishi_arcfour (Shishi * handle, int decryptp,
const char *key, size_t keylen,
const char iv[258], char *ivout[258],
- const char *in, size_t inlen,
- char **out)
+ const char *in, size_t inlen, char **out)
{
struct arcfour_ctx ctx;
@@ -462,8 +457,7 @@
const char key[DES_KEY_SIZE],
const char iv[DES_BLOCK_SIZE],
char *ivout[DES_BLOCK_SIZE],
- const char *in, size_t inlen,
- char **out)
+ const char *in, size_t inlen, char **out)
{
struct CBC_CTX (struct des_ctx, DES_BLOCK_SIZE) des;
int rc;
@@ -514,8 +508,7 @@
const char key[DES3_KEY_SIZE],
const char iv[DES3_BLOCK_SIZE],
char *ivout[DES3_BLOCK_SIZE],
- const char *in, size_t inlen,
- char **out)
+ const char *in, size_t inlen, char **out)
{
struct CBC_CTX (struct des3_ctx, DES3_BLOCK_SIZE) des3;
int rc;
@@ -569,8 +562,7 @@
const char *key, size_t keylen,
const char iv[AES_BLOCK_SIZE],
char *ivout[AES_BLOCK_SIZE],
- const char *in, size_t inlen,
- char **out)
+ const char *in, size_t inlen, char **out)
{
struct CBC_CTS_CTX (struct aes_ctx, AES_BLOCK_SIZE) aes;
Index: shishi/lib/password.c
diff -u shishi/lib/password.c:1.13 shishi/lib/password.c:1.14
--- shishi/lib/password.c:1.13 Sun Sep 7 13:31:26 2003
+++ shishi/lib/password.c Sun Sep 28 19:38:03 2003
@@ -54,9 +54,7 @@
#else
mail simon @ josefsson.org and tell what system this is
-
#endif
-
static RETSIGTYPE
tty_echo (int signum)
{
@@ -87,7 +85,7 @@
fgets (buf, sizeof (buf), stdin);
buf[strlen (buf) - 1] = '\0';
- *s = strdup(buf);
+ *s = strdup (buf);
#ifdef HAVE_SIGNAL
signal (SIGQUIT, SIG_DFL);
@@ -151,7 +149,8 @@
printf ("\n");
}
- if (handle->stringprocess && strcasecmp (handle->stringprocess, "none") != 0)
+ if (handle->stringprocess
+ && strcasecmp (handle->stringprocess, "none") != 0)
#ifdef WITH_STRINGPREP
{
if (strcasecmp (handle->stringprocess, "stringprep") == 0)
Index: shishi/lib/priv.c
diff -u shishi/lib/priv.c:1.2 shishi/lib/priv.c:1.3
--- shishi/lib/priv.c:1.2 Sat Sep 6 17:07:25 2003
+++ shishi/lib/priv.c Sun Sep 28 19:38:03 2003
@@ -104,8 +104,7 @@
if (rc != SHISHI_OK)
return rc;
- rc = shishi_asn1_write (handle, lpriv->encprivpart, "r-address",
- NULL, 0);
+ rc = shishi_asn1_write (handle, lpriv->encprivpart, "r-address", NULL, 0);
if (rc != SHISHI_OK)
return rc;
@@ -484,8 +483,7 @@
**/
int
shishi_priv_enc_part_etype (Shishi * handle,
- Shishi_asn1 priv,
- int32_t * etype)
+ Shishi_asn1 priv, int32_t * etype)
{
return shishi_asn1_read_int32 (handle, priv, "enc-part.etype", etype);
}
@@ -620,8 +618,7 @@
}
res = shishi_priv_set_enc_part (priv->handle, priv->priv,
- shishi_key_type (key),
- buf, buflen);
+ shishi_key_type (key), buf, buflen);
if (res != SHISHI_OK)
return res;
@@ -668,7 +665,8 @@
free (cipher);
if (res != SHISHI_OK)
{
- shishi_error_printf (priv->handle, "PRIV decryption failed, bad key?\n");
+ shishi_error_printf (priv->handle,
+ "PRIV decryption failed, bad key?\n");
return res;
}
Index: shishi/lib/shishi.h.in
diff -u shishi/lib/shishi.h.in:1.178 shishi/lib/shishi.h.in:1.179
--- shishi/lib/shishi.h.in:1.178 Sun Sep 28 19:35:06 2003
+++ shishi/lib/shishi.h.in Sun Sep 28 19:38:03 2003
@@ -783,7 +783,7 @@
Shishi_tkts_hint * hint);
extern Shishi_tkt *shishi_tkts_get_tgs (Shishi_tkts * tkts,
Shishi_tkts_hint * hint,
- Shishi_tkt *tgt);
+ Shishi_tkt * tgt);
extern Shishi_tkt *shishi_tkts_get_for_clientserver (Shishi_tkts * tkts,
const char *client,
const char *server);
@@ -1037,7 +1037,7 @@
extern int shishi_kdcreq_set_etype (Shishi * handle, Shishi_asn1 kdcreq,
int32_t * etype, int netype);
extern int shishi_kdcreq_options (Shishi * handle, Shishi_asn1 kdcreq,
- uint32_t *flags);
+ uint32_t * flags);
extern int shishi_kdcreq_renewable_p (Shishi * handle, Shishi_asn1 kdcreq);
extern int shishi_kdcreq_options_set (Shishi * handle, Shishi_asn1 kdcreq,
uint32_t options);
@@ -1429,7 +1429,7 @@
extern Shishi_crypto *shishi_crypto (Shishi * handle,
Shishi_key * key, int keyusage,
int32_t etype,
- const char * iv, size_t ivlen);
+ const char *iv, size_t ivlen);
extern void shishi_crypto_close (Shishi_crypto * ctx);
extern int shishi_crypto_encrypt (Shishi_crypto * ctx,
const char *in, size_t inlen,
@@ -1468,7 +1468,7 @@
extern int shishi_asn1_read_uint32 (Shishi * handle, Shishi_asn1 node,
const char *field, uint32_t * i);
extern int shishi_asn1_read_bitstring (Shishi * handle, Shishi_asn1 node,
- const char *field, uint32_t *flags);
+ const char *field, uint32_t * flags);
extern int shishi_asn1_read_optional (Shishi * handle,
Shishi_asn1 node, const char *field,
char *data, size_t * datalen);
@@ -1959,8 +1959,7 @@
extern int shishi_priv_from_file (Shishi * handle, Shishi_asn1 * priv,
int filetype, const char *filename);
extern int shishi_priv_enc_part_etype (Shishi * handle,
- Shishi_asn1 priv,
- int32_t * etype);
+ Shishi_asn1 priv, int32_t * etype);
extern int shishi_priv_set_enc_part (Shishi * handle,
Shishi_asn1 priv,
int32_t etype,
@@ -1978,7 +1977,6 @@
/* authorize.c */
extern int shishi_authorized_p (Shishi * handle,
- Shishi_tkt * tkt,
- const char *authzname);
+ Shishi_tkt * tkt, const char *authzname);
#endif
Index: shishi/lib/tkt.c
diff -u shishi/lib/tkt.c:1.26 shishi/lib/tkt.c:1.27
--- shishi/lib/tkt.c:1.26 Thu Sep 11 11:45:32 2003
+++ shishi/lib/tkt.c Sun Sep 28 19:38:03 2003
@@ -145,9 +145,9 @@
shishi_tkt_done (Shishi_tkt * tkt)
{
/* XXX need to always copy key into ticket before we can do
- XXX this, compare shishi_tkt_key_set().
- if (tkt->key)
- shishi_key_done (tkt->key); */
+ XXX this, compare shishi_tkt_key_set().
+ if (tkt->key)
+ shishi_key_done (tkt->key); */
free (tkt);
}
Index: shishi/lib/tkts.c
diff -u shishi/lib/tkts.c:1.29 shishi/lib/tkts.c:1.30
--- shishi/lib/tkts.c:1.29 Tue Sep 9 12:24:48 2003
+++ shishi/lib/tkts.c Sun Sep 28 19:38:03 2003
@@ -734,8 +734,7 @@
/* Set flags and times in KDC-REQ based on hint. */
static int
act_hint_on_kdcreq (Shishi * handle,
- Shishi_tkts_hint * hint,
- Shishi_asn1 kdcreq)
+ Shishi_tkts_hint * hint, Shishi_asn1 kdcreq)
{
time_t starttime = hint->starttime ? hint->starttime : time (NULL);
time_t endtime = hint->endtime ? hint->endtime :
@@ -819,7 +818,7 @@
return SHISHI_OK;
- done:
+done:
shishi_error_printf (handle, "Cannot set KDC Options: %s",
shishi_strerror (rc));
return rc;
@@ -905,8 +904,7 @@
{
shishi_error_printf (tkts->handle,
"AS exchange failed: %s\n%s\n",
- shishi_strerror (rc),
- shishi_error (tkts->handle));
+ shishi_strerror (rc), shishi_error (tkts->handle));
if (rc == SHISHI_GOT_KRBERROR)
shishi_krberror_pretty_print (tkts->handle, stdout,
shishi_as_krberror (as));
@@ -950,8 +948,7 @@
**/
Shishi_tkt *
shishi_tkts_get_tgs (Shishi_tkts * tkts,
- Shishi_tkts_hint * hint,
- Shishi_tkt *tgt)
+ Shishi_tkts_hint * hint, Shishi_tkt * tgt)
{
Shishi_tgs *tgs;
Shishi_tkt *tkt;
@@ -973,8 +970,7 @@
{
shishi_error_printf (tkts->handle,
"TGS exchange failed: %s\n%s\n",
- shishi_strerror (rc),
- shishi_error (tkts->handle));
+ shishi_strerror (rc), shishi_error (tkts->handle));
if (rc == SHISHI_GOT_KRBERROR)
shishi_krberror_pretty_print (tkts->handle, stdout,
shishi_tgs_krberror (tgs));
Index: shishi/src/shishi.c
diff -u shishi/src/shishi.c:1.67 shishi/src/shishi.c:1.68
--- shishi/src/shishi.c:1.67 Sat Sep 20 07:06:10 2003
+++ shishi/src/shishi.c Sun Sep 28 19:38:03 2003
@@ -1152,8 +1152,7 @@
if (rc != SHISHI_OK)
{
fprintf (stderr, "TGS exchange failed: %s\n%s\n",
- shishi_strerror (rc),
- shishi_error (handle));
+ shishi_strerror (rc), shishi_error (handle));
if (rc == SHISHI_GOT_KRBERROR)
shishi_krberror_pretty_print (handle, stdout,
shishi_tgs_krberror (tgs));
Index: shishi/tests/crypto.c
diff -u shishi/tests/crypto.c:1.24 shishi/tests/crypto.c:1.25
--- shishi/tests/crypto.c:1.24 Sun Sep 14 13:49:57 2003
+++ shishi/tests/crypto.c Sun Sep 28 19:38:03 2003
@@ -279,7 +279,7 @@
"EXAMPLE.COMpianist",
"\x85\x76\x37\x26\x58\x5d\xbc\x1c\xce\x6e\xc4\x3e"
"\x1f\x75\x1f\x07\xf1\xc4\xcb\xb0\x98\xf4\x0b\x19",
- SHISHI_DES3_CBC_HMAC_SHA1_KD},
+ SHISHI_DES3_CBC_HMAC_SHA1_KD},
#endif
#if WITH_AES
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- shishi lib/authorize.c lib/crypto-ctx.c lib/cry...,
shishi-commit <=