Changeset 19e80a5 in mod_gnutls for src/gnutls_util.c


Ignore:
Timestamp:
Jan 28, 2019, 2:50:38 PM (20 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
debian/master
Children:
102aa67
Parents:
0931b35 (diff), ea9c699 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Update upstream source from tag 'upstream/0.9.0'

Update to upstream version '0.9.0'
with Debian dir 619b546038886b240d2c8e61ee1a1b13ce0867d7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_util.c

    r0931b35 r19e80a5  
    11/*
    2  *  Copyright 2016-2018 Fiona Klute
     2 *  Copyright 2016-2019 Fiona Klute
    33 *
    44 *  Licensed under the Apache License, Version 2.0 (the "License");
     
    1919#include <apr_strings.h>
    2020#include <gnutls/gnutls.h>
     21
     22
     23
     24/** Compiled version of MGS_DEFAULT_PRIORITY, must be initialized
     25 * using mgs_default_priority_init() in the pre_config hook and
     26 * deinitialized in the matching pool cleanup hook. */
     27static gnutls_priority_t default_prio;
     28
    2129
    2230
     
    148156        /* Default, unconditionally changed in proxy setup functions */
    149157        ctxt->is_proxy = GNUTLS_ENABLED_FALSE;
     158        /* Other default values */
     159        ctxt->sni_name = NULL;
    150160    }
    151161    return ctxt;
    152162}
     163
     164
     165
     166int mgs_default_priority_init()
     167{
     168    return gnutls_priority_init(&default_prio, MGS_DEFAULT_PRIORITY, NULL);
     169}
     170
     171
     172
     173gnutls_priority_t mgs_get_default_prio()
     174{
     175    return default_prio;
     176}
     177
     178
     179
     180void mgs_default_priority_deinit()
     181{
     182    gnutls_priority_deinit(default_prio);
     183}
     184
     185
     186
     187gnutls_datum_t * mgs_str_array_to_datum_array(const apr_array_header_t *src,
     188                                              apr_pool_t *pool,
     189                                              const int min_elements)
     190{
     191    int num = min_elements > src->nelts ? min_elements : src->nelts;
     192    gnutls_datum_t *dest = apr_palloc(pool, num * sizeof(gnutls_datum_t));
     193    for (int i = 0; i < src->nelts; i++)
     194    {
     195        dest[i].data = (void *) APR_ARRAY_IDX(src, i, char *);
     196        dest[i].size = strlen(APR_ARRAY_IDX(src, i, char *));
     197    }
     198    return dest;
     199}
Note: See TracChangeset for help on using the changeset viewer.