[MOD] Use specific SHA1/256 abstraction functions

This commit is contained in:
LDA 2024-08-19 16:40:30 +02:00
commit 4c158ea186
9 changed files with 80 additions and 22 deletions

View file

@ -166,7 +166,6 @@ ServerHasXEP421(ParseeData *data, char *from)
static char *
ScrambleOID(ParseeData *data, char *opaque_oid)
{
unsigned char *raw;
char *sha, *mxid;
const ParseeConfig *c = data->config;
if (!opaque_oid)
@ -175,9 +174,7 @@ ScrambleOID(ParseeData *data, char *opaque_oid)
}
/* Turns this into a 128-byte long, Matrix-safe value. */
raw = Sha256(opaque_oid);
sha = ShaToHex(raw);
Free(raw);
sha = ParseeSHA256(opaque_oid);
/* TODO: Either mark this specially, or drop Parsee JID flags
* altogether before any 1.0.0 */

View file

@ -165,7 +165,7 @@ end_error:
room = ParseeFindDMRoom(args, to, from);
data = body ? ArrayGet(body->children, 0) : NULL;
/* TODO: CLEAN THAT UP */
/* TODO: CLEAN THAT UP INTO A CREATEDM FUNCTION */
mroom_id = ParseeGetBridgedRoom(args, stanza);
if (!mroom_id && !room && !XMPPIsParseeStanza(stanza) &&
to && *to == '@')