library/src/network/httpd/BP-HTTPdSessions.cc
// Adds an arbitrary number of valid xsrf tokens to a user session.
Adds an arbitrary number of valid xsrf tokens to a user session.
Adds an arbitrary number of valid xsrf tokens to a user session .
BP_ERROR_T BP_HTTPdSessionXSRFTokensAdd
(
	P_BP_HTTPD_USER_SESSION user_session,
	size_t                  token_count
)
{
	if(!user_session)
		return ERR_FAILURE;
	if(!token_count)
		return ERR_FAILURE;
	if(token_count > BP_KILOBYTE)
		return ERR_FAILURE;
	size_t token_gen_iter = 0;
	for
	(
		;
		token_gen_iter < token_count;
		token_gen_iter++
	)
	{
		printf("\n [!!] Attempting to add XSRF token here?!");
		BP_HTTPdSessionXSRFTokenAdd(user_session);
	}
	return ERR_SUCCESS;
}
BP_ERROR_T BP_HTTPdSessionXSRFTokensAdd ( P_BP_HTTPD_USER_SESSION user_session , size_t token_count ) { if ( ! user_session ) return ERR_FAILURE ; if ( ! token_count ) return ERR_FAILURE ; if ( token_count > BP_KILOBYTE ) return ERR_FAILURE ; size_t token_gen_iter = 0 ; for ( ; token_gen_iter < token_count ; token_gen_iter ++ ) { printf ( " \n " ) ; BP_HTTPdSessionXSRFTokenAdd ( user_session ) ; } return ERR_SUCCESS ; }
Adds an arbitrary number of valid xsrf tokens to a user session.
Adds an arbitrary number of valid xsrf tokens to a user session .
// run basic zero/null checks // gonna set token count to a 1k entries max to prevent developer // mishaps. // if the api key already exists, exit immediately //if(BP_HTTPdSessionLookupAPIKeyByIdentifier(httpd, key_identifier)) //	BP_HTTPD_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC(ERR_FAILURE); // generate xsrf tokens linearly // add new session // return indicating success