s4-kerberos Fix kerberos_enctype_bitmap_to_enctypes()
authorAndrew Bartlett <abartlet@samba.org>
Thu, 23 Sep 2010 09:41:20 +0000 (19:41 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 23 Sep 2010 23:25:43 +0000 (09:25 +1000)
The previous code never worked

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
source4/auth/kerberos/kerberos_util.c

index 8b533f6c21cf7c4eba651d40c02cec6e229f0f00..d77a51916fae63f5fb95955654b8f1d6251018a4 100644 (file)
@@ -817,8 +817,9 @@ krb5_error_code kerberos_enctype_bitmap_to_enctypes(TALLOC_CTX *mem_ctx, uint32_
                return ENOMEM;
        }
        for (i=0; i<(8*sizeof(enctype_bitmap)); i++) {
-               if ((1 << i) & enctype_bitmap) {
-                       (*enctypes)[j] = kerberos_enctype_bitmap_to_enctype(enctype_bitmap);
+               uint32_t bit_value = (1 << i) & enctype_bitmap;
+               if (bit_value & enctype_bitmap) {
+                       (*enctypes)[j] = kerberos_enctype_bitmap_to_enctype(bit_value);
                        if (!(*enctypes)[j]) {
                                return KRB5_PROG_ETYPE_NOSUPP;
                        }