Lines Matching defs:new
791 sni_entry *cur = NULL, *new = NULL;
805 if ((new = mbedtls_calloc(1, sizeof(sni_entry))) == NULL) {
810 GET_ITEM(new->name);
819 if ((new->cert = mbedtls_calloc(1, sizeof(mbedtls_x509_crt))) == NULL ||
820 (new->key = mbedtls_calloc(1, sizeof(mbedtls_pk_context))) == NULL) {
824 mbedtls_x509_crt_init(new->cert);
825 mbedtls_pk_init(new->key);
827 if (mbedtls_x509_crt_parse_file(new->cert, crt_file) != 0 ||
828 mbedtls_pk_parse_keyfile(new->key, key_file, "", rng_get, &rng) != 0) {
833 if ((new->ca = mbedtls_calloc(1, sizeof(mbedtls_x509_crt))) == NULL) {
837 mbedtls_x509_crt_init(new->ca);
839 if (mbedtls_x509_crt_parse_file(new->ca, ca_file) != 0) {
846 if ((new->crl = mbedtls_calloc(1, sizeof(mbedtls_x509_crl))) == NULL) {
850 mbedtls_x509_crl_init(new->crl);
852 if (mbedtls_x509_crl_parse_file(new->crl, crl_file) != 0) {
859 if ((new->authmode = get_auth_mode(auth_str)) < 0) {
863 new->authmode = DFL_AUTH_MODE;
866 new->next = cur;
867 cur = new;
873 sni_free(new);
990 psk_entry *cur = NULL, *new = NULL;
1001 if ((new = mbedtls_calloc(1, sizeof(psk_entry))) == NULL) {
1005 memset(new, 0, sizeof(psk_entry));
1007 GET_ITEM(new->name);
1010 if (mbedtls_test_unhexify(new->key, MBEDTLS_PSK_MAX_LEN,
1011 key_hex, &new->key_len) != 0) {
1015 new->next = cur;
1016 cur = new;
1022 psk_free(new);
4115 * establishing a new connection and this case.