Removed chunk_from_buf() in favor of a simpler chunk_from_chars() macro
This commit is contained in:
@@ -77,15 +77,13 @@ static void add_filter(private_session_t *this, filter_t *filter)
|
||||
*/
|
||||
static void create_sid(private_session_t *this, request_t *request)
|
||||
{
|
||||
char buf[16];
|
||||
chunk_t chunk = chunk_from_buf(buf);
|
||||
rng_t *rng;
|
||||
|
||||
rng = lib->crypto->create_rng(lib->crypto, RNG_WEAK);
|
||||
if (rng)
|
||||
{
|
||||
rng->get_bytes(rng, sizeof(buf), buf);
|
||||
this->sid = chunk_to_hex(chunk, NULL, FALSE).ptr;
|
||||
this->sid = chunk_to_hex(chunk_create(buf, sizeof(buf)), NULL, FALSE).ptr;
|
||||
request->add_cookie(request, "SID", this->sid);
|
||||
rng->destroy(rng);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user