asn1_k_decode.c (asn1_decode_krb5_flags): Make the function
authorTheodore Tso <tytso@mit.edu>
Wed, 19 Apr 1995 21:49:57 +0000 (21:49 +0000)
committerTheodore Tso <tytso@mit.edu>
Wed, 19 Apr 1995 21:49:57 +0000 (21:49 +0000)
commit6441ad46e842e50e618843af0652fd5d6f24b565
tree1ca794cb4706bca4cad097b041c45262d17c4995
parent48a313c6b36d668a4aebc6c2950258d3b973a6ec
asn1_k_decode.c (asn1_decode_krb5_flags): Make the function
accept bit strings which are less 32 bits long.
(RFC-1510 makes no guarantee that the length of the bit
string must be 32 bits long; the old code required that
the length of the bit string must be exactly 32 bits.)

Flip the bits with respect to a 32-bit boundary, since
that's what the old ASN.1 glue code did.  (The values in
fieldbits.h are encoded backwards, for no good reason.)
If BACKWARDS_BITMASK_COMPAT is defined, then only flip the
bits if the high 16 bits are clear and there are some bits set
in the low 16 bits.  This preserves interoperabilty with
the old beta 4 distribution, which sent the bit string
without flipping them around.

asn1_k_encode.c (asn1_encode_krb5_flags): Flip the bits with
respect to a 32-bit boundary, since that's what the
old ASN.1 glue code did.  (The values in fieldbits.h
are encoded backwards, for no good reason.)

krb_asn1.h: #define BACKWARDS_BITMASK_COMPAT.  Add extern
declaration for asn1_swbits, which is needed for the
bit reversing code.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5380 dc483132-0cff-0310-8789-dd5450dbe970
src/lib/krb5/asn.1/ChangeLog
src/lib/krb5/asn.1/asn1_k_decode.c
src/lib/krb5/asn.1/asn1_k_encode.c
src/lib/krb5/asn.1/krbasn1.h