From: John Carr Date: Sun, 23 Feb 1992 12:16:09 +0000 (+0000) Subject: sizeof(int) -> 4 bytes, because this is intended to be a portable X-Git-Tag: krb5-1.0-beta2~236 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f6babcb6ead6f910d3b3c7c4084b24dcf4ecb28e;p=krb5.git sizeof(int) -> 4 bytes, because this is intended to be a portable binary representation. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2226 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kdb/decrypt_key.c b/src/lib/kdb/decrypt_key.c index 811727b35..764b4eab9 100644 --- a/src/lib/kdb/decrypt_key.c +++ b/src/lib/kdb/decrypt_key.c @@ -61,18 +61,17 @@ krb5_keyblock *out; out->length = 0; return ENOMEM; } + /* copy out the real length count */ - length = ((unsigned char *)in->contents)[0] << 24; - length += ((unsigned char *)in->contents)[1] << 16; - length += ((unsigned char *)in->contents)[2] << 8; - length += ((unsigned char *)in->contents)[3]; - out->length = length; + out->length = (((unsigned char *)in->contents)[0] << 24) + + (((unsigned char *)in->contents)[1] << 16) + + (((unsigned char *)in->contents)[2] << 8) + + ((unsigned char *)in->contents)[3]; - /* remember the contents of the encrypted version has a sizeof(in->length) + /* remember the contents of the encrypted version has a 4 byte integer length of the real embedded key, followed by the encrypted key, so the offset here is needed */ - if (retval = krb5_decrypt((krb5_pointer) (((char *) in->contents) + - sizeof(in->length)), + if (retval = krb5_decrypt((krb5_pointer) ((char *) in->contents + 4), (krb5_pointer) out->contents, in->length-sizeof(in->length), eblock, 0)) { xfree(out->contents);