FreeBSD/contrib/serf/auth/auth.c
/**
 * base64 encode the authentication data and build an authentication
 * header in this format:
 * [SCHEME] [BASE64 of auth DATA]
 */
base64 encode the authentication data and build an authentication
header in this format:
[SCHEME] [BASE64 of auth DATA]
base64 encode the authentication data and build an authentication header in this format : [ SCHEME ] [ BASE64 of auth DATA ]
void serf__encode_auth_header(const char **header,
                              const char *scheme,
                              const char *data, apr_size_t data_len,
                              apr_pool_t *pool)
{
    apr_size_t encoded_len, scheme_len;
    char *ptr;
    encoded_len = apr_base64_encode_len(data_len);
    scheme_len = strlen(scheme);
    ptr = apr_palloc(pool, encoded_len + scheme_len + 1);
    *header = ptr;
    apr_cpystrn(ptr, scheme, scheme_len + 1);
    ptr += scheme_len;
    *ptr++ = ' ';
    apr_base64_encode(ptr, data, data_len);
}
void serf__encode_auth_header ( const char * * header , const char * scheme , const char * data , apr_size_t data_len , apr_pool_t * pool ) { apr_size_t encoded_len , scheme_len ; char * ptr ; encoded_len = apr_base64_encode_len ( data_len ) ; scheme_len = strlen ( scheme ) ; ptr = apr_palloc ( pool , encoded_len + scheme_len + 1 ) ; * header = ptr ; apr_cpystrn ( ptr , scheme , scheme_len + 1 ) ; ptr += scheme_len ; * ptr ++ = ' ' ; apr_base64_encode ( ptr , data , data_len ) ; }
base64 encode the authentication data and build an authentication
 header in this format:
 [SCHEME] [BASE64 of auth DATA]
base64 encode the authentication data and build an authentication header in this format : [ SCHEME ] [ BASE64 of auth DATA ]