Revert "kdc: Quiet warning in FAST unwrap"
authorNicolas Williams <nico@twosigma.com>
Tue, 10 Jan 2023 04:29:58 +0000 (22:29 -0600)
committerNicolas Williams <nico@twosigma.com>
Tue, 10 Jan 2023 04:30:10 +0000 (22:30 -0600)
This reverts commit a9c0b8f2645d3fc0395a1451a9251253489a88bc.

From Joseph Sutton:

> I found that this commit would result in `KRB5KRB_AP_ERR_BAD_INTEGRITY`
> errors in Samba whenever explicit FAST armor was present. Reverting the
> commit made FAST work again.

> It should be safe to use `tgs_ac` here, since it will always be non-NULL if
> `r->explicit_armor_present` is true. Maybe a local variable
> `explicit_armor_present` (which would be assigned to
> `r->explicit_armor_present` before the function returns successfully) would
> help a static analyser to deduce that its value doesn't change within the
> function, and that `tgs_ac != NULL` still holds.

https://github.com/heimdal/heimdal/commit/a9c0b8f2645d3fc0395a1451a9251253489a88bc#commitcomment-95581208

kdc/fast.c

index efc61aba11322ba58ef5e36afc64f1d4edb8e18a..fd6c166ab8b842c2370487c569303ff3e130e071 100644 (file)
@@ -634,7 +634,7 @@ fast_unwrap_request(astgs_request_t r,
     if (r->explicit_armor_present) {
        ret = _krb5_fast_explicit_armor_key(r->context,
                                            &armorkey,
-                                           ac->remote_subkey,
+                                           tgs_ac->remote_subkey,
                                            &explicit_armorkey,
                                            &r->armor_crypto);
        if (ret)