83ab09ae1df1393ab8139b8764bd59aac703a635
1 #ifndef __UCLIENT_UTILS_H
2 #define __UCLIENT_UTILS_H
6 struct http_digest_data
{
10 const char *auth_hash
; /* H(A1) */
17 static inline int base64_len(int len
)
19 return ((len
+ 2) / 3) * 4;
22 void base64_encode(const void *inbuf
, unsigned int len
, void *out
);
23 void bin_to_hex(char *dest
, const void *buf
, int len
);
25 int uclient_urldecode(const char *in
, char *out
, bool decode_plus
);
27 void http_digest_calculate_auth_hash(char *dest
, const char *user
, const char *realm
, const char *password
);
28 void http_digest_calculate_response(char *dest
, const struct http_digest_data
*data
);