/*
 * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the Apache License 2.0 (the \"License\").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 */



/* Machine generated by util/perl/OpenSSL/paramnames.pm */
#ifndef srtp_set_ctx_params_list
static const OSSL_PARAM srtp_set_ctx_params_list[] = {
    OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0),
    OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_CIPHER, NULL, 0),
    OSSL_PARAM_octet_string(OSSL_KDF_PARAM_KEY, NULL, 0),
    OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SALT, NULL, 0),
    OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SRTPKDF_INDEX, NULL, 0),
    OSSL_PARAM_uint32(OSSL_KDF_PARAM_SRTPKDF_KDR, NULL),
    OSSL_PARAM_uint32(OSSL_KDF_PARAM_LABEL, NULL),
    OSSL_PARAM_END
};
#endif

#ifndef srtp_set_ctx_params_st
struct srtp_set_ctx_params_st {
    OSSL_PARAM *cipher;
    OSSL_PARAM *index;
    OSSL_PARAM *kdr;
    OSSL_PARAM *key;
    OSSL_PARAM *label;
    OSSL_PARAM *propq;
    OSSL_PARAM *salt;
};
#endif

#ifndef srtp_set_ctx_params_decoder
static int srtp_set_ctx_params_decoder
    (const OSSL_PARAM *p, struct srtp_set_ctx_params_st *r)
{
    const char *s;

    memset(r, 0, sizeof(*r));
    if (p != NULL)
        for (; (s = p->key) != NULL; p++)
            switch(s[0]) {
            default:
                break;
            case 'c':
                if (ossl_likely(strcmp("ipher", s + 1) == 0)) {
                    /* OSSL_KDF_PARAM_CIPHER */
                    if (ossl_unlikely(r->cipher != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->cipher = (OSSL_PARAM *)p;
                }
                break;
            case 'i':
                if (ossl_likely(strcmp("ndex", s + 1) == 0)) {
                    /* OSSL_KDF_PARAM_SRTPKDF_INDEX */
                    if (ossl_unlikely(r->index != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->index = (OSSL_PARAM *)p;
                }
                break;
            case 'k':
                switch(s[1]) {
                default:
                    break;
                case 'd':
                    if (ossl_likely(strcmp("r", s + 2) == 0)) {
                        /* OSSL_KDF_PARAM_SRTPKDF_KDR */
                        if (ossl_unlikely(r->kdr != NULL)) {
                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                           "param %s is repeated", s);
                            return 0;
                        }
                        r->kdr = (OSSL_PARAM *)p;
                    }
                    break;
                case 'e':
                    if (ossl_likely(strcmp("y", s + 2) == 0)) {
                        /* OSSL_KDF_PARAM_KEY */
                        if (ossl_unlikely(r->key != NULL)) {
                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                           "param %s is repeated", s);
                            return 0;
                        }
                        r->key = (OSSL_PARAM *)p;
                    }
                }
                break;
            case 'l':
                if (ossl_likely(strcmp("abel", s + 1) == 0)) {
                    /* OSSL_KDF_PARAM_LABEL */
                    if (ossl_unlikely(r->label != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->label = (OSSL_PARAM *)p;
                }
                break;
            case 'p':
                if (ossl_likely(strcmp("roperties", s + 1) == 0)) {
                    /* OSSL_KDF_PARAM_PROPERTIES */
                    if (ossl_unlikely(r->propq != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->propq = (OSSL_PARAM *)p;
                }
                break;
            case 's':
                if (ossl_likely(strcmp("alt", s + 1) == 0)) {
                    /* OSSL_KDF_PARAM_SALT */
                    if (ossl_unlikely(r->salt != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->salt = (OSSL_PARAM *)p;
                }
            }
    return 1;
}
#endif
/* End of machine generated */

/* Machine generated by util/perl/OpenSSL/paramnames.pm */
#ifndef srtp_get_ctx_params_list
static const OSSL_PARAM srtp_get_ctx_params_list[] = {
    OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL),
    OSSL_PARAM_END
};
#endif

#ifndef srtp_get_ctx_params_st
struct srtp_get_ctx_params_st {
    OSSL_PARAM *size;
};
#endif

#ifndef srtp_get_ctx_params_decoder
static int srtp_get_ctx_params_decoder
    (const OSSL_PARAM *p, struct srtp_get_ctx_params_st *r)
{
    const char *s;

    memset(r, 0, sizeof(*r));
    if (p != NULL)
        for (; (s = p->key) != NULL; p++)
            if (ossl_likely(strcmp("size", s + 0) == 0)) {
                /* OSSL_KDF_PARAM_SIZE */
                if (ossl_unlikely(r->size != NULL)) {
                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                   "param %s is repeated", s);
                    return 0;
                }
                r->size = (OSSL_PARAM *)p;
            }
    return 1;
}
#endif
/* End of machine generated */
