~ubuntu-branches/ubuntu/hardy/curl/hardy-updates

« back to all changes in this revision

Viewing changes to lib/http_ntlm.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2006-10-30 10:56:48 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20061030105648-uo8q8w9xklb40b4k
Tags: 7.15.5-1ubuntu1
* Merge from debian unstable. Remaining Ubuntu changes:
  - debian/control: Drop libdb4.2 build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
 * KIND, either express or implied.
20
20
 *
21
 
 * $Id: http_ntlm.c,v 1.52 2006-06-07 14:14:05 bagder Exp $
 
21
 * $Id: http_ntlm.c,v 1.53 2006-07-19 21:14:02 yangtse Exp $
22
22
 ***************************************************************************/
23
23
#include "setup.h"
24
24
 
304
304
  DES_cblock key;
305
305
 
306
306
  key[0] = key_56[0];
307
 
  key[1] = ((key_56[0] << 7) & 0xFF) | (key_56[1] >> 1);
308
 
  key[2] = ((key_56[1] << 6) & 0xFF) | (key_56[2] >> 2);
309
 
  key[3] = ((key_56[2] << 5) & 0xFF) | (key_56[3] >> 3);
310
 
  key[4] = ((key_56[3] << 4) & 0xFF) | (key_56[4] >> 4);
311
 
  key[5] = ((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5);
312
 
  key[6] = ((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6);
313
 
  key[7] =  (key_56[6] << 1) & 0xFF;
 
307
  key[1] = (unsigned char)(((key_56[0] << 7) & 0xFF) | (key_56[1] >> 1));
 
308
  key[2] = (unsigned char)(((key_56[1] << 6) & 0xFF) | (key_56[2] >> 2));
 
309
  key[3] = (unsigned char)(((key_56[2] << 5) & 0xFF) | (key_56[3] >> 3));
 
310
  key[4] = (unsigned char)(((key_56[3] << 4) & 0xFF) | (key_56[4] >> 4));
 
311
  key[5] = (unsigned char)(((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5));
 
312
  key[6] = (unsigned char)(((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6));
 
313
  key[7] = (unsigned char) ((key_56[6] << 1) & 0xFF);
314
314
 
315
315
  DES_set_odd_parity(&key);
316
316
  DES_set_key(&key, ks);
357
357
    len = 14;
358
358
 
359
359
  for (i=0; i<len; i++)
360
 
    pw[i] = toupper(password[i]);
 
360
    pw[i] = (unsigned char)toupper(password[i]);
361
361
 
362
362
  for (; i<14; i++)
363
363
    pw[i] = 0;