(parse_key_set): handle error case better
(hdb_generate_key_set): return better error git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17220 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
		| @@ -112,23 +112,19 @@ parse_key_set(krb5_context context, const char *key, | |||||||
| 	    if(strcmp(buf[i], "des") == 0) { | 	    if(strcmp(buf[i], "des") == 0) { | ||||||
| 		enctypes = all_etypes; | 		enctypes = all_etypes; | ||||||
| 		num_enctypes = 3; | 		num_enctypes = 3; | ||||||
| 		continue; |  | ||||||
| 	    } else if(strcmp(buf[i], "des3") == 0) { | 	    } else if(strcmp(buf[i], "des3") == 0) { | ||||||
| 		e = ETYPE_DES3_CBC_SHA1; | 		e = ETYPE_DES3_CBC_SHA1; | ||||||
| 		enctypes = &e; | 		enctypes = &e; | ||||||
| 		num_enctypes = 1; | 		num_enctypes = 1; | ||||||
| 		continue; |  | ||||||
| 	    } else { | 	    } else { | ||||||
| 		ret = krb5_string_to_enctype(context, buf[i], &e); | 		ret = krb5_string_to_enctype(context, buf[i], &e); | ||||||
| 		if (ret == 0) { | 		if (ret == 0) { | ||||||
| 		    enctypes = &e; | 		    enctypes = &e; | ||||||
| 		    num_enctypes = 1; | 		    num_enctypes = 1; | ||||||
| 		    continue; | 		} else | ||||||
| 		} | 		    return ret; | ||||||
| 	    } | 	    } | ||||||
| 	} | 	} else if(salt->salttype == 0) { | ||||||
|  |  | ||||||
| 	if(salt->salttype == 0) { |  | ||||||
| 	    /* interpret string as a salt specifier, if no etype | 	    /* interpret string as a salt specifier, if no etype | ||||||
| 	       is set, this sets default values */ | 	       is set, this sets default values */ | ||||||
| 	    /* XXX should perhaps use string_to_salttype, but that | 	    /* XXX should perhaps use string_to_salttype, but that | ||||||
| @@ -152,7 +148,7 @@ parse_key_set(krb5_context context, const char *key, | |||||||
| 	       v4 compat, and a cell name for afs compat */ | 	       v4 compat, and a cell name for afs compat */ | ||||||
| 	    salt->saltvalue.data = strdup(buf[i]); | 	    salt->saltvalue.data = strdup(buf[i]); | ||||||
| 	    if (salt->saltvalue.data == NULL) { | 	    if (salt->saltvalue.data == NULL) { | ||||||
| 		krb5_set_error_string(context, "malloc out of memory"); | 		krb5_set_error_string(context, "out of memory"); | ||||||
| 		return ENOMEM; | 		return ENOMEM; | ||||||
| 	    } | 	    } | ||||||
| 	    salt->saltvalue.length = strlen(buf[i]); | 	    salt->saltvalue.length = strlen(buf[i]); | ||||||
| @@ -297,7 +293,7 @@ hdb_generate_key_set(krb5_context context, krb5_principal principal, | |||||||
| 	ret = parse_key_set(context, p, | 	ret = parse_key_set(context, p, | ||||||
| 			    &enctypes, &num_enctypes, &salt, principal); | 			    &enctypes, &num_enctypes, &salt, principal); | ||||||
| 	if (ret) { | 	if (ret) { | ||||||
| 	    krb5_warnx(context, "bad value for default_keys `%s'", *kp); | 	    krb5_warn(context, ret, "bad value for default_keys `%s'", *kp); | ||||||
| 	    ret = 0; | 	    ret = 0; | ||||||
| 	    continue; | 	    continue; | ||||||
| 	} | 	} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Love Hörnquist Åstrand
					Love Hörnquist Åstrand