Linux NFS development
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH] rpc.gssd: Don't supply the KDC with unsupported encryption types
Date: Tue, 11 Nov 2008 11:40:28 -0500	[thread overview]
Message-ID: <4919B57C.6050104@RedHat.com> (raw)

Hello,

It seems when rpc.gssd initially registers with the KDC, it sends 
a long list of encryption types that are not supported:

      Encryption Types: aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 des3-cbc-sha1 
                        rc4-hmac des-cbc-crc des-cbc-md5 des-cbc-md4 rsa-sha1-cms 
                        rsa-md5-cms des-ede3-cbc-env rc2-cbc-env rsa-env

Now the theory is mounts will hang if the KDC (like a Solaris KDC) returns an unsupported 
encryption type since the client will not know what to do with it. I'm currently
trying to test this theory with people that actually have a working Solaris KDC,
unfortunately I'm not one of those people... 

But to me, it just makes sense that rpc.gssd should only talk about encryption types
it supports. It seems like it would cuts out any and all confusion.The following 
patch does just that. 

comments?

steved.


Author: Steve Dickson <steved@redhat.com>
Date:   Tue Nov 11 11:08:13 EST 2008
	
	When rpc.gssd registers with the KDC, only talk
	about the supported encryption types during the
	initial registration so the KDC will only 
	return supported encryption types.

	Signed-off-by: Steve Dickson <steved@redhat.com>

diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
index 77814bc..7f131c9 100644
--- a/utils/gssd/krb5_util.c
+++ b/utils/gssd/krb5_util.c
@@ -125,6 +125,10 @@
 
 /* Global list of principals/cache file names for machine credentials */
 struct gssd_k5_kt_princ *gssd_k5_kt_princ_list = NULL;
+static krb5_enctype enctypes[] = { ENCTYPE_DES_CBC_CRC,
+				    ENCTYPE_DES_CBC_MD5,
+				    ENCTYPE_DES_CBC_MD4 };
+static int num_enctypes = sizeof(enctypes) / sizeof(enctypes[0]);
 
 /*==========================*/
 /*===  Internal routines ===*/
@@ -309,10 +313,6 @@ limit_krb5_enctypes(struct rpc_gss_sec *sec, uid_t uid)
 	u_int maj_stat, min_stat;
 	gss_cred_id_t credh;
 	gss_OID_set_desc  desired_mechs;
-	krb5_enctype enctypes[] = { ENCTYPE_DES_CBC_CRC,
-				    ENCTYPE_DES_CBC_MD5,
-				    ENCTYPE_DES_CBC_MD4 };
-	int num_enctypes = sizeof(enctypes) / sizeof(enctypes[0]);
 
 	/* We only care about getting a krb5 cred */
 	desired_mechs.count = 1;
@@ -412,6 +412,7 @@ gssd_get_single_krb5_cred(krb5_context context,
 
 	krb5_get_init_creds_opt_init(&options);
 	krb5_get_init_creds_opt_set_address_list(&options, NULL);
+	krb5_get_init_creds_opt_set_etype_list(&options, enctypes, num_enctypes);
 #ifdef TEST_SHORT_LIFETIME
 	/* set a short lifetime (for debugging only!) */
 	printerr(0, "WARNING: Using (debug) short machine cred lifetime!\n");

             reply	other threads:[~2008-11-11 16:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-11 16:40 Steve Dickson [this message]
     [not found] ` <4919B57C.6050104-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2008-11-11 18:33   ` [PATCH] rpc.gssd: Don't supply the KDC with unsupported encryption types Kevin Coffman
     [not found]     ` <4d569c330811111033p70264b87r2463e8cb68b985e9-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-11-11 20:05       ` Steve Dickson
     [not found]         ` <4919E576.6050301-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2008-11-11 21:01           ` Kevin Coffman
     [not found]             ` <4d569c330811111301r5948b77rd6125ffc0b950d88-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-11-25 14:50               ` Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4919B57C.6050104@RedHat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox