1
0
Fork 0
forked from fun/fun

Added LibreSSL as an alternative to OpenSSL. Needs more testing! (0.38.16)

This commit is contained in:
Johannes Findeisen 2026-02-19 23:33:00 +01:00
commit 3e0d47a268
35 changed files with 677 additions and 38 deletions

View file

@ -1230,6 +1230,39 @@ static int emit_primary(Bytecode *bc, const char *src, size_t len, size_t *pos)
free(name);
return 1;
}
/* LibreSSL (md5/sha256/sha512/ripemd160) */
if (strcmp(name, "libressl_md5") == 0) {
(*pos)++; /* '(' */
if (!emit_expression(bc, src, len, pos)) { parser_fail(*pos, "libressl_md5 expects (data)"); free(name); return 0; }
if (!consume_char(src, len, pos, ')')) { parser_fail(*pos, "Expected ')' after libressl_md5 arg"); free(name); return 0; }
bytecode_add_instruction(bc, OP_LIBRESSL_MD5, 0);
free(name);
return 1;
}
if (strcmp(name, "libressl_sha256") == 0) {
(*pos)++; /* '(' */
if (!emit_expression(bc, src, len, pos)) { parser_fail(*pos, "libressl_sha256 expects (data)"); free(name); return 0; }
if (!consume_char(src, len, pos, ')')) { parser_fail(*pos, "Expected ')' after libressl_sha256 arg"); free(name); return 0; }
bytecode_add_instruction(bc, OP_LIBRESSL_SHA256, 0);
free(name);
return 1;
}
if (strcmp(name, "libressl_sha512") == 0) {
(*pos)++; /* '(' */
if (!emit_expression(bc, src, len, pos)) { parser_fail(*pos, "libressl_sha512 expects (data)"); free(name); return 0; }
if (!consume_char(src, len, pos, ')')) { parser_fail(*pos, "Expected ')' after libressl_sha512 arg"); free(name); return 0; }
bytecode_add_instruction(bc, OP_LIBRESSL_SHA512, 0);
free(name);
return 1;
}
if (strcmp(name, "libressl_ripemd160") == 0) {
(*pos)++; /* '(' */
if (!emit_expression(bc, src, len, pos)) { parser_fail(*pos, "libressl_ripemd160 expects (data)"); free(name); return 0; }
if (!consume_char(src, len, pos, ')')) { parser_fail(*pos, "Expected ')' after libressl_ripemd160 arg"); free(name); return 0; }
bytecode_add_instruction(bc, OP_LIBRESSL_RIPEMD160, 0);
free(name);
return 1;
}
/* PCSC builtins */
if (strcmp(name, "pcsc_establish") == 0) {
(*pos)++; /* '(' */