X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=nsapi_shib%2Fnsapi_shib.cpp;h=960409d56aedcfa0d522f9c925351c7b05594792;hb=be6d19c3da5ed72c4de28ff53fa15198d4620556;hp=707907103bb41f6cbaba503ea8b4a2c03ceb3df0;hpb=0be1d389d3a65d640890289eae8fc0c02a1ece2e;p=shibboleth%2Fcpp-sp.git diff --git a/nsapi_shib/nsapi_shib.cpp b/nsapi_shib/nsapi_shib.cpp index 7079071..960409d 100644 --- a/nsapi_shib/nsapi_shib.cpp +++ b/nsapi_shib/nsapi_shib.cpp @@ -83,6 +83,16 @@ namespace { static const XMLCh path[] = UNICODE_LITERAL_4(p,a,t,h); static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e); + + void _my_invalid_parameter_handler( + const wchar_t * expression, + const wchar_t * function, + const wchar_t * file, + unsigned int line, + uintptr_t pReserved + ) { + return; + } } PluginManager::Factory SunRequestMapFactory; @@ -170,14 +180,18 @@ extern "C" NSAPI_PUBLIC int nsapi_shib_init(pblock* pb, ::Session* sn, Request* g_spoofKey = unsetValue.second; #ifdef WIN32 else { + _invalid_parameter_handler old = _set_invalid_parameter_handler(_my_invalid_parameter_handler); unsigned int randkey=0,randkey2=0,randkey3=0,randkey4=0; if (rand_s(&randkey) == 0 && rand_s(&randkey2) == 0 && rand_s(&randkey3) == 0 && rand_s(&randkey4) == 0) { + _set_invalid_parameter_handler(old); ostringstream keystr; keystr << randkey << randkey2 << randkey3 << randkey4; g_spoofKey = keystr.str(); } else { + _set_invalid_parameter_handler(old); pblock_nvinsert("error", "module failed to generate a random anti-spoofing key (if this is Windows 2000 set one manually)", pb); + locker.assign(); // pops lock on SP config g_Config->term(); g_Config=NULL; return REQ_ABORTED;