From: Ezra Peisach Date: Tue, 30 Oct 2001 18:12:26 +0000 (+0000) Subject: * k5unseal.c: Fix whitespace in copyright message X-Git-Tag: krb5-1.3-alpha1~984 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=75cb88401d83c1722828f24ad739c686be031f2f;p=krb5.git * k5unseal.c: Fix whitespace in copyright message * k5seal.c (make_seal_token_v1): Cleanup code for mic tokens. Essentially revert code to Sam's 10/25 code, with one correction - allocation of data_ptr - use msglen and not tmsglen. Additionally, do not rely on malloc(0) being non-NULL. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13907 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/krb5/ChangeLog b/src/lib/gssapi/krb5/ChangeLog index 61f853aad..5d6982149 100644 --- a/src/lib/gssapi/krb5/ChangeLog +++ b/src/lib/gssapi/krb5/ChangeLog @@ -1,6 +1,16 @@ +2001-10-30 Ezra Peisach + + * k5unseal.c: Fix whitespace in copyright message. + + * k5seal.c (make_seal_token_v1): Cleanup code for mic + tokens. Essentially revert code to Sam's 10/25 code, with one + correction - allocation of data_ptr - use msglen and not tmsglen. + Additionally, do not rely on malloc(0) being non-NULL. + 2001-10-27 Sam Hartman - * k5seal.c (make_seal_token_v1): Use usage 15 only for mic tokens, not for seal tokens without encryption + * k5seal.c (make_seal_token_v1): Use usage 15 only for mic tokens, + not for seal tokens without encryption 2001-10-26 Ezra Peisach diff --git a/src/lib/gssapi/krb5/k5seal.c b/src/lib/gssapi/krb5/k5seal.c index e9d2985d1..6631961a4 100644 --- a/src/lib/gssapi/krb5/k5seal.c +++ b/src/lib/gssapi/krb5/k5seal.c @@ -164,7 +164,7 @@ make_seal_token_v1 (krb5_context context, md5cksum.length = sumlen; - if ((plain = (unsigned char *) xmalloc(msglen)) == NULL) { + if ((plain = (unsigned char *) xmalloc(msglen ? msglen : 1)) == NULL) { xfree(t); return(ENOMEM); } @@ -184,20 +184,17 @@ make_seal_token_v1 (krb5_context context, /* 8 = head of token body as specified by mech spec */ if (! (data_ptr = - (char *) xmalloc(8 + - ((bigend || (toktype != KG_TOK_SEAL_MSG)) - ? text->length : tmsglen)))) { + (char *) xmalloc(8 + (bigend ? text->length : msglen)))) { xfree(plain); xfree(t); return(ENOMEM); } (void) memcpy(data_ptr, ptr-2, 8); - if (bigend || (toktype != KG_TOK_SEAL_MSG)) + if (bigend) (void) memcpy(data_ptr+8, text->value, text->length); else (void) memcpy(data_ptr+8, plain, msglen); - plaind.length = 8 + - ((bigend || (toktype != KG_TOK_SEAL_MSG))? text->length : msglen); + plaind.length = 8 + (bigend ? text->length : msglen); plaind.data = data_ptr; code = krb5_c_make_checksum(context, md5cksum.checksum_type, seq, sign_usage, &plaind, &md5cksum); diff --git a/src/lib/gssapi/krb5/k5unseal.c b/src/lib/gssapi/krb5/k5unseal.c index 998068884..ebc8a760f 100644 --- a/src/lib/gssapi/krb5/k5unseal.c +++ b/src/lib/gssapi/krb5/k5unseal.c @@ -1,5 +1,5 @@ /* - * Copyright2001 by the Massachusetts Institute of Technology. + * Copyright 2001 by the Massachusetts Institute of Technology. * Copyright 1993 by OpenVision Technologies, Inc. * * Permission to use, copy, modify, distribute, and sell this software