skge: default WOL should be magic only (rev2)
[powerpc.git] / fs / cifs / cifsencrypt.c
index a89efaf..fdeda51 100644 (file)
@@ -277,7 +277,8 @@ void calc_lanman_hash(struct cifsSesInfo * ses, char * lnm_session_key)
                return;
 
        memset(password_with_pad, 0, CIFS_ENCPWD_SIZE);
-       strncpy(password_with_pad, ses->password, CIFS_ENCPWD_SIZE);
+       if(ses->password)
+               strncpy(password_with_pad, ses->password, CIFS_ENCPWD_SIZE);
 
        if((ses->server->secMode & SECMODE_PW_ENCRYPT) == 0)
                if(extended_security & CIFSSEC_MAY_PLNTXT) {
@@ -371,8 +372,10 @@ void setup_ntlmv2_rsp(struct cifsSesInfo * ses, char * resp_buf,
        buf->time = cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME));
        get_random_bytes(&buf->client_chal, sizeof(buf->client_chal));
        buf->reserved2 = 0;
-       buf->names[0].type = 0;
+       buf->names[0].type = cpu_to_le16(NTLMSSP_DOMAIN_TYPE);
        buf->names[0].length = 0;
+       buf->names[1].type = 0;
+       buf->names[1].length = 0;
 
        /* calculate buf->ntlmv2_hash */
        rc = calc_ntlmv2_hash(ses, nls_cp);