Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1530 lines
52 KiB

  1. #include <wininetp.h>
  2. #include "cookiepolicy.h"
  3. #include "urlmon.h"
  4. #ifndef ARRAYSIZE
  5. #define ARRAYSIZE(x) ((sizeof(x)/sizeof(x[0])))
  6. #endif
  7. extern IInternetSecurityManager* g_pSecMgr;
  8. extern "C" DWORD GetZoneFromUrl(LPCSTR pszUrl);
  9. GUID guidCookieSettings = {0xaeba21fa, 0x782a, 0x4a90, 0x97, 0x8d,
  10. 0xb7, 0x21, 0x64, 0xc8, 0x01, 0x20};
  11. GUID guid3rdPartySettings = {0xa8a88c49, 0x5eb2, 0x4990,
  12. 0xa1, 0xa2, 0x08, 0x76, 0x02, 0x2c, 0x85, 0x4f};
  13. const wchar_t *SettingTemplate[];
  14. /* static member definition */
  15. CP3PSettingsCache CCookieSettings::cookiePrefsCache;
  16. /* settings signature strings */
  17. const char gszP3PV1Signature[] = "IE6-P3PV1/settings:";
  18. const wchar_t gszUnicodeSignature[] = L"IE6-P3PV1/settings:";
  19. BOOL IsNoCookies(DWORD dwZone);
  20. void SetNoCookies(DWORD dwZone, DWORD dwNewPolicy);
  21. struct P3PSymbol {
  22. const char *pszAcronym;
  23. unsigned long dwSymIndex;
  24. unsigned long dwHashCode;
  25. };
  26. /* Macro for determining precedence of cookie actions.
  27. In IE6 the COOKIE_STATE_* enumeration is arranged such that higher values
  28. take precedence. For example, downgrade overrides prompt.
  29. If one rule evaluates to "downgrade" while others evaluate to "prompt",
  30. the final decision is "downgrade". */
  31. #define precedence(d) (d)
  32. /* special symbols used for defining settings */
  33. const char
  34. SymNoPolicy[] = "###", /* No-policy */
  35. SymMissingCP[] = "nopolicy", /* Same as "no-policy" */
  36. SymConstDecision[] = "%%%", /* Constant settings */
  37. SymApplyAll[] = "always", /* Same as constant settings */
  38. SymSession[] = "session"; /* exclude P3P from session-cookies */
  39. const char *acronymSet[] = {
  40. /* purposes */
  41. "CURa", "CURi", "CURo",
  42. "ADMa", "ADMi", "ADMo",
  43. "DEVa", "DEVi", "DEVo",
  44. "CUSa", "CUSi", "CUSo",
  45. "TAIa", "TAIi", "TAIo",
  46. "PSAa", "PSAi", "PSAo",
  47. "PSDa", "PSDi", "PSDo",
  48. "IVAa", "IVAi", "IVAo",
  49. "IVDa", "IVDi", "IVDo",
  50. "CONa", "CONi", "CONo",
  51. "HISa", "HISi", "HISo",
  52. "TELa", "TELi", "TELo",
  53. "OTPa", "OTPi", "OTPo",
  54. /* recipients */
  55. "OURa", "OURi", "OURo",
  56. "DELa", "DELi", "DELo",
  57. "SAMa", "SAMi", "SAMo",
  58. "OTRa", "OTRi", "OTRo",
  59. "UNRa", "UNRi", "UNRo",
  60. "PUBa", "PUBi", "PUBo",
  61. /* retention */
  62. "NOR", "STP", "LEG", "BUS", "IND",
  63. /* categories */
  64. "PHY", "ONL", "UNI", "PUR", "FIN", "COM", "NAV", "INT",
  65. "DEM", "CNT", "STA", "POL", "HEA", "PRE", "GOV", "OTC",
  66. /* non-identifiable */
  67. "NID",
  68. /* disputes section */
  69. "DSP",
  70. /* access */
  71. "NOI", "ALL", "CAO", "IDC", "OTI", "NON",
  72. /* dispute resolution */
  73. "COR", "MON", "LAW",
  74. /* TST: token for indicating that a policy is test-version */
  75. "TST",
  76. };
  77. const int symbolCount = sizeof(acronymSet)/sizeof(char*);
  78. P3PSymbol symbolIndex[symbolCount];
  79. /* 537 is the smallest modulus number which makes the function 1-1 */
  80. const int HashModulus = 537;
  81. unsigned char lookupArray[HashModulus];
  82. /* This hash function is designed to be collision-free on the P3P
  83. compact-policy tokens. If new tokens are introduced, MUST
  84. verify that the hash-values remain unique. */
  85. unsigned int hashP3PSymbol(const char *symbol) {
  86. unsigned long ulValue = (symbol[0]<<24) |
  87. (symbol[1]<<16) |
  88. (symbol[2]<<8) |
  89. (symbol[3]);
  90. return (ulValue%HashModulus);
  91. }
  92. bool buildSymbolTable(void) {
  93. memset(lookupArray, 0xFF, sizeof(lookupArray));
  94. for (int si=0; si<symbolCount; si++) {
  95. const char *pstr = acronymSet[si];
  96. symbolIndex[si].pszAcronym = pstr;
  97. symbolIndex[si].dwSymIndex = si;
  98. /* Compute unique hash-code from first 3 letters, used for fast comparison */
  99. symbolIndex[si].dwHashCode = (pstr[0]<<16) | (pstr[1]<<8) | (pstr[2]);
  100. unsigned int hashIndex = hashP3PSymbol(pstr);
  101. lookupArray[hashIndex] = (unsigned char) si;
  102. }
  103. return true;
  104. }
  105. /* Search the symbol set used in P3P compact-policy declarations
  106. This function correctly deals with the optional "a" extension
  107. which can be added to some of the symbols.
  108. Returns index into the symbol-table or negative value for failure */
  109. int findSymbol(const char *pstr) {
  110. static bool fReady = buildSymbolTable();
  111. /* all symbols recognized in P3P-V1 have 3 or 4 characters */
  112. int symlen = strlen(pstr);
  113. if (symlen<3 || symlen>4)
  114. return -1;
  115. /* compute hash-code for first 3 letters */
  116. unsigned long dwHashCode = (pstr[0]<<16) | (pstr[1]<<8) | (pstr[2]);
  117. for (int i=0; i<symbolCount; i++) {
  118. const char *pSymbol = acronymSet[i];
  119. /* first three letters MUST match exactly-- otherwise move to next symbol */
  120. if (symbolIndex[i].dwHashCode != dwHashCode)
  121. continue;
  122. /* if no extension is given "a" is implied */
  123. if (pSymbol[3]==pstr[3] || (pSymbol[3]=='a' && pstr[3]==0))
  124. return i;
  125. }
  126. return -1;
  127. }
  128. /* Semi-public version of the above function (exported by ordinal) */
  129. INTERNETAPI_(int) FindP3PPolicySymbol(const char *pszSymbol) {
  130. if (pszSymbol)
  131. {
  132. return findSymbol(pszSymbol);
  133. }
  134. else
  135. {
  136. return -1;
  137. }
  138. }
  139. int mapCookieAction(char ch) {
  140. int iAction = COOKIE_STATE_UNKNOWN;
  141. switch (ch) {
  142. case 'a': iAction = COOKIE_STATE_ACCEPT; break;
  143. case 'p': iAction = COOKIE_STATE_PROMPT; break;
  144. case 'l': iAction = COOKIE_STATE_LEASH; break;
  145. case 'd': iAction = COOKIE_STATE_DOWNGRADE; break;
  146. case 'r': iAction = COOKIE_STATE_REJECT; break;
  147. default:
  148. break;
  149. };
  150. return iAction;
  151. }
  152. const char *getNextToken(const char *pch, char *pszToken, int cbToken, bool fWhiteSpc, int *pLength) {
  153. if (pch==NULL || pszToken==NULL || cbToken==0)
  154. return NULL;
  155. /* clear token and set optional length to zero */
  156. *pszToken = '\0';
  157. if (pLength)
  158. *pLength = 0;
  159. /* locate beginning of next token by skipping over white space */
  160. while (*pch && isspace(*pch))
  161. pch++;
  162. int tksize = 0;
  163. char chStart = *pch;
  164. if (fWhiteSpc) {
  165. /* copy whole token to the space provided */
  166. while (*pch && !isspace(*pch) && tksize<cbToken)
  167. pszToken[tksize++] = *pch++;
  168. }
  169. else if (ispunct(*pch))
  170. pszToken[tksize++] = *pch++;
  171. else {
  172. /* copy alphanumeric token-- other characters are not included */
  173. while (*pch && isalnum(*pch) && tksize<cbToken)
  174. pszToken[tksize++] = *pch++;
  175. }
  176. pszToken[tksize] = '\0'; /* zero-terminate string */
  177. /* store size of token in optional parameter */
  178. if (pLength)
  179. *pLength = tksize;
  180. /* Return the current position after token last-scanned */
  181. return pch;
  182. }
  183. void RefreshP3PSettings() {
  184. CCookieSettings::RefreshP3PSettings();
  185. }
  186. void CCookieSettings::RefreshP3PSettings() {
  187. cookiePrefsCache.evictAll();
  188. }
  189. bool CCookieSettings::extractCompactPolicy(const char *pszP3PHeader, char *pszPolicy, DWORD *pPolicyLen)
  190. {
  191. static const char gszPolicyFieldName[] = "CP";
  192. unsigned long dwFieldLen = 0;
  193. char *pszValue = FindNamedValue((char*) pszP3PHeader, gszPolicyFieldName, &dwFieldLen);
  194. if (pszValue && dwFieldLen<*pPolicyLen) {
  195. *pPolicyLen = dwFieldLen;
  196. strncpy(pszPolicy, pszValue, dwFieldLen+1);
  197. pszPolicy[dwFieldLen] = '\0';
  198. return true;
  199. }
  200. /* Reaching this point implies header was incorrectly formatted or
  201. there is insufficient space to copy the policy */
  202. *pPolicyLen = dwFieldLen;
  203. return false;
  204. }
  205. /*
  206. * Converts a Unicode representation of P3P-V1 settings to ASCII.
  207. * The settings format is guaranteed to contain only ASCII characters,
  208. * which allows for the more efficient conversion below instead of
  209. * calling WideCharToMultiByte()
  210. */
  211. void CCookieSettings::convertToASCII(char *pszSettings, int cbBytes) {
  212. wchar_t *pwszUC = (wchar_t*) pszSettings;
  213. for (int i=0; i<cbBytes/2; i++)
  214. *pszSettings++ = (char) *pwszUC++;
  215. *pszSettings = '\0'; // nil-terminate the string
  216. }
  217. /*
  218. * Input: pointer to P3P header (contained in the struct P3PCookieState)
  219. * This functions parses the policy header, extracts and evaluates the
  220. * compact policy. Eval results are stored in the struct.
  221. */
  222. int CCookieSettings::EvaluatePolicy(P3PCookieState *pState) {
  223. int nResult = dwNoPolicyDecision;
  224. char *pchCompactPolicy = NULL;
  225. unsigned long dwPolicySize = 2048;
  226. CompactPolicy sitePolicy;
  227. if (!pState)
  228. goto Cleanup;
  229. pState->fEvaluated = FALSE;
  230. pchCompactPolicy = (char *) ALLOCATE_FIXED_MEMORY(dwPolicySize);
  231. if (pchCompactPolicy == NULL)
  232. goto Cleanup;
  233. pState->fValidPolicy = pState->pszP3PHeader &&
  234. extractCompactPolicy(pState->pszP3PHeader, pchCompactPolicy, &dwPolicySize);
  235. pState->fIncSession = fApplyToSC ? TRUE : FALSE;
  236. /* Are the settings independent of policy? */
  237. if (fConstant) {
  238. pState->fEvaluated = TRUE; /* set privacy-eval flag */
  239. nResult = (pState->dwPolicyState = dwFixedDecision);
  240. goto Cleanup;
  241. }
  242. /* If there is no compact policy in the P3P header return
  243. the decision which would apply in the case of missing policy */
  244. if (! pState->fValidPolicy) {
  245. nResult = (pState->dwPolicyState = dwNoPolicyDecision);
  246. goto Cleanup;
  247. }
  248. /* Otherwise: found compact policy with valid syntax in P3P: header */
  249. pState->fEvaluated = TRUE;
  250. const char *pszCompactPolicy = pchCompactPolicy;
  251. int numTokens = 0;
  252. int finalDecision = COOKIE_STATE_ACCEPT;
  253. char achToken[128];
  254. while (*pszCompactPolicy) {
  255. pszCompactPolicy = getNextToken(pszCompactPolicy, achToken, sizeof(achToken));
  256. /* An empty token means we reached end of the header */
  257. if (!achToken[0])
  258. break;
  259. numTokens++;
  260. int symindex = findSymbol(achToken);
  261. if (symindex<0) /* Unrecognized token? */
  262. continue; /* Ignore-- equivalent to ACCEPT decision for that token */
  263. /* Update binary representation of compact-policy */
  264. sitePolicy.addToken(symindex);
  265. int tokenDecision = MPactions[symindex];
  266. if (precedence(tokenDecision) > precedence(finalDecision))
  267. finalDecision = tokenDecision;
  268. /* REJECT decisions are irreversible: no other value can override this */
  269. if (finalDecision==COOKIE_STATE_REJECT)
  270. break;
  271. }
  272. /* If there were no tokens in the policy, it is considered invalid.
  273. Note that unrecognized tokens also count towards the tally. */
  274. if (numTokens==0) {
  275. finalDecision = dwNoPolicyDecision;
  276. pState->fValidPolicy = FALSE;
  277. }
  278. else {
  279. /* Additional evaluation rules */
  280. for (CPEvalRule *pRule = pRuleSet;
  281. pRule;
  282. pRule=pRule->pNext) {
  283. int outcome = pRule->evaluate(sitePolicy);
  284. if (outcome != COOKIE_STATE_UNKNOWN) {
  285. finalDecision = outcome;
  286. break;
  287. }
  288. }
  289. }
  290. pState->cpSitePolicy = sitePolicy;
  291. nResult = (pState->dwPolicyState = finalDecision);
  292. Cleanup:
  293. if (pchCompactPolicy)
  294. FREE_MEMORY(pchCompactPolicy);
  295. return nResult;
  296. }
  297. bool CCookieSettings::GetSettings(CCookieSettings **ppCookiePref, DWORD dwZone, BOOL f3rdParty) {
  298. /* symbolic value for corrupt settings */
  299. static CCookieSettings InvalidSettings(NULL, 0);
  300. bool fSuccess = false;
  301. *ppCookiePref = NULL;
  302. CCookieSettings *pCachedPref = cookiePrefsCache.lookupCookieSettings(dwZone, f3rdParty);
  303. if (pCachedPref && pCachedPref != &InvalidSettings) {
  304. *ppCookiePref = pCachedPref;
  305. fSuccess = true;
  306. goto ExitPoint;
  307. }
  308. else if (pCachedPref==&InvalidSettings)
  309. goto ExitPoint;
  310. if(WCHAR *pszSettings = new WCHAR[MaxPrivacySettings])
  311. {
  312. DWORD dwSize = MaxPrivacySettings;
  313. if(ERROR_SUCCESS == PrivacyGetZonePreferenceW(
  314. dwZone,
  315. f3rdParty ? PRIVACY_TYPE_THIRD_PARTY : PRIVACY_TYPE_FIRST_PARTY,
  316. NULL,
  317. pszSettings,
  318. &dwSize)
  319. && *pszSettings)
  320. {
  321. *ppCookiePref = new CCookieSettings((BYTE *)pszSettings, sizeof(WCHAR) * lstrlenW(pszSettings));
  322. cookiePrefsCache.saveCookieSettings(dwZone, f3rdParty, *ppCookiePref);
  323. fSuccess = true;
  324. }
  325. else {
  326. InvalidSettings.AddRef();
  327. cookiePrefsCache.saveCookieSettings(dwZone, f3rdParty, &InvalidSettings);
  328. }
  329. delete [] pszSettings;
  330. }
  331. ExitPoint:
  332. return fSuccess;
  333. }
  334. bool CCookieSettings::GetSettings(CCookieSettings **pCookiePref, const char *pszURL, BOOL f3rdParty, BOOL fRestricted) {
  335. INET_ASSERT(pszURL);
  336. INET_ASSERT(pCookiePref);
  337. DWORD dwZone;
  338. if (fRestricted)
  339. dwZone = URLZONE_UNTRUSTED;
  340. else
  341. dwZone = GetZoneFromUrl(pszURL);
  342. return GetSettings(pCookiePref, dwZone, f3rdParty);
  343. }
  344. /* Constructor for interpreting settings in binary format */
  345. CCookieSettings::CCookieSettings(unsigned char *pBinaryRep, int cb) {
  346. const int siglen = sizeof(gszP3PV1Signature)/sizeof(char);
  347. MPactions = NULL;
  348. pRuleSet = NULL;
  349. ppLast = &pRuleSet;
  350. iRefCount = 1;
  351. dwNoPolicyDecision = COOKIE_STATE_REJECT;
  352. fConstant = false;
  353. fApplyToSC = true;
  354. if (!pBinaryRep || cb<=0) {
  355. fConstant = true;
  356. dwFixedDecision = COOKIE_STATE_ACCEPT;
  357. return;
  358. }
  359. /* Create new zero-terminated copy of the settings which
  360. can be modified for parsing steps below */
  361. char *pszBuffer = new char[cb+2];
  362. memcpy(pszBuffer, pBinaryRep, cb);
  363. pszBuffer[cb] = pszBuffer[cb+1] = '\0';
  364. /* create and initialize array for token-settings
  365. default behavior for tokens not listed is ACCEPT */
  366. MPactions = new unsigned char[symbolCount];
  367. memset(MPactions, COOKIE_STATE_ACCEPT, sizeof(unsigned char)*symbolCount);
  368. wchar_t *pwszSettings = (wchar_t*) pszBuffer;
  369. /* convert Unicode representation to ASCII */
  370. convertToASCII(pszBuffer, cb);
  371. char *pszSettings = pszBuffer;
  372. /* check for signature at the beginning of the string */
  373. if (pszSettings == strstr(pszSettings, gszP3PV1Signature)) {
  374. /* signature found: advance to first token */
  375. pszSettings += siglen;
  376. /* loop over the string, examining individual tokens */
  377. while (*pszSettings) {
  378. char achToken[1024], *pEqSign;
  379. pszSettings = (char*) getNextToken(pszSettings, achToken, sizeof(achToken));
  380. if (!achToken[0])
  381. break;
  382. /* logical-expression rules are enclosed in forward slashes */
  383. if (achToken[0]=='/') {
  384. if (CPEvalRule *pRule = parseEvalRule(achToken+1))
  385. addEvalRule(pRule);
  386. continue;
  387. }
  388. /* each setting has the format: <acronym>[a|i|o]=[a|p|l|d|r] */
  389. pEqSign = strchr(achToken, '=');
  390. /* skip badly formatted settings */
  391. if (!pEqSign)
  392. continue;
  393. *pEqSign = '\0';
  394. /* determine cookie state for current token.
  395. its given by the character after the equal sign */
  396. int iTokenSetting = mapCookieAction(pEqSign[1]);
  397. if (iTokenSetting == COOKIE_STATE_UNKNOWN)
  398. continue;
  399. int symIndex = findSymbol(achToken);
  400. if (symIndex<0) { /* not one of standard compact-policy tokens? */
  401. /* meta-symbols are handled in a separate function */
  402. parseSpecialSymbol(achToken, iTokenSetting);
  403. continue; /* otherwise ignore */
  404. }
  405. MPactions[symIndex] = (unsigned char) iTokenSetting;
  406. }
  407. }
  408. delete [] pszBuffer;
  409. }
  410. bool CCookieSettings::parseSpecialSymbol(char *pszToken, int iSetting) {
  411. if (!strcmp(pszToken, SymNoPolicy) ||
  412. !strcmp(pszToken, SymMissingCP))
  413. dwNoPolicyDecision = iSetting;
  414. else if (!strcmp(pszToken, SymConstDecision) ||
  415. !strcmp(pszToken, SymApplyAll)) {
  416. fConstant = true;
  417. dwFixedDecision = iSetting;
  418. }
  419. else if (!strcmp(pszToken, SymSession) && iSetting==COOKIE_STATE_ACCEPT)
  420. fApplyToSC = false;
  421. else
  422. return false;
  423. return true;
  424. }
  425. void CCookieSettings::addEvalRule(CPEvalRule *pRule) {
  426. /* add evaluation rule at end of linked list */
  427. *ppLast = pRule;
  428. pRule->pNext = NULL;
  429. ppLast = & (pRule->pNext);
  430. }
  431. void CCookieSettings::Release() {
  432. if (! --iRefCount)
  433. delete this;
  434. }
  435. CCookieSettings::~CCookieSettings() {
  436. /* Free array of token decisions */
  437. if (MPactions)
  438. delete [] MPactions;
  439. /* Free linked-list of evaluation rules */
  440. while (pRuleSet) {
  441. CPEvalRule *pNext = pRuleSet->pNext;
  442. delete pRuleSet;
  443. pRuleSet = pNext;
  444. }
  445. }
  446. /*
  447. Implementation of CP3PSettingsCache
  448. */
  449. CP3PSettingsCache::CP3PSettingsCache() {
  450. memset (stdCookiePref, 0 ,sizeof(stdCookiePref));
  451. memset (std3rdPartyPref, 0, sizeof(std3rdPartyPref));
  452. InitializeCriticalSection(&csCache);
  453. }
  454. CP3PSettingsCache::~CP3PSettingsCache() {
  455. DeleteCriticalSection(&csCache);
  456. }
  457. CCookieSettings *CP3PSettingsCache::lookupCookieSettings(DWORD dwZone, BOOL f3rdParty) {
  458. if (dwZone>MaxKnownZone)
  459. return NULL;
  460. CriticalSectOwner csOwner(&csCache);
  461. CCookieSettings **ppStore;
  462. // Choose storage based on whether cookie is 3rd-party
  463. if (f3rdParty)
  464. ppStore = std3rdPartyPref;
  465. else
  466. ppStore = stdCookiePref;
  467. // Increase reference count before returning pointer
  468. if (ppStore[dwZone])
  469. ppStore[dwZone]->AddRef();
  470. return ppStore[dwZone];
  471. }
  472. void CP3PSettingsCache::saveCookieSettings(DWORD dwZone, BOOL f3rdParty, CCookieSettings *pSettings) {
  473. if (dwZone>MaxKnownZone)
  474. return;
  475. CriticalSectOwner csOwner(&csCache);
  476. CCookieSettings **ppStore;
  477. // Choose storage based on whether cookie is 3rd-party
  478. if (f3rdParty)
  479. ppStore = std3rdPartyPref;
  480. else
  481. ppStore = stdCookiePref;
  482. pSettings->AddRef();
  483. ppStore[dwZone] = pSettings;
  484. }
  485. void CP3PSettingsCache::evictAll() {
  486. CriticalSectOwner csOwner(&csCache);
  487. /* Release all settings.
  488. Destructors are not invoked if there are outstanding
  489. references left. (eg the settings are being used for evaluation)
  490. Object will be freed when all references are gone. */
  491. for (int i=0; i<MaxKnownZone; i++) {
  492. if (stdCookiePref[i])
  493. stdCookiePref[i]->Release();
  494. if (std3rdPartyPref[i])
  495. std3rdPartyPref[i]->Release();
  496. }
  497. /* zero-out the arrays */
  498. memset (stdCookiePref, 0 ,sizeof(stdCookiePref));
  499. memset (std3rdPartyPref, 0, sizeof(std3rdPartyPref));
  500. }
  501. /*
  502. Implementation of CompactPolicy structure
  503. */
  504. CompactPolicy CompactPolicy::operator & (const CompactPolicy &ps) const {
  505. CompactPolicy result;
  506. result.qwLow = qwLow & ps.qwLow;
  507. result.qwHigh = qwHigh & ps.qwHigh;
  508. return result;
  509. }
  510. bool CompactPolicy::operator == (const CompactPolicy &ps) const {
  511. return (qwLow==ps.qwLow) &&
  512. (qwHigh==ps.qwHigh);
  513. }
  514. bool CompactPolicy::operator != (const CompactPolicy &ps) const {
  515. return (qwLow!=ps.qwLow) ||
  516. (qwHigh!=ps.qwHigh);
  517. }
  518. void CompactPolicy::addToken(int index) {
  519. const quadword mask = 1;
  520. if (index<64)
  521. qwLow |= mask << index;
  522. else if (index<128)
  523. qwHigh |= mask << (index-64);
  524. }
  525. int CompactPolicy::contains(int index) {
  526. quadword mask = 1 << (index%64);
  527. if (index<64)
  528. mask &= qwLow;
  529. else
  530. mask &= qwHigh;
  531. return (mask!=0);
  532. }
  533. //////////////////////////////////////////////////////////////////////////////////////////////////
  534. //
  535. // Privacy settings API and helper functions
  536. //
  537. //////////////////////////////////////////////////////////////////////////////////////////////////
  538. #define REGSTR_PATH_ZONE L"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones"
  539. #define REGSTR_VAL_FIRST_PARTY L"{AEBA21FA-782A-4A90-978D-B72164C80120}"
  540. #define REGSTR_VAL_THIRD_PARTY L"{A8A88C49-5EB2-4990-A1A2-0876022C854F}"
  541. #define SIGNATURE_NONE 0
  542. #define SIGNATURE_UNICODE 1
  543. #define SIGNATURE_MULTIBYTE 2
  544. #define MIN(a,b) (((DWORD_PTR)a) < ((DWORD_PTR)b) ? (a) : (b))
  545. DWORD IsSignaturePresent(BYTE *pbBuffer, DWORD dwBufferBytes)
  546. {
  547. if(dwBufferBytes && 0 == StrCmpNIW(
  548. (LPCWSTR)pbBuffer,
  549. gszUnicodeSignature,
  550. MIN(dwBufferBytes / sizeof(WCHAR), lstrlenW(gszUnicodeSignature))
  551. ))
  552. {
  553. return SIGNATURE_UNICODE;
  554. }
  555. if(dwBufferBytes && 0 == StrCmpNI(
  556. (LPCSTR)pbBuffer,
  557. gszP3PV1Signature,
  558. MIN(dwBufferBytes / sizeof(CHAR), lstrlenA(gszP3PV1Signature))
  559. ))
  560. {
  561. return SIGNATURE_MULTIBYTE;
  562. }
  563. return SIGNATURE_NONE;
  564. }
  565. void AddHardeningPrivacyDefaults()
  566. {
  567. // Internet to Medium
  568. PrivacySetZonePreferenceW(URLZONE_TRUSTED, PRIVACY_TYPE_FIRST_PARTY, PRIVACY_TEMPLATE_MEDIUM, NULL);
  569. PrivacySetZonePreferenceW(URLZONE_TRUSTED, PRIVACY_TYPE_THIRD_PARTY, PRIVACY_TEMPLATE_MEDIUM, NULL);
  570. }
  571. void RemoveHardeningPrivacyDefaults()
  572. {
  573. WCHAR szRegPath[MAX_PATH];
  574. // build reg path
  575. wnsprintfW(szRegPath, MAX_PATH, L"%ws\\2", REGSTR_PATH_ZONE);
  576. SHDeleteValueW(HKEY_CURRENT_USER,
  577. szRegPath,
  578. REGSTR_VAL_FIRST_PARTY);
  579. SHDeleteValueW(
  580. HKEY_CURRENT_USER,
  581. szRegPath,
  582. REGSTR_VAL_THIRD_PARTY);
  583. }
  584. void
  585. CheckPrivacyDefaults(void)
  586. {
  587. WCHAR szRegPath[MAX_PATH], szValue[MAX_PATH];
  588. BOOL fWriteSettings = TRUE;
  589. DWORD dwError, dwLen = MAX_PATH;
  590. // build reg path
  591. wnsprintfW(szRegPath, MAX_PATH, L"%ws\\3", REGSTR_PATH_ZONE);
  592. dwError = SHGetValueW(
  593. HKEY_CURRENT_USER,
  594. szRegPath,
  595. REGSTR_VAL_FIRST_PARTY,
  596. NULL,
  597. szValue,
  598. &dwLen);
  599. switch(dwError)
  600. {
  601. case ERROR_SUCCESS:
  602. // check to see if the plaintext signature is present
  603. if(SIGNATURE_NONE == IsSignaturePresent((BYTE *)szValue, dwLen))
  604. {
  605. // plaintext signature not present, don't overwrite.
  606. fWriteSettings = FALSE;
  607. }
  608. break;
  609. case ERROR_FILE_NOT_FOUND:
  610. // no existing settings, write defaults
  611. break;
  612. case ERROR_MORE_DATA:
  613. // longer than max_path... not an old setting, so leave it alone
  614. fWriteSettings = FALSE;
  615. break;
  616. default:
  617. // unknown error, write defaults
  618. break;
  619. }
  620. if(fWriteSettings)
  621. {
  622. // Internet to Medium
  623. PrivacySetZonePreferenceW(URLZONE_INTERNET, PRIVACY_TYPE_FIRST_PARTY, PRIVACY_TEMPLATE_MEDIUM, NULL);
  624. PrivacySetZonePreferenceW(URLZONE_INTERNET, PRIVACY_TYPE_THIRD_PARTY, PRIVACY_TEMPLATE_MEDIUM, NULL);
  625. // Restriced to High
  626. PrivacySetZonePreferenceW(URLZONE_UNTRUSTED, PRIVACY_TYPE_FIRST_PARTY, PRIVACY_TEMPLATE_NO_COOKIES, NULL);
  627. PrivacySetZonePreferenceW(URLZONE_UNTRUSTED, PRIVACY_TYPE_THIRD_PARTY, PRIVACY_TEMPLATE_NO_COOKIES, NULL);
  628. }
  629. }
  630. //
  631. // Obfuscation of settings string
  632. //
  633. // GetNextObsByte takes an OBS struct detailing the current placement. 4 bits of each value in bCode are
  634. // taken to compute the substring length to contribute to the entire code. The following bytes give
  635. // the following contributions:
  636. //
  637. // 53 71 59 69 77 6a 63 51 43 67 51 78 72 45 67 4f
  638. // 0b 0a 0d 05 0b 04 03 0b 02 04 08 0b 0b 04 04 08
  639. //
  640. // Total length: 119
  641. //
  642. // GetNextObsByte returns the 11 bytes of the array followed by the first 10,
  643. // then 13, etc.
  644. BYTE bCode[16] = {0x53, 0x71, 0x59, 0x69, 0x77, 0x6a, 0x63, 0x51, 0x43, 0x67, 0x51, 0x78, 0x72, 0x45, 0x67, 0x4f};
  645. typedef struct _obs {
  646. INT iCurNode;
  647. INT iCurIndex;
  648. } OBS, *POBS;
  649. BYTE GetNextObsByte(POBS pobs)
  650. {
  651. BYTE bTarget = bCode[pobs->iCurIndex];
  652. pobs->iCurIndex++;
  653. if(pobs->iCurIndex > ((bCode[pobs->iCurNode] & 0x1e) >> 1))
  654. {
  655. // move to next node
  656. pobs->iCurIndex = 0;
  657. pobs->iCurNode++;
  658. // move back to beginning if all done
  659. if(pobs->iCurNode > 15)
  660. {
  661. pobs->iCurNode = 0;
  662. }
  663. }
  664. return bTarget;
  665. }
  666. //
  667. // Obfuscate a string in place and collapse out 0-bytes in unicode string
  668. //
  669. void ObfuscateString(LPWSTR pszString, int iLen)
  670. {
  671. OBS obs = {0};
  672. INT iCur = 0;
  673. BYTE *pbStream;
  674. INT iIndex;
  675. pbStream = (BYTE *)pszString;
  676. while(iCur < iLen)
  677. {
  678. iIndex = obs.iCurIndex;
  679. pbStream[iCur] = (((BYTE)(pszString[iCur]) + iIndex) ^ GetNextObsByte(&obs));
  680. iCur++;
  681. }
  682. }
  683. //
  684. // Unobfuscate a string - undo what obfuscate does
  685. //
  686. void UnobfuscateString(BYTE *pbStream, LPWSTR pszString, int iLen)
  687. {
  688. OBS obs = {0};
  689. INT iIndex;
  690. INT iCur = 0;
  691. while(iCur < iLen)
  692. {
  693. iIndex = obs.iCurIndex;
  694. pszString[iCur] = (pbStream[iCur] ^ GetNextObsByte(&obs)) - iIndex;
  695. iCur++;
  696. }
  697. // null terminate string
  698. pszString[iCur] = 0;
  699. }
  700. //
  701. // Set and query advanced mode
  702. //
  703. #define REGSTR_VAL_PRIVADV TEXT("PrivacyAdvanced")
  704. BOOL IsAdvanced(void)
  705. {
  706. DWORD dwValue = 0;
  707. BOOL fAdvanced = FALSE;
  708. InternetReadRegistryDword(REGSTR_VAL_PRIVADV, &dwValue);
  709. if(dwValue)
  710. {
  711. fAdvanced = TRUE;
  712. }
  713. return fAdvanced;
  714. }
  715. void SetAdvancedMode(BOOL fAdvanced)
  716. {
  717. DWORD dwAdvanced = fAdvanced? 1 : 0;
  718. // save advanced flag
  719. InternetWriteRegistryDword(REGSTR_VAL_PRIVADV, dwAdvanced);
  720. }
  721. //
  722. // Public APIs
  723. //
  724. INTERNETAPI_(DWORD)
  725. PrivacySetZonePreferenceW(
  726. DWORD dwZone,
  727. DWORD dwType,
  728. DWORD dwTemplate,
  729. LPCWSTR pszPreference
  730. )
  731. {
  732. DEBUG_ENTER_API((DBG_DIALUP,
  733. Dword,
  734. "PrivacySetZonePreferenceW",
  735. "%#x, %#x, %#x, %#x (%q)",
  736. dwZone,
  737. dwType,
  738. dwTemplate,
  739. pszPreference
  740. ));
  741. DWORD dwError = ERROR_INVALID_PARAMETER;
  742. //
  743. // validate parameters
  744. //
  745. if(dwZone > URLZONE_UNTRUSTED && (dwZone < URLZONE_USER_MIN || dwZone > URLZONE_USER_MAX))
  746. {
  747. goto exit;
  748. }
  749. if(dwType > PRIVACY_TYPE_THIRD_PARTY)
  750. {
  751. goto exit;
  752. }
  753. if( dwTemplate > PRIVACY_TEMPLATE_MAX
  754. && (dwTemplate < PRIVACY_TEMPLATE_CUSTOM || dwTemplate > PRIVACY_TEMPLATE_ADVANCED))
  755. {
  756. goto exit;
  757. }
  758. if(pszPreference && IsBadStringPtrW(pszPreference, MaxPrivacySettings))
  759. // in debug, verifies string is readable up to '\0' or pszPreference[MaxPrivacySettings].
  760. {
  761. goto exit;
  762. }
  763. if(pszPreference && (dwTemplate != PRIVACY_TEMPLATE_CUSTOM && dwTemplate != PRIVACY_TEMPLATE_ADVANCED))
  764. {
  765. goto exit;
  766. }
  767. if(NULL == pszPreference && dwTemplate == PRIVACY_TEMPLATE_CUSTOM)
  768. {
  769. // custom needs a preference string
  770. goto exit;
  771. }
  772. //
  773. // Make buffer with new preference
  774. //
  775. WCHAR *pszRegPref;
  776. LPCWSTR pszCopyStr;
  777. DWORD dwPrefLen;
  778. if(dwTemplate < PRIVACY_TEMPLATE_CUSTOM)
  779. {
  780. // figure out appropriate template string
  781. // Strings are organized as follows:
  782. //
  783. // high first
  784. // high third
  785. // med-hi first
  786. // med-hi third
  787. // ...
  788. pszCopyStr = SettingTemplate[2 * dwTemplate + dwType];
  789. }
  790. else
  791. {
  792. // copy passed pref string to new buffer
  793. pszCopyStr = pszPreference;
  794. }
  795. //
  796. // alloc buffer, copy appropriate string
  797. //
  798. dwPrefLen = lstrlenW(pszCopyStr);
  799. pszRegPref = new WCHAR[dwPrefLen + 1];
  800. if(pszRegPref == NULL)
  801. {
  802. goto exit;
  803. }
  804. StrCpyNW(pszRegPref, pszCopyStr, dwPrefLen + 1);
  805. //
  806. // Obfuscate string in place, dwPrefLen *BYTES* (NOT unicode chars) left afterwards
  807. //
  808. dwPrefLen = lstrlenW(pszRegPref);
  809. ObfuscateString(pszRegPref, dwPrefLen);
  810. //
  811. // Build reg path for appropriate setting
  812. //
  813. WCHAR *pszRegPath = new WCHAR[MAX_PATH];
  814. if(pszRegPath)
  815. {
  816. wnsprintfW(pszRegPath, MAX_PATH, L"%ws\\%d", REGSTR_PATH_ZONE, dwZone);
  817. //
  818. // Stuff it in the registry
  819. //
  820. dwError = SHSetValueW(
  821. HKEY_CURRENT_USER,
  822. pszRegPath,
  823. (dwType == PRIVACY_TYPE_FIRST_PARTY) ? REGSTR_VAL_FIRST_PARTY : REGSTR_VAL_THIRD_PARTY,
  824. REG_BINARY,
  825. pszRegPref,
  826. dwPrefLen); // write out dwPrefLen *BYTES*
  827. delete [] pszRegPath;
  828. // update advanced and no cookies settings
  829. BOOL fAdvanced = FALSE;
  830. DWORD dwPolicy = URLPOLICY_QUERY;
  831. if(URLZONE_INTERNET == dwZone && PRIVACY_TEMPLATE_ADVANCED == dwTemplate)
  832. {
  833. fAdvanced = TRUE;
  834. }
  835. if(PRIVACY_TEMPLATE_NO_COOKIES == dwTemplate)
  836. {
  837. dwPolicy = URLPOLICY_DISALLOW;
  838. }
  839. if(PRIVACY_TEMPLATE_LOW == dwTemplate)
  840. {
  841. dwPolicy = URLPOLICY_ALLOW;
  842. }
  843. SetAdvancedMode(fAdvanced);
  844. SetNoCookies(dwZone, dwPolicy);
  845. }
  846. else
  847. {
  848. dwError = ERROR_OUTOFMEMORY;
  849. }
  850. delete [] pszRegPref;
  851. exit:
  852. DEBUG_LEAVE_API(dwError);
  853. return dwError;
  854. }
  855. INTERNETAPI_(DWORD)
  856. PrivacyGetZonePreferenceW(
  857. DWORD dwZone,
  858. DWORD dwType,
  859. LPDWORD pdwTemplate,
  860. LPWSTR pszBuffer,
  861. LPDWORD pdwBufferLength
  862. )
  863. {
  864. DEBUG_ENTER_API((DBG_DIALUP,
  865. Dword,
  866. "PrivacyGetZonePreferenceW",
  867. "%#x, %#x, %#x, %#x, %#x",
  868. dwZone,
  869. dwType,
  870. pdwTemplate,
  871. pszBuffer,
  872. pdwBufferLength
  873. ));
  874. DWORD dwError = ERROR_INVALID_PARAMETER;
  875. //
  876. // validate parameters
  877. //
  878. if(dwZone > URLZONE_UNTRUSTED && (dwZone < URLZONE_USER_MIN || dwZone > URLZONE_USER_MAX))
  879. {
  880. goto exit;
  881. }
  882. if(dwType > PRIVACY_TYPE_THIRD_PARTY)
  883. {
  884. goto exit;
  885. }
  886. if(pdwTemplate && IsBadWritePtr(pdwTemplate, sizeof(DWORD)))
  887. {
  888. goto exit;
  889. }
  890. // both pszBuffer and pdwBufferLength must be non-null and valid or both much be null
  891. if(pszBuffer || pdwBufferLength)
  892. {
  893. if(IsBadWritePtr(pdwBufferLength, sizeof(DWORD)) || IsBadWritePtr(pszBuffer, *pdwBufferLength))
  894. {
  895. goto exit;
  896. }
  897. }
  898. //
  899. // Allocate buffers for registry read and build path
  900. //
  901. WCHAR *pszRegPath = new WCHAR[MAX_PATH];
  902. WCHAR *pszRegPref;
  903. DWORD dwRegPrefLen = MaxPrivacySettings; // BYTES
  904. BYTE *pbRegReadLoc;
  905. if(NULL == pszRegPath)
  906. {
  907. dwError = ERROR_OUTOFMEMORY;
  908. goto exit;
  909. }
  910. pszRegPref = new WCHAR[MaxPrivacySettings];
  911. if(NULL == pszRegPref)
  912. {
  913. delete [] pszRegPath;
  914. dwError = ERROR_OUTOFMEMORY;
  915. goto exit;
  916. }
  917. wnsprintfW(pszRegPath, MAX_PATH, L"%ws\\%d", REGSTR_PATH_ZONE, dwZone);
  918. //
  919. // Read registry value.
  920. //
  921. // Since the written value (assuming it's valid) is at most MaxPrivacySettings BYTES, read
  922. // it in to the second half of the buffer so it can be expanded to unicode chars in place.
  923. //
  924. // Note buffer is allocated to hold MaxPrivacySettings WCHARs
  925. //
  926. pbRegReadLoc = (BYTE *)(pszRegPref + (MaxPrivacySettings / sizeof(WCHAR)));
  927. dwError = SHGetValueW(
  928. HKEY_CURRENT_USER,
  929. pszRegPath,
  930. (dwType == PRIVACY_TYPE_FIRST_PARTY) ? REGSTR_VAL_FIRST_PARTY : REGSTR_VAL_THIRD_PARTY,
  931. NULL,
  932. pbRegReadLoc,
  933. &dwRegPrefLen);
  934. if( ERROR_SUCCESS != dwError
  935. || IsSignaturePresent(pbRegReadLoc, dwRegPrefLen)
  936. )
  937. {
  938. // no reg setting => not fatal
  939. // buffer too small => invalid settings string
  940. // any other reg error => opps
  941. // found plaintext signature => someone bogarting registry
  942. // in any case, return empty string
  943. dwRegPrefLen = 0;
  944. dwError = ERROR_SUCCESS;
  945. }
  946. delete [] pszRegPath;
  947. //
  948. // Unobfuscate it
  949. //
  950. UnobfuscateString(pbRegReadLoc, pszRegPref, dwRegPrefLen);
  951. if(SIGNATURE_NONE == IsSignaturePresent((BYTE *)pszRegPref, dwRegPrefLen * sizeof(WCHAR)))
  952. {
  953. // internal error.. never expect this to happen
  954. *pszRegPref = 0;
  955. dwRegPrefLen = 0;
  956. dwError = ERROR_SUCCESS;
  957. }
  958. //
  959. // Try to copy to callers buffer if necessary
  960. //
  961. if(pszBuffer)
  962. {
  963. if(dwRegPrefLen < *pdwBufferLength)
  964. {
  965. StrCpyNW(pszBuffer, pszRegPref, *pdwBufferLength);
  966. }
  967. else
  968. {
  969. dwError = ERROR_MORE_DATA;
  970. }
  971. *pdwBufferLength = dwRegPrefLen + 1;
  972. }
  973. //
  974. // Try to match it to a template if necessary
  975. //
  976. if(pdwTemplate)
  977. {
  978. *pdwTemplate = PRIVACY_TEMPLATE_CUSTOM;
  979. if(URLZONE_INTERNET == dwZone && IsAdvanced())
  980. {
  981. *pdwTemplate = PRIVACY_TEMPLATE_ADVANCED;
  982. }
  983. else if(IsNoCookies(dwZone))
  984. {
  985. *pdwTemplate = PRIVACY_TEMPLATE_NO_COOKIES;
  986. }
  987. else if(*pszRegPref)
  988. {
  989. DWORD dwTemplate;
  990. DWORD dwTemplateId;
  991. for(dwTemplate = 0; dwTemplate <= PRIVACY_TEMPLATE_MAX; dwTemplate++)
  992. {
  993. dwTemplateId = 2 * dwTemplate + dwType;
  994. if(0 == StrCmpIW(SettingTemplate[dwTemplateId], pszRegPref))
  995. {
  996. *pdwTemplate = dwTemplate;
  997. break;
  998. }
  999. }
  1000. }
  1001. }
  1002. delete [] pszRegPref;
  1003. exit:
  1004. DEBUG_LEAVE_API(dwError);
  1005. return dwError;
  1006. }
  1007. /*
  1008. templates for default cookie settings
  1009. Consistency condition: decision for TST token == decision for no-policy
  1010. In other words, presence of "TST" token invalidates the entire policy
  1011. */
  1012. /*
  1013. ** WARNING: Settings code assumes all the first party templates are distinct and all the third party
  1014. ** templates are distinct. If you're changing a template, ensure this is true. You can simply
  1015. ** swap clauses if necessary.
  1016. **
  1017. ** Contact darrenmi for more info.
  1018. */
  1019. /*
  1020. BEGIN low -- see warning above before changing
  1021. */
  1022. const wchar_t achLow1stParty[] =
  1023. L"IE6-P3PV1/settings: always=a";
  1024. const wchar_t achLow3rdParty[] =
  1025. L"IE6-P3PV1/settings: always=a";
  1026. /*
  1027. END low
  1028. */
  1029. /* BEGIN medium-low -- see warning above before changing */
  1030. const wchar_t achMedLow1stParty[] =
  1031. L"IE6-P3PV1/settings: nopolicy=l session=a /TST=l/ /=a/"
  1032. ;
  1033. const wchar_t achMedLow3rdParty[] =
  1034. L"IE6-P3PV1/settings: nopolicy=d /TST=d/"
  1035. L" /PHY&!CUR&!ADM&!DEV&!CUS&!TAI&!PSA&!PSD&!IVA&!IVD&!CON&!HIS&!TEL&!OTP&!CURi&!ADMi&!DEVi&!CUSi&!TAIi&!PSAi&!PSDi&!IVAi&!IVDi&!CONi&!HISi&!TELi&!OTPi&!CURo&!ADMo&!DEVo&!CUSo&!TAIo&!PSAo&!PSDo&!IVAo&!IVDo&!CONo&!HISo&!TELo&!OTPo=r/"
  1036. L" /ONL&!CUR&!ADM&!DEV&!CUS&!TAI&!PSA&!PSD&!IVA&!IVD&!CON&!HIS&!TEL&!OTP&!CURi&!ADMi&!DEVi&!CUSi&!TAIi&!PSAi&!PSDi&!IVAi&!IVDi&!CONi&!HISi&!TELi&!OTPi&!CURo&!ADMo&!DEVo&!CUSo&!TAIo&!PSAo&!PSDo&!IVAo&!IVDo&!CONo&!HISo&!TELo&!OTPo=r/"
  1037. L" /GOV&!CUR&!ADM&!DEV&!CUS&!TAI&!PSA&!PSD&!IVA&!IVD&!CON&!HIS&!TEL&!OTP&!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/ONL&TEL=d/ /ONL&OTP=d/ /GOV&SAM=d/"
  1046. L" /GOV&OTR=d/ /GOV&UNR=d/ /GOV&PUB=d/ /GOV&CUS=d/ /GOV&IVA=d/ /GOV&IVD=d/ /GOV&CON=d/ /GOV&TEL=d/"
  1047. L" /GOV&OTP=d/ /FIN&SAM=d/ /FIN&OTR=d/ /FIN&UNR=d/ /FIN&PUB=d/ /FIN&CUS=d/ /FIN&IVA=d/"
  1048. L" /FIN&IVD=d/ /FIN&CON=d/ /FIN&TEL=d/ /FIN&OTP=d/ /=a/"
  1049. ;
  1050. /* END medium-low */
  1051. /* BEGIN medium -- see warning above before changing */
  1052. const wchar_t achMedium1stParty[] =
  1053. L"IE6-P3PV1/settings: nopolicy=l session=a /TST=l/"
  1054. L" /PHY&!CUR&!ADM&!DEV&!CUS&!TAI&!PSA&!PSD&!IVA&!IVD&!CON&!HIS&!TEL&!OTP&!CURi&!ADMi&!DEVi&!CUSi&!TAIi&!PSAi&!PSDi&!IVAi&!IVDi&!CONi&!HISi&!TELi&!OTPi&!CURo&!ADMo&!DEVo&!CUSo&!TAIo&!PSAo&!PSDo&!IVAo&!IVDo&!CONo&!HISo&!TELo&!OTPo=r/"
  1055. L" /ONL&!CUR&!ADM&!DEV&!CUS&!TAI&!PSA&!PSD&!IVA&!IVD&!CON&!HIS&!TEL&!OTP&!CURi&!ADMi&!DEVi&!CUSi&!TAIi&!PSAi&!PSDi&!IVAi&!IVDi&!CONi&!HISi&!TELi&!OTPi&!CURo&!ADMo&!DEVo&!CUSo&!TAIo&!PSAo&!PSDo&!IVAo&!IVDo&!CONo&!HISo&!TELo&!OTPo=r/"
  1056. L" /GOV&!CUR&!ADM&!DEV&!CUS&!TAI&!PSA&!PSD&!IVA&!IVD&!CON&!HIS&!TEL&!OTP&!CURi&!ADMi&!DEVi&!CUSi&!TAIi&!PSAi&!PSDi&!IVAi&!IVDi&!CONi&!HISi&!TELi&!OTPi&!CURo&!ADMo&!DEVo&!CUSo&!TAIo&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D=r/ /FIN&CON=r/ /FIN&TEL=r/ /FIN&OTP=r/ /=a/"
  1085. ;
  1086. /* END medium */
  1087. /* BEGIN medium-high -- see warning above before changing */
  1088. const wchar_t achMedHigh1stParty[] =
  1089. L"IE6-P3PV1/settings: nopolicy=l session=a /TST=l/"
  1090. L" /PHY&!CUR&!ADM&!DEV&!CUS&!TAI&!PSA&!PSD&!IVA&!IVD&!CON&!HIS&!TEL&!OTP&!CURi&!ADMi&!DEVi&!CUSi&!TAIi&!PSAi&!PSDi&!IVAi&!IVDi&!CONi&!HISi&!TELi&!OTPi&!CURo&!ADMo&!DEVo&!CUSo&!TAIo&!PSAo&!PSDo&!IVAo&!IVDo&!CONo&!HISo&!TELo&!OTPo=r/"
  1091. L" /ONL&!CUR&!ADM&!DEV&!CUS&!TAI&!PSA&!PSD&!IVA&!IVD&!CON&!HIS&!TEL&!OTP&!CURi&!ADMi&!DEVi&!CUSi&!TAIi&!PSAi&!PSDi&!IVAi&!IVDi&!CONi&!HISi&!TELi&!OTPi&!CURo&!ADMo&!DEVo&!CUSo&!TAIo&!PSAo&!PSDo&!IVAo&!IVDo&!CONo&!HISo&!TELo&!OTPo=r/"
  1092. L" /GOV&!CUR&!ADM&!DEV&!CUS&!TAI&!PSA&!PSD&!IVA&!IVD&!CON&!HIS&!TEL&!OTP&!CURi&!ADMi&!DEVi&!CUSi&!TAIi&!PSAi&!PSDi&!IVAi&!IVDi&!CONi&!HISi&!TELi&!OTPi&!CURo&!ADMo&!DEVo&!CUSo&!TAIo&!PSAo&!PSDo&!IVAo&!IVDo&!CONo&!HISo&!TELo&!OTPo=r/"
  1093. L" /FIN&!CUR&!ADM&!DEV&!CUS&!TAI&!PSA&!PSD&!IVA&!IVD&!CON&!HIS&!TEL&!OTP&!CURi&!ADMi&!DEVi&!CUSi&!TAIi&!PSAi&!PSDi&!IVAi&!IVDi&!CONi&!HISi&!TELi&!OTPi&!CURo&!ADMo&!DEVo&!CUSo&!TAIo&!PSAo&!PSDo&!IVAo&!IVDo&!CONo&!HISo&!TELo&!OTPo=r/"
  1094. L" /PHY&!DEL&!SAM&!UNR&!PUB&!OTR&!OUR&!DELi&!SAMi&!UNRi&!PUBi&!OTRi&!DELo&!SAMo&!UNRo&!PUBo&!OTRo=r/"
  1095. L" /ONL&!DEL&!SAM&!UNR&!PUB&!OTR&!OUR&!DELi&!SAMi&!UNRi&!PUBi&!OTRi&!DELo&!SAMo&!UNRo&!PUBo&!OTRo=r/"
  1096. L" /GOV&!DEL&!SAM&!UNR&!PUB&!OTR&!OUR&!DELi&!SAMi&!UNRi&!PUBi&!OTRi&!DELo&!SAMo&!UNRo&!PUBo&!OTRo=r/"
  1097. L" /FIN&!DEL&!SAM&!UNR&!PUB&!OTR&!OUR&!DELi&!SAMi&!UNRi&!PUBi&!OTRi&!DELo&!SAMo&!UNRo&!PUBo&!OTRo=r/"
  1098. L" /PHY&SAM=r/ /PHY&OTR=r/ /PHY&UNR=r/ /PHY&PUB=r/ /PHY&CUS=r/ /PHY&IVA=r/ /PHY&IVD=r/ /PHY&CON=r/"
  1099. L" /PHY&TEL=r/ /PHY&OTP=r/ /ONL&SAM=r/ /ONL&OTR=r/ /ONL&UNR=r/ /ONL&PUB=r/ /ONL&CUS=r/ /ONL&IVA=r/"
  1100. L" /ONL&IVD=r/ /ONL&CON=r/ /ONL&TEL=r/ /ONL&OTP=r/ /GOV&SAM=r/ /GOV&OTR=r/ /GOV&UNR=r/ /GOV&PUB=r/"
  1101. L" /GOV&CUS=r/ /GOV&IVA=r/ /GOV&IVD=r/ /GOV&CON=r/ /GOV&TEL=r/ /GOV&OTP=r/ /FIN&SAM=r/ /FIN&OTR=r/"
  1102. L" /FIN&UNR=r/ /FIN&PUB=r/ /FIN&CUS=r/ /FIN&IVA=r/ /FIN&IVD=r/ /FIN&CON=r/ /FIN&TEL=r/ /FIN&OTP=r/ /=a/"
  1103. ;
  1104. const wchar_t achMedHigh3rdParty[] =
  1105. /* CAUTION: this setting is identical to 3rd party HIGH.
  1106. We need a cosmetic change to the string to distinguish template levels. */
  1107. L"IE6-P3PV1/settings: /TST=r/ nopolicy=r"
  1108. L" /PHY&!CUR&!ADM&!DEV&!CUS&!TAI&!PSA&!PSD&!IVA&!IVD&!CON&!HIS&!TEL&!OTP&!CURi&!ADMi&!DEVi&!CUSi&!TAIi&!PSAi&!PSDi&!IVAi&!IVDi&!CONi&!HISi&!TELi&!OTPi&!CURo&!ADMo&!DEVo&!CUSo&!TAIo&!PSAo&!PSDo&!IVAo&!IVDo&!CONo&!HISo&!TELo&!OTPo=r/"
  1109. L" /ONL&!CUR&!ADM&!DEV&!CUS&!TAI&!PSA&!PSD&!IVA&!IVD&!CON&!HIS&!TEL&!OTP&!CURi&!ADMi&!DEVi&!CUSi&!TAIi&!PSAi&!PSDi&!IVAi&!IVDi&!CONi&!HISi&!TELi&!OTPi&!CURo&!ADMo&!DEVo&!CUSo&!TAIo&!PSAo&!PSDo&!IVAo&!IVDo&!CONo&!HISo&!TELo&!OTPo=r/"
  1110. L" /GOV&!CUR&!ADM&!DEV&!CUS&!TAI&!PSA&!PSD&!IVA&!IVD&!CON&!HIS&!TEL&!OTP&!CURi&!ADMi&!DEVi&!CUSi&!TAIi&!PSAi&!PSDi&!IVAi&!IVDi&!CONi&!HISi&!TELi&!OTPi&!CURo&!ADMo&!DEVo&!CUSo&!TAIo&!PSAo&!PSDo&!IVAo&!IVDo&!CONo&!HISo&!TELo&!OTPo=r/"
  1111. L" /FIN&!CUR&!ADM&!DEV&!CUS&!TAI&!PSA&!PSD&!IVA&!IVD&!CON&!HIS&!TEL&!OTP&!CURi&!ADMi&!DEVi&!CUSi&!TAIi&!PSAi&!PSDi&!IVAi&!IVDi&!CONi&!HISi&!TELi&!OTPi&!CURo&!ADMo&!DEVo&!CUSo&!TAIo&!PSAo&!PSDo&!IVAo&!IVDo&!CONo&!HISo&!TELo&!OTPo=r/"
  1112. L" /PHY&!DEL&!SAM&!UNR&!PUB&!OTR&!OUR&!DELi&!SAMi&!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&SAMo=r/"
  1123. L" /GOV&OTRo=r/ /GOV&UNRo=r/ /GOV&PUBo=r/ /GOV&CUSo=r/ /GOV&IVAo=r/ /GOV&IVDo=r/ /GOV&CONo=r/ /GOV&TELo=r/"
  1124. L" /GOV&OTPo=r/ /FIN&SAM=r/ /FIN&OTR=r/ /FIN&UNR=r/ /FIN&PUB=r/ /FIN&CUS=r/ /FIN&IVA=r/"
  1125. L" /FIN&IVD=r/ /FIN&CON=r/ /FIN&TEL=r/ /FIN&OTP=r/ /FIN&SAMo=r/ /FIN&OTRo=r/ /FIN&UNRo=r/"
  1126. L" /FIN&PUBo=r/ /FIN&CUSo=r/ /FIN&IVAo=r/ /FIN&IVDo=r/ /FIN&CONo=r/ /FIN&TELo=r/ /FIN&OTPo=r/ /=a/"
  1127. ;
  1128. /* END medium-high */
  1129. /* BEGIN high -- see warning above before changing */
  1130. const wchar_t achHigh1stParty[] =
  1131. L"IE6-P3PV1/settings: nopolicy=r /TST=r/"
  1132. L" /PHY&!CUR&!ADM&!DEV&!CUS&!TAI&!PSA&!PSD&!IVA&!IVD&!CON&!HIS&!TEL&!OTP&!CURi&!ADMi&!DEVi&!CUSi&!TAIi&!PSAi&!PSDi&!IVAi&!IVDi&!CONi&!HISi&!TELi&!OTPi&!CURo&!ADMo&!DEVo&!CUSo&!TAIo&!PSAo&!PSDo&!IVAo&!IVDo&!CONo&!HISo&!TELo&!OTPo=r/"
  1133. L" /ONL&!CUR&!ADM&!DEV&!CUS&!TAI&!PSA&!PSD&!IVA&!IVD&!CON&!HIS&!TEL&!OTP&!CURi&!ADMi&!DEVi&!CUSi&!TAIi&!PSAi&!PSDi&!IVAi&!IVDi&!CONi&!HISi&!TELi&!OTPi&!CURo&!ADMo&!DEVo&!CUSo&!TAIo&!PSAo&!PSDo&!IVAo&!IVDo&!CONo&!HISo&!TELo&!OTPo=r/"
  1134. L" /GOV&!CUR&!ADM&!DEV&!CUS&!TAI&!PSA&!PSD&!IVA&!IVD&!CON&!HIS&!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/FIN&PUB=r/ /FIN&CUS=r/ /FIN&IVA=r/"
  1171. L" /FIN&IVD=r/ /FIN&CON=r/ /FIN&TEL=r/ /FIN&OTP=r/ /FIN&SAMo=r/ /FIN&OTRo=r/ /FIN&UNRo=r/"
  1172. L" /FIN&PUBo=r/ /FIN&CUSo=r/ /FIN&IVAo=r/ /FIN&IVDo=r/ /FIN&CONo=r/ /FIN&TELo=r/ /FIN&OTPo=r/ /=a/"
  1173. ;
  1174. /* END high */
  1175. /* BEGIN NO COOKIES -- see warning above before changing */
  1176. const wchar_t achNoCookies1stParty[] =
  1177. L"IE6-P3PV1/settings: always=r";
  1178. const wchar_t achNoCookies3rdParty[] =
  1179. L"IE6-P3PV1/settings: always=r";
  1180. /* END NO COOKIES */
  1181. const wchar_t *SettingTemplate[] = {
  1182. achNoCookies1stParty,
  1183. achNoCookies3rdParty,
  1184. achHigh1stParty,
  1185. achHigh3rdParty,
  1186. achMedHigh1stParty,
  1187. achMedHigh3rdParty,
  1188. achMedium1stParty,
  1189. achMedium3rdParty,
  1190. achMedLow1stParty,
  1191. achMedLow3rdParty,
  1192. achLow1stParty,
  1193. achLow3rdParty,
  1194. };