"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/md_util.c" between
mod_md-2.4.2.tar.gz and mod_md-2.4.4.tar.gz

About: mod_md is an Apache module that adds Let's Encrypt (ACME) support.

md_util.c  (mod_md-2.4.2):md_util.c  (mod_md-2.4.4)
skipping to change at line 79 skipping to change at line 79
va_start(ap, p); va_start(ap, p);
rv = pool_vado(cb, baton, p, ap); rv = pool_vado(cb, baton, p, ap);
va_end(ap); va_end(ap);
return rv; return rv;
} }
/******************************************************************************* *******************/ /******************************************************************************* *******************/
/* data chunks */ /* data chunks */
md_data_t *md_data_create(apr_pool_t *p, const char *data, apr_size_t len) void md_data_pinit(md_data_t *d, apr_size_t len, apr_pool_t *p)
{
md_data_null(d);
d->data = apr_pcalloc(p, len);
d->len = len;
}
md_data_t *md_data_pmake(apr_size_t len, apr_pool_t *p)
{ {
md_data_t *d; md_data_t *d;
d = apr_palloc(p, sizeof(*d)); d = apr_palloc(p, sizeof(*d));
d->len = len; md_data_pinit(d, len, p);
d->data = len? apr_pstrndup(p, data, len) : NULL;
return d; return d;
} }
md_data_t *md_data_make(apr_pool_t *p, apr_size_t len) void md_data_init(md_data_t *d, const char *data, apr_size_t len)
{
md_data_null(d);
d->len = len;
d->data = data;
}
void md_data_init_str(md_data_t *d, const char *str)
{
md_data_init(d, str, strlen(str));
}
void md_data_null(md_data_t *d)
{
memset(d, 0, sizeof(*d));
}
void md_data_clear(md_data_t *d)
{
if (d) {
if (d->data && d->free_data) d->free_data((void*)d->data);
memset(d, 0, sizeof(*d));
}
}
md_data_t *md_data_make_pcopy(apr_pool_t *p, const char *data, apr_size_t len)
{ {
md_data_t *d; md_data_t *d;
d = apr_palloc(p, sizeof(*d)); d = apr_palloc(p, sizeof(*d));
d->len = len; d->len = len;
d->data = apr_pcalloc(p, len); d->data = len? apr_pmemdup(p, data, len) : NULL;
return d; return d;
} }
apr_status_t md_data_assign_copy(md_data_t *dest, const char *src, apr_size_t sr
c_len)
{
md_data_clear(dest);
if (src && src_len) {
dest->data = malloc(src_len);
if (!dest->data) return APR_ENOMEM;
memcpy((void*)dest->data, src, src_len);
dest->len = src_len;
dest->free_data = free;
}
return APR_SUCCESS;
}
void md_data_assign_pcopy(md_data_t *dest, const char *src, apr_size_t src_len, apr_pool_t *p) void md_data_assign_pcopy(md_data_t *dest, const char *src, apr_size_t src_len, apr_pool_t *p)
{ {
md_data_clear(dest);
dest->data = (src && src_len)? apr_pmemdup(p, src, src_len) : NULL; dest->data = (src && src_len)? apr_pmemdup(p, src, src_len) : NULL;
dest->len = dest->data? src_len : 0; dest->len = dest->data? src_len : 0;
} }
static const char * const hex_const[] = { static const char * const hex_const[] = {
"00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c" , "0d", "0e", "0f", "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c" , "0d", "0e", "0f",
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c" , "1d", "1e", "1f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c" , "1d", "1e", "1f",
"20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c" , "2d", "2e", "2f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c" , "2d", "2e", "2f",
"30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c" , "3d", "3e", "3f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c" , "3d", "3e", "3f",
"40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c" , "4d", "4e", "4f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c" , "4d", "4e", "4f",
 End of changes. 6 change blocks. 
5 lines changed or deleted 51 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)