int tls1_set_sigalgs(CERT *c, const int *psig_nids, size_t salglen, int client)
{
    unsigned int *sigalgs, *sptr;
    size_t i;
    if (salglen & 1)
        return 0;
    sigalgs = OPENSSL_malloc(salglen * sizeof(*sigalgs));
    if (sigalgs == NULL)
        return 0;
    for (i = 0, sptr = sigalgs; i < salglen; i += 2) {
        size_t j;
        SIGALG_LOOKUP *curr;
        int md_id = *psig_nids++;
        int sig_id = *psig_nids++;
        for (j = 0, curr = sigalg_lookup_tbl; j < OSSL_NELEM(sigalg_lookup_tbl);
             j++, curr++) {
            if (SIGID_IS_PSS(curr->sigalg))
                continue;
            if (curr->hash == md_id && curr->sig == sig_id) {
                *sptr++ = curr->sigalg;
                break;
            }
        }
        if (j == OSSL_NELEM(sigalg_lookup_tbl))
            goto err;
    }
    if (client) {
        OPENSSL_free(c->client_sigalgs);
        c->client_sigalgs = sigalgs;
        c->client_sigalgslen = salglen;
    } else {
        OPENSSL_free(c->conf_sigalgs);
        c->conf_sigalgs = sigalgs;
        c->conf_sigalgslen = salglen;
    }
    return 1;
 err:
    OPENSSL_free(sigalgs);
    return 0;
}
["int tls1_set_sigalgs_list(CERT *c, const char *str, int client)\n{\n    sig_cb_st sig;\n    sig.sigalgcnt = 0;\n    if (!CONF_parse_list(str, ':', 1, sig_cb, &sig))\n        return 0;\n    if (c == NULL)\n        return 1;\n    return tls1_set_sigalgs(c, sig.sigalgs, sig.sigalgcnt, client);\n}", 'int tls1_set_sigalgs(CERT *c, const int *psig_nids, size_t salglen, int client)\n{\n    unsigned int *sigalgs, *sptr;\n    size_t i;\n    if (salglen & 1)\n        return 0;\n    sigalgs = OPENSSL_malloc(salglen * sizeof(*sigalgs));\n    if (sigalgs == NULL)\n        return 0;\n    for (i = 0, sptr = sigalgs; i < salglen; i += 2) {\n        size_t j;\n        SIGALG_LOOKUP *curr;\n        int md_id = *psig_nids++;\n        int sig_id = *psig_nids++;\n        for (j = 0, curr = sigalg_lookup_tbl; j < OSSL_NELEM(sigalg_lookup_tbl);\n             j++, curr++) {\n            if (SIGID_IS_PSS(curr->sigalg))\n                continue;\n            if (curr->hash == md_id && curr->sig == sig_id) {\n                *sptr++ = curr->sigalg;\n                break;\n            }\n        }\n        if (j == OSSL_NELEM(sigalg_lookup_tbl))\n            goto err;\n    }\n    if (client) {\n        OPENSSL_free(c->client_sigalgs);\n        c->client_sigalgs = sigalgs;\n        c->client_sigalgslen = salglen;\n    } else {\n        OPENSSL_free(c->conf_sigalgs);\n        c->conf_sigalgs = sigalgs;\n        c->conf_sigalgslen = salglen;\n    }\n    return 1;\n err:\n    OPENSSL_free(sigalgs);\n    return 0;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)\n        return malloc_impl(num, file, line);\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    osslargused(file); osslargused(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}']