--- embedaddon/mpd/src/msoft.c 2012/02/21 23:32:47 1.1 +++ embedaddon/mpd/src/msoft.c 2021/03/17 00:39:23 1.1.1.3 @@ -55,9 +55,9 @@ void LMPasswordHash(const char *password, u_char *hash) { - const u_char *const clear = (u_char *) "KGS!@#$%%"; + const u_char* clear = (const u_char *)"KGS!@#$%%"; u_char up[14]; /* upper case password */ - int k; + unsigned k; memset(&up, 0, sizeof(up)); for (k = 0; k < sizeof(up) && password[k]; k++) @@ -78,7 +78,7 @@ void NTPasswordHash(const char *password, u_char *hash) { u_int16_t unipw[128]; - int unipwLen; + unsigned unipwLen; MD4_CTX md4ctx; const char *s; @@ -107,7 +107,7 @@ NTPasswordHashHash(const u_char *nthash, u_char *hash) MD4_CTX md4ctx; MD4_Init(&md4ctx); - MD4_Update(&md4ctx, (u_char *) nthash, 16); + MD4_Update(&md4ctx, nthash, 16); MD4_Final(hash, &md4ctx); } @@ -164,7 +164,7 @@ ChallengeResponse(const u_char *chal, const char *pwHa static void DesEncrypt(const u_char *clear, u_char *key0, u_char *cypher) { - des_key_schedule ks; + DES_key_schedule ks; u_char key[8]; /* Create DES key */ @@ -177,11 +177,18 @@ DesEncrypt(const u_char *clear, u_char *key0, u_char * key[5] = (key0[4] << 3) | (key0[5] >> 5); key[6] = (key0[5] << 2) | (key0[6] >> 6); key[7] = key0[6] << 1; - des_set_key((des_cblock *) key, ks); + DES_set_key((DES_cblock *) key, &ks); /* Encrypt using key */ - des_ecb_encrypt((des_cblock *) clear, (des_cblock *) cypher, ks, 1); +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcast-qual" +#endif + DES_ecb_encrypt((const_DES_cblock *) clear, (DES_cblock *) cypher, &ks, 1); +#ifdef __clang__ +#pragma clang diagnostic pop +#endif } /*