Set session key only if we are returned a session key.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20681 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
		| @@ -186,27 +186,33 @@ _gss_ntlm_accept_sec_context | ||||
| 	ret = krb5_data_copy(&ctx->sessionkey,  | ||||
| 			     session.data, session.length); | ||||
| 	if (ret) {	 | ||||
| 	    _gss_ntlm_delete_sec_context(minor_status, context_handle, NULL); | ||||
| 	    _gss_ntlm_delete_sec_context(minor_status, | ||||
| 					 context_handle, NULL); | ||||
| 	    *minor_status = ret; | ||||
| 	    return GSS_S_FAILURE; | ||||
| 	} | ||||
|  | ||||
| 	ctx->status |= STATUS_SESSIONKEY;  | ||||
| 	 | ||||
| 	if (ctx->flags & NTLM_NEG_NTLM2_SESSION) { | ||||
| 	    _gss_ntlm_set_key(&ctx->u.v2.send, 1, (ctx->flags & NTLM_NEG_KEYEX), | ||||
| 			      ctx->sessionkey.data, | ||||
| 			      ctx->sessionkey.length); | ||||
| 	    _gss_ntlm_set_key(&ctx->u.v2.recv, 0, (ctx->flags & NTLM_NEG_KEYEX), | ||||
| 			      ctx->sessionkey.data, | ||||
| 			      ctx->sessionkey.length); | ||||
| 	} else { | ||||
| 	    RC4_set_key(&ctx->u.v1.crypto_send.key,  | ||||
| 			ctx->sessionkey.length, | ||||
| 			ctx->sessionkey.data); | ||||
| 	    RC4_set_key(&ctx->u.v1.crypto_recv.key,  | ||||
| 			ctx->sessionkey.length, | ||||
| 			ctx->sessionkey.data); | ||||
| 	if (session.length != 0) { | ||||
|  | ||||
| 	    ctx->status |= STATUS_SESSIONKEY;  | ||||
|  | ||||
| 	    if (ctx->flags & NTLM_NEG_NTLM2_SESSION) { | ||||
| 		_gss_ntlm_set_key(&ctx->u.v2.send, 1, | ||||
| 				  (ctx->flags & NTLM_NEG_KEYEX), | ||||
| 				  ctx->sessionkey.data, | ||||
| 				  ctx->sessionkey.length); | ||||
| 		_gss_ntlm_set_key(&ctx->u.v2.recv, 0, | ||||
| 				  (ctx->flags & NTLM_NEG_KEYEX), | ||||
| 				  ctx->sessionkey.data, | ||||
| 				  ctx->sessionkey.length); | ||||
| 	    } else { | ||||
| 		RC4_set_key(&ctx->u.v1.crypto_send.key,  | ||||
| 			    ctx->sessionkey.length, | ||||
| 			    ctx->sessionkey.data); | ||||
| 		RC4_set_key(&ctx->u.v1.crypto_recv.key,  | ||||
| 			    ctx->sessionkey.length, | ||||
| 			    ctx->sessionkey.data); | ||||
| 	    } | ||||
| 	} | ||||
|  | ||||
| 	if (mech_type) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Love Hörnquist Åstrand
					Love Hörnquist Åstrand