To: | krb5-bugs@MIT.EDU |
Subject: | v4 ticket file format incompatibilities |
From: | Ken Raeburn <raeburn@MIT.EDU> |
Date: | Mon, 30 Dec 2002 15:48:02 -0500 |
See attached message. The issue_date value is stored as a "long" in
the current krb5 tree. This also causes problems when mixing apps
compiled for sparcv7 and sparcv9, or (presumably, but unconfirmed)
ia32 and ia64. jhawk suggests investigating whether the library can
be made to support both formats, and I agree.
Looking for the four zero-valued bytes (before or after the issue
date, depending on host byte order) is probably all it would take
(until 2038, and then we get other problems), though we should still
think about what format should be used for writing on various
platforms to ease the transition.
Ken
Return-Path: <krbdev-admin@MIT.EDU>
Received: from pacific-carrier-annex.mit.edu by po9.mit.edu (8.9.2/4.7) id
MAA10570; Fri, 27 Dec 2002 12:20:57 -0500 (EST)
Received: from pch.mit.edu (PCH.MIT.EDU [18.7.21.90])
by pacific-carrier-annex.mit.edu (8.9.2/8.9.2) with ESMTP id MAA22855;
Fri, 27 Dec 2002 12:19:20 -0500 (EST)
Received: from pch.mit.edu (localhost [127.0.0.1])
by pch.mit.edu (8.9.3+Sun/8.9.3) with ESMTP id MAA00012;
Fri, 27 Dec 2002 12:19:17 -0500 (EST)
Received: from pacific-carrier-annex.mit.edu (PACIFIC-CARRIER-ANNEX.MIT.EDU
[18.7.21.83])
by pch.mit.edu (8.9.3+Sun/8.9.3) with ESMTP id MAA00005
for <krbdev@PCH.mit.edu>; Fri, 27 Dec 2002 12:18:33 -0500 (EST)
Received: from mailhub-1.iastate.edu (mailhub-1.iastate.edu [129.186.140.3])
by pacific-carrier-annex.mit.edu (8.9.2/8.9.2) with ESMTP id MAA22676
for <krbdev@mit.edu>; Fri, 27 Dec 2002 12:18:33 -0500 (EST)
Received: from mailout-1.iastate.edu (mailout-1.iastate.edu [129.186.140.1])
by mailhub-1.iastate.edu (8.9.3/8.9.3) with SMTP id LAA23145
for <krbdev@mit.edu>; Fri, 27 Dec 2002 11:18:32 -0600
Received: from pvtest.ait.iastate.edu(129.186.145.229) by
mailout-1.iastate.edu via csmap
id 26803; Fri, 27 Dec 2002 11:34:18 -0600 (CST)
Received: from localhost (john@localhost)
by pvtest.ait.iastate.edu (8.8.8/8.8.5) with SMTP id LAA01917
for <krbdev@mit.edu>; Fri, 27 Dec 2002 11:18:32 -0600 (CST)
Message-Id: <200212271718.LAA01917@pvtest.ait.iastate.edu>
To: krbdev@mit.edu
Subject: format of V4 ticketfile created by V5 differs?
From: John Hascall <john@iastate.edu>
Sender: krbdev-admin@MIT.EDU
Errors-To: krbdev-admin@MIT.EDU
X-BeenThere: krbdev@mit.edu
X-Mailman-Version: 2.0
Precedence: bulk
List-Help: <mailto:krbdev-request@mit.edu?subject=help>
List-Post: <mailto:krbdev@mit.edu>
List-Subscribe: <http://mailman.mit.edu/mailman/listinfo/krbdev>,
<mailto:krbdev-request@mit.edu?subject=subscribe>
List-Id: Kerberos Developers Mailing List <krbdev.mit.edu>
List-Unsubscribe: <http://mailman.mit.edu/mailman/listinfo/krbdev>,
<mailto:krbdev-request@mit.edu?subject=unsubscribe>
List-Archive: <http://mailman.mit.edu/pipermail/krbdev/>
X-Original-Date: Fri, 27 Dec 2002 11:18:32 CST
Date: Fri, 27 Dec 2002 11:18:32 CST
Lines: 59
Xref: all-in-one list.mit.krbdev:6808 all.2002-12:3398
MIME-Version: 1.0
I've noticed that the format of the V4 ticketfile created by the
V5 "compatibility routines" (1.2.6) differs from the format created
by our original V4 apps (and I guess I don't know which is "correct").
From our perspective, there are an extra 4 bytes of zeros at end
of each ticket created by the V5 apps/routines, for example:
0000020 T A T E . E D U \0 I A S T A T E
0000040 . E D U \0 343 s a v k 026 016 253 x \0 \0
0000060 \0 002 \0 \0 \0 8 \0 \0 \0 l , / 343 304 0
0000100 303 245 245 201 220 z 360 274 < 237 ; 312 273 { \n 263
0000120 & M 002 005 ) 225 216 Y 263 363 335 217 327 326 351 031
0000140 237 352 210 022 005 262 250 230 332 022 321 Y . 202 374 ^
0000160 027 l x \f > \0 \0 \0 \0 a c c t s r v
^^^^^^^^^^^^^^ \___start of 2nd ticket
\____here____/
this seems to be because of the way that krb_save_credentials() and
tf_save_cred() are declared, for example:
KRB5_DLLIMP int KRB5_CALLCONV krb_save_credentials
PROTOTYPE((char FAR *service, char FAR *instance, char FAR *realm,
C_Block session, int lifetime, int kvno,
KTEXT ticket, long issue_date));
^^^^
(8 bytes on this machine!)
I noted that CREDENTIALS.issue_date is defined as a KRB4_32 type,
so if I change them both like this:
KRB5_DLLIMP int KRB5_CALLCONV krb_save_credentials
PROTOTYPE((char FAR *service, char FAR *instance, char FAR *realm,
C_Block session, int lifetime, int kvno,
KTEXT ticket, KRB4_32 issue_date));
^^^^^^^
(4 bytes everywhere)
and change the end of tf_save_cred() from this:
if (write(fd, (char *) &issue_date, sizeof(long))
!= sizeof(long))
to this:
if (write(fd, (char *) &issue_date, sizeof(issue_date))
!= sizeof(issue_date))
and recompile, then everything seems to work together properly.
Is this correct?
John
Received: from pacific-carrier-annex.mit.edu by po9.mit.edu (8.9.2/4.7) id
MAA10570; Fri, 27 Dec 2002 12:20:57 -0500 (EST)
Received: from pch.mit.edu (PCH.MIT.EDU [18.7.21.90])
by pacific-carrier-annex.mit.edu (8.9.2/8.9.2) with ESMTP id MAA22855;
Fri, 27 Dec 2002 12:19:20 -0500 (EST)
Received: from pch.mit.edu (localhost [127.0.0.1])
by pch.mit.edu (8.9.3+Sun/8.9.3) with ESMTP id MAA00012;
Fri, 27 Dec 2002 12:19:17 -0500 (EST)
Received: from pacific-carrier-annex.mit.edu (PACIFIC-CARRIER-ANNEX.MIT.EDU
[18.7.21.83])
by pch.mit.edu (8.9.3+Sun/8.9.3) with ESMTP id MAA00005
for <krbdev@PCH.mit.edu>; Fri, 27 Dec 2002 12:18:33 -0500 (EST)
Received: from mailhub-1.iastate.edu (mailhub-1.iastate.edu [129.186.140.3])
by pacific-carrier-annex.mit.edu (8.9.2/8.9.2) with ESMTP id MAA22676
for <krbdev@mit.edu>; Fri, 27 Dec 2002 12:18:33 -0500 (EST)
Received: from mailout-1.iastate.edu (mailout-1.iastate.edu [129.186.140.1])
by mailhub-1.iastate.edu (8.9.3/8.9.3) with SMTP id LAA23145
for <krbdev@mit.edu>; Fri, 27 Dec 2002 11:18:32 -0600
Received: from pvtest.ait.iastate.edu(129.186.145.229) by
mailout-1.iastate.edu via csmap
id 26803; Fri, 27 Dec 2002 11:34:18 -0600 (CST)
Received: from localhost (john@localhost)
by pvtest.ait.iastate.edu (8.8.8/8.8.5) with SMTP id LAA01917
for <krbdev@mit.edu>; Fri, 27 Dec 2002 11:18:32 -0600 (CST)
Message-Id: <200212271718.LAA01917@pvtest.ait.iastate.edu>
To: krbdev@mit.edu
Subject: format of V4 ticketfile created by V5 differs?
From: John Hascall <john@iastate.edu>
Sender: krbdev-admin@MIT.EDU
Errors-To: krbdev-admin@MIT.EDU
X-BeenThere: krbdev@mit.edu
X-Mailman-Version: 2.0
Precedence: bulk
List-Help: <mailto:krbdev-request@mit.edu?subject=help>
List-Post: <mailto:krbdev@mit.edu>
List-Subscribe: <http://mailman.mit.edu/mailman/listinfo/krbdev>,
<mailto:krbdev-request@mit.edu?subject=subscribe>
List-Id: Kerberos Developers Mailing List <krbdev.mit.edu>
List-Unsubscribe: <http://mailman.mit.edu/mailman/listinfo/krbdev>,
<mailto:krbdev-request@mit.edu?subject=unsubscribe>
List-Archive: <http://mailman.mit.edu/pipermail/krbdev/>
X-Original-Date: Fri, 27 Dec 2002 11:18:32 CST
Date: Fri, 27 Dec 2002 11:18:32 CST
Lines: 59
Xref: all-in-one list.mit.krbdev:6808 all.2002-12:3398
MIME-Version: 1.0
I've noticed that the format of the V4 ticketfile created by the
V5 "compatibility routines" (1.2.6) differs from the format created
by our original V4 apps (and I guess I don't know which is "correct").
From our perspective, there are an extra 4 bytes of zeros at end
of each ticket created by the V5 apps/routines, for example:
Show quoted text
> od -c /var/dss/kerberos/tkt/tkt_3e0c7aa506fd5b
0000000 j o h n \0 \0 k r b t g t \0 I A S0000020 T A T E . E D U \0 I A S T A T E
0000040 . E D U \0 343 s a v k 026 016 253 x \0 \0
0000060 \0 002 \0 \0 \0 8 \0 \0 \0 l , / 343 304 0
0000100 303 245 245 201 220 z 360 274 < 237 ; 312 273 { \n 263
0000120 & M 002 005 ) 225 216 Y 263 363 335 217 327 326 351 031
0000140 237 352 210 022 005 262 250 230 332 022 321 Y . 202 374 ^
0000160 027 l x \f > \0 \0 \0 \0 a c c t s r v
^^^^^^^^^^^^^^ \___start of 2nd ticket
\____here____/
this seems to be because of the way that krb_save_credentials() and
tf_save_cred() are declared, for example:
KRB5_DLLIMP int KRB5_CALLCONV krb_save_credentials
PROTOTYPE((char FAR *service, char FAR *instance, char FAR *realm,
C_Block session, int lifetime, int kvno,
KTEXT ticket, long issue_date));
^^^^
(8 bytes on this machine!)
I noted that CREDENTIALS.issue_date is defined as a KRB4_32 type,
so if I change them both like this:
KRB5_DLLIMP int KRB5_CALLCONV krb_save_credentials
PROTOTYPE((char FAR *service, char FAR *instance, char FAR *realm,
C_Block session, int lifetime, int kvno,
KTEXT ticket, KRB4_32 issue_date));
^^^^^^^
(4 bytes everywhere)
and change the end of tf_save_cred() from this:
if (write(fd, (char *) &issue_date, sizeof(long))
!= sizeof(long))
to this:
if (write(fd, (char *) &issue_date, sizeof(issue_date))
!= sizeof(issue_date))
and recompile, then everything seems to work together properly.
Is this correct?
John
Show quoted text
_______________________________________________
krbdev mailing list krbdev@mit.edu
http://mailman.mit.edu/mailman/listinfo/krbdev
krbdev mailing list krbdev@mit.edu
http://mailman.mit.edu/mailman/listinfo/krbdev