cifsencrypt.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. /*
  2. * fs/cifs/cifsencrypt.c
  3. *
  4. * Copyright (C) International Business Machines Corp., 2005,2006
  5. * Author(s): Steve French (sfrench@us.ibm.com)
  6. *
  7. * This library is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU Lesser General Public License as published
  9. * by the Free Software Foundation; either version 2.1 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  15. * the GNU Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public License
  18. * along with this library; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #include <linux/fs.h>
  22. #include <linux/slab.h>
  23. #include "cifspdu.h"
  24. #include "cifsglob.h"
  25. #include "cifs_debug.h"
  26. #include "md5.h"
  27. #include "cifs_unicode.h"
  28. #include "cifsproto.h"
  29. #include "ntlmssp.h"
  30. #include <linux/ctype.h>
  31. #include <linux/random.h>
  32. /* Calculate and return the CIFS signature based on the mac key and SMB PDU */
  33. /* the 16 byte signature must be allocated by the caller */
  34. /* Note we only use the 1st eight bytes */
  35. /* Note that the smb header signature field on input contains the
  36. sequence number before this function is called */
  37. extern void mdfour(unsigned char *out, unsigned char *in, int n);
  38. extern void E_md4hash(const unsigned char *passwd, unsigned char *p16);
  39. extern void SMBencrypt(unsigned char *passwd, const unsigned char *c8,
  40. unsigned char *p24);
  41. static int cifs_calculate_signature(const struct smb_hdr *cifs_pdu,
  42. struct TCP_Server_Info *server, char *signature)
  43. {
  44. int rc = 0;
  45. struct {
  46. struct shash_desc shash;
  47. char ctx[crypto_shash_descsize(server->ntlmssp.md5)];
  48. } sdesc;
  49. if (cifs_pdu == NULL || server == NULL || signature == NULL)
  50. return -EINVAL;
  51. sdesc.shash.tfm = server->ntlmssp.md5;
  52. sdesc.shash.flags = 0x0;
  53. rc = crypto_shash_init(&sdesc.shash);
  54. if (rc) {
  55. cERROR(1, "could not initialize master crypto API hmacmd5\n");
  56. return rc;
  57. }
  58. if (server->secType == RawNTLMSSP)
  59. crypto_shash_update(&sdesc.shash,
  60. server->session_key.data.ntlmv2.key,
  61. CIFS_NTLMV2_SESSKEY_SIZE);
  62. else
  63. crypto_shash_update(&sdesc.shash,
  64. (char *)&server->session_key.data,
  65. server->session_key.len);
  66. crypto_shash_update(&sdesc.shash,
  67. cifs_pdu->Protocol, cifs_pdu->smb_buf_length);
  68. rc = crypto_shash_final(&sdesc.shash, signature);
  69. return 0;
  70. }
  71. int cifs_sign_smb(struct smb_hdr *cifs_pdu, struct TCP_Server_Info *server,
  72. __u32 *pexpected_response_sequence_number)
  73. {
  74. int rc = 0;
  75. char smb_signature[20];
  76. if ((cifs_pdu == NULL) || (server == NULL))
  77. return -EINVAL;
  78. if ((cifs_pdu->Flags2 & SMBFLG2_SECURITY_SIGNATURE) == 0)
  79. return rc;
  80. spin_lock(&GlobalMid_Lock);
  81. cifs_pdu->Signature.Sequence.SequenceNumber =
  82. cpu_to_le32(server->sequence_number);
  83. cifs_pdu->Signature.Sequence.Reserved = 0;
  84. *pexpected_response_sequence_number = server->sequence_number++;
  85. server->sequence_number++;
  86. spin_unlock(&GlobalMid_Lock);
  87. rc = cifs_calculate_signature(cifs_pdu, server, smb_signature);
  88. if (rc)
  89. memset(cifs_pdu->Signature.SecuritySignature, 0, 8);
  90. else
  91. memcpy(cifs_pdu->Signature.SecuritySignature, smb_signature, 8);
  92. return rc;
  93. }
  94. static int cifs_calc_signature2(const struct kvec *iov, int n_vec,
  95. struct TCP_Server_Info *server, char *signature)
  96. {
  97. int i;
  98. int rc = 0;
  99. struct {
  100. struct shash_desc shash;
  101. char ctx[crypto_shash_descsize(server->ntlmssp.md5)];
  102. } sdesc;
  103. if (iov == NULL || server == NULL || signature == NULL)
  104. return -EINVAL;
  105. sdesc.shash.tfm = server->ntlmssp.md5;
  106. sdesc.shash.flags = 0x0;
  107. rc = crypto_shash_init(&sdesc.shash);
  108. if (rc) {
  109. cERROR(1, "could not initialize master crypto API hmacmd5\n");
  110. return rc;
  111. }
  112. if (server->secType == RawNTLMSSP)
  113. crypto_shash_update(&sdesc.shash,
  114. server->session_key.data.ntlmv2.key,
  115. CIFS_NTLMV2_SESSKEY_SIZE);
  116. else
  117. crypto_shash_update(&sdesc.shash,
  118. (char *)&server->session_key.data,
  119. server->session_key.len);
  120. for (i = 0; i < n_vec; i++) {
  121. if (iov[i].iov_len == 0)
  122. continue;
  123. if (iov[i].iov_base == NULL) {
  124. cERROR(1, "null iovec entry");
  125. return -EIO;
  126. }
  127. /* The first entry includes a length field (which does not get
  128. signed that occupies the first 4 bytes before the header */
  129. if (i == 0) {
  130. if (iov[0].iov_len <= 8) /* cmd field at offset 9 */
  131. break; /* nothing to sign or corrupt header */
  132. crypto_shash_update(&sdesc.shash,
  133. iov[i].iov_base + 4, iov[i].iov_len - 4);
  134. } else
  135. crypto_shash_update(&sdesc.shash,
  136. iov[i].iov_base, iov[i].iov_len);
  137. }
  138. rc = crypto_shash_final(&sdesc.shash, signature);
  139. return 0;
  140. }
  141. int cifs_sign_smb2(struct kvec *iov, int n_vec, struct TCP_Server_Info *server,
  142. __u32 *pexpected_response_sequence_number)
  143. {
  144. int rc = 0;
  145. char smb_signature[20];
  146. struct smb_hdr *cifs_pdu = iov[0].iov_base;
  147. if ((cifs_pdu == NULL) || (server == NULL))
  148. return -EINVAL;
  149. if ((cifs_pdu->Flags2 & SMBFLG2_SECURITY_SIGNATURE) == 0)
  150. return rc;
  151. spin_lock(&GlobalMid_Lock);
  152. cifs_pdu->Signature.Sequence.SequenceNumber =
  153. cpu_to_le32(server->sequence_number);
  154. cifs_pdu->Signature.Sequence.Reserved = 0;
  155. *pexpected_response_sequence_number = server->sequence_number++;
  156. server->sequence_number++;
  157. spin_unlock(&GlobalMid_Lock);
  158. rc = cifs_calc_signature2(iov, n_vec, server, smb_signature);
  159. if (rc)
  160. memset(cifs_pdu->Signature.SecuritySignature, 0, 8);
  161. else
  162. memcpy(cifs_pdu->Signature.SecuritySignature, smb_signature, 8);
  163. return rc;
  164. }
  165. int cifs_verify_signature(struct smb_hdr *cifs_pdu,
  166. struct TCP_Server_Info *server,
  167. __u32 expected_sequence_number)
  168. {
  169. int rc;
  170. char server_response_sig[8];
  171. char what_we_think_sig_should_be[20];
  172. if (cifs_pdu == NULL || server == NULL)
  173. return -EINVAL;
  174. if (cifs_pdu->Command == SMB_COM_NEGOTIATE)
  175. return 0;
  176. if (cifs_pdu->Command == SMB_COM_LOCKING_ANDX) {
  177. struct smb_com_lock_req *pSMB =
  178. (struct smb_com_lock_req *)cifs_pdu;
  179. if (pSMB->LockType & LOCKING_ANDX_OPLOCK_RELEASE)
  180. return 0;
  181. }
  182. /* BB what if signatures are supposed to be on for session but
  183. server does not send one? BB */
  184. /* Do not need to verify session setups with signature "BSRSPYL " */
  185. if (memcmp(cifs_pdu->Signature.SecuritySignature, "BSRSPYL ", 8) == 0)
  186. cFYI(1, "dummy signature received for smb command 0x%x",
  187. cifs_pdu->Command);
  188. /* save off the origiginal signature so we can modify the smb and check
  189. its signature against what the server sent */
  190. memcpy(server_response_sig, cifs_pdu->Signature.SecuritySignature, 8);
  191. cifs_pdu->Signature.Sequence.SequenceNumber =
  192. cpu_to_le32(expected_sequence_number);
  193. cifs_pdu->Signature.Sequence.Reserved = 0;
  194. rc = cifs_calculate_signature(cifs_pdu, server,
  195. what_we_think_sig_should_be);
  196. if (rc)
  197. return rc;
  198. /* cifs_dump_mem("what we think it should be: ",
  199. what_we_think_sig_should_be, 16); */
  200. if (memcmp(server_response_sig, what_we_think_sig_should_be, 8))
  201. return -EACCES;
  202. else
  203. return 0;
  204. }
  205. /* We fill in key by putting in 40 byte array which was allocated by caller */
  206. int cifs_calculate_session_key(struct session_key *key, const char *rn,
  207. const char *password)
  208. {
  209. char temp_key[16];
  210. if ((key == NULL) || (rn == NULL))
  211. return -EINVAL;
  212. E_md4hash(password, temp_key);
  213. mdfour(key->data.ntlm, temp_key, 16);
  214. memcpy(key->data.ntlm+16, rn, CIFS_SESS_KEY_SIZE);
  215. key->len = 40;
  216. return 0;
  217. }
  218. #ifdef CONFIG_CIFS_WEAK_PW_HASH
  219. void calc_lanman_hash(const char *password, const char *cryptkey, bool encrypt,
  220. char *lnm_session_key)
  221. {
  222. int i;
  223. char password_with_pad[CIFS_ENCPWD_SIZE];
  224. memset(password_with_pad, 0, CIFS_ENCPWD_SIZE);
  225. if (password)
  226. strncpy(password_with_pad, password, CIFS_ENCPWD_SIZE);
  227. if (!encrypt && global_secflags & CIFSSEC_MAY_PLNTXT) {
  228. memset(lnm_session_key, 0, CIFS_SESS_KEY_SIZE);
  229. memcpy(lnm_session_key, password_with_pad,
  230. CIFS_ENCPWD_SIZE);
  231. return;
  232. }
  233. /* calculate old style session key */
  234. /* calling toupper is less broken than repeatedly
  235. calling nls_toupper would be since that will never
  236. work for UTF8, but neither handles multibyte code pages
  237. but the only alternative would be converting to UCS-16 (Unicode)
  238. (using a routine something like UniStrupr) then
  239. uppercasing and then converting back from Unicode - which
  240. would only worth doing it if we knew it were utf8. Basically
  241. utf8 and other multibyte codepages each need their own strupper
  242. function since a byte at a time will ont work. */
  243. for (i = 0; i < CIFS_ENCPWD_SIZE; i++)
  244. password_with_pad[i] = toupper(password_with_pad[i]);
  245. SMBencrypt(password_with_pad, cryptkey, lnm_session_key);
  246. /* clear password before we return/free memory */
  247. memset(password_with_pad, 0, CIFS_ENCPWD_SIZE);
  248. }
  249. #endif /* CIFS_WEAK_PW_HASH */
  250. static int calc_ntlmv2_hash(struct cifsSesInfo *ses,
  251. const struct nls_table *nls_cp)
  252. {
  253. int rc = 0;
  254. int len;
  255. char nt_hash[CIFS_NTHASH_SIZE];
  256. wchar_t *user;
  257. wchar_t *domain;
  258. wchar_t *server;
  259. struct {
  260. struct shash_desc shash;
  261. char ctx[crypto_shash_descsize(ses->server->ntlmssp.hmacmd5)];
  262. } sdesc;
  263. /* calculate md4 hash of password */
  264. E_md4hash(ses->password, nt_hash);
  265. sdesc.shash.tfm = ses->server->ntlmssp.hmacmd5;
  266. sdesc.shash.flags = 0x0;
  267. crypto_shash_setkey(ses->server->ntlmssp.hmacmd5, nt_hash,
  268. CIFS_NTHASH_SIZE);
  269. rc = crypto_shash_init(&sdesc.shash);
  270. if (rc) {
  271. cERROR(1, "could not initialize master crypto API hmacmd5\n");
  272. return rc;
  273. }
  274. /* convert ses->userName to unicode and uppercase */
  275. len = strlen(ses->userName);
  276. user = kmalloc(2 + (len * 2), GFP_KERNEL);
  277. if (user == NULL)
  278. goto calc_exit_2;
  279. len = cifs_strtoUCS((__le16 *)user, ses->userName, len, nls_cp);
  280. UniStrupr(user);
  281. crypto_shash_update(&sdesc.shash, (char *)user, 2 * len);
  282. /* convert ses->domainName to unicode and uppercase */
  283. if (ses->domainName) {
  284. len = strlen(ses->domainName);
  285. domain = kmalloc(2 + (len * 2), GFP_KERNEL);
  286. if (domain == NULL)
  287. goto calc_exit_1;
  288. len = cifs_strtoUCS((__le16 *)domain, ses->domainName, len,
  289. nls_cp);
  290. /* the following line was removed since it didn't work well
  291. with lower cased domain name that passed as an option.
  292. Maybe converting the domain name earlier makes sense */
  293. /* UniStrupr(domain); */
  294. crypto_shash_update(&sdesc.shash, (char *)domain, 2 * len);
  295. kfree(domain);
  296. } else if (ses->serverName) {
  297. len = strlen(ses->serverName);
  298. server = kmalloc(2 + (len * 2), GFP_KERNEL);
  299. if (server == NULL)
  300. goto calc_exit_1;
  301. len = cifs_strtoUCS((__le16 *)server, ses->serverName, len,
  302. nls_cp);
  303. /* the following line was removed since it didn't work well
  304. with lower cased domain name that passed as an option.
  305. Maybe converting the domain name earlier makes sense */
  306. /* UniStrupr(domain); */
  307. crypto_shash_update(&sdesc.shash, (char *)server, 2 * len);
  308. kfree(server);
  309. }
  310. calc_exit_1:
  311. kfree(user);
  312. calc_exit_2:
  313. /* BB FIXME what about bytes 24 through 40 of the signing key?
  314. compare with the NTLM example */
  315. rc = crypto_shash_final(&sdesc.shash, ses->server->ntlmv2_hash);
  316. return rc;
  317. }
  318. static int
  319. find_domain_name(struct cifsSesInfo *ses)
  320. {
  321. int rc = 0;
  322. unsigned int attrsize;
  323. unsigned int type;
  324. unsigned char *blobptr;
  325. struct ntlmssp2_name *attrptr;
  326. if (ses->server->tiblob) {
  327. blobptr = ses->server->tiblob;
  328. attrptr = (struct ntlmssp2_name *) blobptr;
  329. while ((type = attrptr->type) != 0) {
  330. blobptr += 2; /* advance attr type */
  331. attrsize = attrptr->length;
  332. blobptr += 2; /* advance attr size */
  333. if (type == NTLMSSP_AV_NB_DOMAIN_NAME) {
  334. if (!ses->domainName) {
  335. ses->domainName =
  336. kmalloc(attrptr->length + 1,
  337. GFP_KERNEL);
  338. if (!ses->domainName)
  339. return -ENOMEM;
  340. cifs_from_ucs2(ses->domainName,
  341. (__le16 *)blobptr,
  342. attrptr->length,
  343. attrptr->length,
  344. load_nls_default(), false);
  345. }
  346. }
  347. blobptr += attrsize; /* advance attr value */
  348. attrptr = (struct ntlmssp2_name *) blobptr;
  349. }
  350. } else {
  351. ses->server->tilen = 2 * sizeof(struct ntlmssp2_name);
  352. ses->server->tiblob = kmalloc(ses->server->tilen, GFP_KERNEL);
  353. if (!ses->server->tiblob) {
  354. ses->server->tilen = 0;
  355. cERROR(1, "Challenge target info allocation failure");
  356. return -ENOMEM;
  357. }
  358. memset(ses->server->tiblob, 0x0, ses->server->tilen);
  359. attrptr = (struct ntlmssp2_name *) ses->server->tiblob;
  360. attrptr->type = cpu_to_le16(NTLMSSP_DOMAIN_TYPE);
  361. }
  362. return rc;
  363. }
  364. static int
  365. CalcNTLMv2_response(const struct TCP_Server_Info *server,
  366. char *v2_session_response)
  367. {
  368. int rc;
  369. struct {
  370. struct shash_desc shash;
  371. char ctx[crypto_shash_descsize(server->ntlmssp.hmacmd5)];
  372. } sdesc;
  373. sdesc.shash.tfm = server->ntlmssp.hmacmd5;
  374. sdesc.shash.flags = 0x0;
  375. crypto_shash_setkey(server->ntlmssp.hmacmd5, server->ntlmv2_hash,
  376. CIFS_HMAC_MD5_HASH_SIZE);
  377. rc = crypto_shash_init(&sdesc.shash);
  378. if (rc) {
  379. cERROR(1, "could not initialize master crypto API hmacmd5\n");
  380. return rc;
  381. }
  382. memcpy(v2_session_response + CIFS_SERVER_CHALLENGE_SIZE,
  383. server->cryptKey, CIFS_SERVER_CHALLENGE_SIZE);
  384. crypto_shash_update(&sdesc.shash,
  385. v2_session_response + CIFS_SERVER_CHALLENGE_SIZE,
  386. sizeof(struct ntlmv2_resp) - CIFS_SERVER_CHALLENGE_SIZE);
  387. if (server->tilen)
  388. crypto_shash_update(&sdesc.shash,
  389. server->tiblob, server->tilen);
  390. rc = crypto_shash_final(&sdesc.shash, v2_session_response);
  391. return rc;
  392. }
  393. int
  394. setup_ntlmv2_rsp(struct cifsSesInfo *ses, char *resp_buf,
  395. const struct nls_table *nls_cp)
  396. {
  397. int rc = 0;
  398. struct ntlmv2_resp *buf = (struct ntlmv2_resp *)resp_buf;
  399. struct {
  400. struct shash_desc shash;
  401. char ctx[crypto_shash_descsize(ses->server->ntlmssp.hmacmd5)];
  402. } sdesc;
  403. buf->blob_signature = cpu_to_le32(0x00000101);
  404. buf->reserved = 0;
  405. buf->time = cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME));
  406. get_random_bytes(&buf->client_chal, sizeof(buf->client_chal));
  407. buf->reserved2 = 0;
  408. if (!ses->domainName) {
  409. rc = find_domain_name(ses);
  410. if (rc) {
  411. cERROR(1, "could not get domain/server name rc %d", rc);
  412. return rc;
  413. }
  414. }
  415. /* calculate buf->ntlmv2_hash */
  416. rc = calc_ntlmv2_hash(ses, nls_cp);
  417. if (rc) {
  418. cERROR(1, "could not get v2 hash rc %d", rc);
  419. return rc;
  420. }
  421. rc = CalcNTLMv2_response(ses->server, resp_buf);
  422. if (rc) {
  423. cERROR(1, "could not get v2 hash rc %d", rc);
  424. return rc;
  425. }
  426. crypto_shash_setkey(ses->server->ntlmssp.hmacmd5,
  427. ses->server->ntlmv2_hash, CIFS_HMAC_MD5_HASH_SIZE);
  428. sdesc.shash.tfm = ses->server->ntlmssp.hmacmd5;
  429. sdesc.shash.flags = 0x0;
  430. rc = crypto_shash_init(&sdesc.shash);
  431. if (rc) {
  432. cERROR(1, "could not initialize master crypto API hmacmd5\n");
  433. return rc;
  434. }
  435. crypto_shash_update(&sdesc.shash, resp_buf, CIFS_HMAC_MD5_HASH_SIZE);
  436. rc = crypto_shash_final(&sdesc.shash,
  437. ses->server->session_key.data.ntlmv2.key);
  438. memcpy(&ses->server->session_key.data.ntlmv2.resp, resp_buf,
  439. sizeof(struct ntlmv2_resp));
  440. ses->server->session_key.len = 16 + sizeof(struct ntlmv2_resp);
  441. return rc;
  442. }
  443. int
  444. calc_seckey(struct TCP_Server_Info *server)
  445. {
  446. int rc;
  447. unsigned char sec_key[CIFS_NTLMV2_SESSKEY_SIZE];
  448. struct crypto_blkcipher *tfm_arc4;
  449. struct scatterlist sgin, sgout;
  450. struct blkcipher_desc desc;
  451. get_random_bytes(sec_key, CIFS_NTLMV2_SESSKEY_SIZE);
  452. tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)",
  453. 0, CRYPTO_ALG_ASYNC);
  454. if (!tfm_arc4 || IS_ERR(tfm_arc4)) {
  455. cERROR(1, "could not allocate " "master crypto API arc4\n");
  456. return 1;
  457. }
  458. crypto_blkcipher_setkey(tfm_arc4,
  459. server->session_key.data.ntlmv2.key, CIFS_CPHTXT_SIZE);
  460. sg_init_one(&sgin, sec_key, CIFS_CPHTXT_SIZE);
  461. sg_init_one(&sgout, server->ntlmssp.ciphertext, CIFS_CPHTXT_SIZE);
  462. rc = crypto_blkcipher_encrypt(&desc, &sgout, &sgin, CIFS_CPHTXT_SIZE);
  463. if (!rc)
  464. memcpy(server->session_key.data.ntlmv2.key,
  465. sec_key, CIFS_NTLMV2_SESSKEY_SIZE);
  466. crypto_free_blkcipher(tfm_arc4);
  467. return 0;
  468. }
  469. void
  470. cifs_crypto_shash_release(struct TCP_Server_Info *server)
  471. {
  472. if (server->ntlmssp.md5)
  473. crypto_free_shash(server->ntlmssp.md5);
  474. if (server->ntlmssp.hmacmd5)
  475. crypto_free_shash(server->ntlmssp.hmacmd5);
  476. }
  477. int
  478. cifs_crypto_shash_allocate(struct TCP_Server_Info *server)
  479. {
  480. server->ntlmssp.hmacmd5 = crypto_alloc_shash("hmac(md5)", 0, 0);
  481. if (!server->ntlmssp.hmacmd5 ||
  482. IS_ERR(server->ntlmssp.hmacmd5)) {
  483. cERROR(1, "could not allocate master crypto API hmacmd5\n");
  484. return 1;
  485. }
  486. server->ntlmssp.md5 = crypto_alloc_shash("md5", 0, 0);
  487. if (!server->ntlmssp.md5 || IS_ERR(server->ntlmssp.md5)) {
  488. crypto_free_shash(server->ntlmssp.hmacmd5);
  489. cERROR(1, "could not allocate master crypto API md5\n");
  490. return 1;
  491. }
  492. return 0;
  493. }