kadm5_decrypt_key(). This patch prevents the returned keyblock's
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 21 Jul 2008 20:33:53 +0000 (20:33 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 21 Jul 2008 20:33:53 +0000 (20:33 +0000)
enctype from being coerced to the requested 'ktype' if the requested
'ktype' == -1. A ktype of -1 is documented as meaning "to be ignored".

ticket: 5840
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20558 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kadm5/srv/svr_principal.c

index 4fb114f3570a0a26e60a80b5b96051fd1442cf05..1b761413c7cc80ac261ea826794ac549e8ff5273 100644 (file)
@@ -2160,7 +2160,8 @@ kadm5_ret_t kadm5_decrypt_key(void *server_handle,
      * inexact match on the enctype; this behavior will go away when
      * the key storage architecture gets redesigned for 1.3.
      */
-    keyblock->enctype = ktype;
+    if (ktype != -1)
+        keyblock->enctype = ktype;
 
     if (kvnop)
         *kvnop = key_data->key_data_kvno;