Skip Menu |
 

Subject: kadmin change_password -keepold does not work with master key migration
Download (untitled) / with headers
text/plain 1.5KiB
During master key migration, if a principal is re-keyed, the currently
active mkvno is used to encrypt the new keys and the principal's
KRB5_TL_MKVNO is updated to reflect that (unless #7994 applies).
However, if the -keepold flag is used, the principal's key data can
contain a mix of keys encrypted in the old and new master keys.

Steps to reproduce:

1. make testrealm
2. kdb5_util add_mkey -s (enter a new master password twice)
3. kdb5_util use_mkey 2
4. kadmin.local -q 'cpw -keepold -pw pw user'

Now user has a mix of keys encrypted in the old and new master key. It
is hard to immediately see that anything is wrong, because the KDC can
still decrypt the old keys (it iterates over the master key list rather
than respecting the principal's mkvno metadata). Here are two paths
which can demonstrate problems:

5. kdb5_util purge_mkeys -f
6. kadmin.local -q 'xst -norandkey user' (reports "Decrypt integrity
check failed while changing user's key")

This fails because the old master key is gone, so the kvno 1 keys cannot
be decrypted. As a side point, the error message is misleading because
xst -norandkey isn't trying to change the user's key. Alternatively:

5. kdb5_util update_princ_encryption -f (does not update user because it
already lists mkvno 2 in its metadata)
6. kdb5_util add_mkey -s (enter a different new master password twice)
7. kdb5_util update_princ_encryption -f (reports "Decrypt integrity
check failed" on the user principal)

This fails because update_princ_encryption tries to specifically decrypt
key data in the principal's listed master key version, unlike the KDC.
From: ghudson@mit.edu
Subject: git commit

Re-encrypt preserved key data in new master key

When we are preserving old key data in kdb_cpw.c, ensure that it is
encrypted with the same master key as the new key data. This ensures
that the KRB5_TL_MKVNO tl-data on the principal entry applies to all
of the key data, not just some of it.

https://github.com/krb5/krb5/commit/32c9b8f1aa1b348388ed227394cc609e68ed833b
Author: Greg Hudson <ghudson@mit.edu>
Commit: 32c9b8f1aa1b348388ed227394cc609e68ed833b
Branch: master
src/lib/kdb/kdb_cpw.c | 197 +++++++++++++++++++++++++++++++------------------
1 files changed, 126 insertions(+), 71 deletions(-)
From: ghudson@mit.edu
Subject: git commit

Add test case for -keepold mkey re-encryption

https://github.com/krb5/krb5/commit/8ee40f56e6c789a87dc403bf70d524d2b3b21dbf
Author: Greg Hudson <ghudson@mit.edu>
Commit: 8ee40f56e6c789a87dc403bf70d524d2b3b21dbf
Branch: master
src/tests/t_mkey.py | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
From: tlyu@mit.edu
Subject: git commit

Add test case for -keepold mkey re-encryption

(cherry picked from commit 8ee40f56e6c789a87dc403bf70d524d2b3b21dbf)

https://github.com/krb5/krb5/commit/dc46bfbe660b2b057a5892dd95cbf53b6d46e44a
Author: Greg Hudson <ghudson@mit.edu>
Committer: Tom Yu <tlyu@mit.edu>
Commit: dc46bfbe660b2b057a5892dd95cbf53b6d46e44a
Branch: krb5-1.13
src/tests/t_mkey.py | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
From: tlyu@mit.edu
Subject: git commit

Re-encrypt preserved key data in new master key

When we are preserving old key data in kdb_cpw.c, ensure that it is
encrypted with the same master key as the new key data. This ensures
that the KRB5_TL_MKVNO tl-data on the principal entry applies to all
of the key data, not just some of it.

(cherry picked from commit 32c9b8f1aa1b348388ed227394cc609e68ed833b)

https://github.com/krb5/krb5/commit/e56c0064823778affabc60f94e4b59c486448e2c
Author: Greg Hudson <ghudson@mit.edu>
Committer: Tom Yu <tlyu@mit.edu>
Commit: e56c0064823778affabc60f94e4b59c486448e2c
Branch: krb5-1.13
src/lib/kdb/kdb_cpw.c | 197 +++++++++++++++++++++++++++++++------------------
1 files changed, 126 insertions(+), 71 deletions(-)