@@ -101,13 +101,6 @@ void Log(__in_z const WCHAR *wszFormat, ...)
101
101
// Size in bytes of strong name token.
102
102
#define SN_SIZEOF_TOKEN 8
103
103
104
- enum StrongNameCachedCsp {
105
- None = -1 ,
106
- Sha1CachedCsp = 0 ,
107
- Sha2CachedCsp = Sha1CachedCsp + 1 ,
108
- CachedCspCount = Sha2CachedCsp + 1
109
- };
110
-
111
104
// We cache a couple of things on a per thread basis: the last error encountered
112
105
// and (potentially) CSP contexts. The following structure tracks these and is
113
106
// allocated lazily as needed.
@@ -119,12 +112,6 @@ struct SN_THREAD_CTX {
119
112
120
113
// Macro containing common code used at the start of most APIs.
121
114
#define SN_COMMON_PROLOG () do { \
122
- HRESULT __hr = InitStrongName (); \
123
- if (FAILED (__hr)) { \
124
- SetStrongNameErrorInfo (__hr); \
125
- retVal = FALSE ; \
126
- goto Exit; \
127
- } \
128
115
SetStrongNameErrorInfo (S_OK); \
129
116
} while (0 )
130
117
@@ -178,23 +165,6 @@ struct SN_THREAD_CTX {
178
165
179
166
#define SN_THE_SILVERLIGHT_KEYTOKEN () ((PublicKeyBlob*)g_rbTheSilverlightKeyToken)
180
167
181
- #ifdef FEATURE_WINDOWSPHONE
182
- // Microsoft.Phone.* key
183
- #define SN_THE_MICROSOFT_PHONE_KEYTOKEN () ((PublicKeyBlob*)g_rbTheMicrosoftPhoneKeyToken)
184
-
185
- #define SN_IS_THE_MICROSOFT_PHONE_KEY (_pk ) (SN_SIZEOF_KEY((PublicKeyBlob*)(_pk)) == sizeof (g_rbTheMicrosoftPhoneKey) && \
186
- memcmp ((_pk), g_rbTheMicrosoftPhoneKey, sizeof(g_rbTheMicrosoftPhoneKey)) == 0)
187
-
188
- // Microsoft.Xna.* key
189
- #define SN_THE_MICROSOFT_XNA_KEYTOKEN () ((PublicKeyBlob*)g_rbTheMicrosoftXNAKeyToken)
190
-
191
- #define SN_IS_THE_MICROSOFT_XNA_KEY (_pk ) (SN_SIZEOF_KEY((PublicKeyBlob*)(_pk)) == sizeof (g_rbTheMicrosoftXNAKey) && \
192
- memcmp ((_pk), g_rbTheMicrosoftXNAKey, sizeof(g_rbTheMicrosoftXNAKey)) == 0)
193
-
194
- #endif // FEATURE_WINDOWSPHONE
195
-
196
- #define InitStrongName () S_OK
197
-
198
168
199
169
// Free buffer allocated by routines below.
200
170
SNAPI_ (VOID) StrongNameFreeBuffer(BYTE *pbMemory) // [in] address of memory to free
@@ -294,7 +264,7 @@ SNAPI StrongNameTokenFromPublicKey(BYTE *pbPublicKeyBlob, // [in] publ
294
264
295
265
if (pbPublicKeyBlob == NULL )
296
266
SN_ERROR (E_POINTER);
297
- if (!StrongNameIsValidPublicKey (pbPublicKeyBlob, cbPublicKeyBlob, false ))
267
+ if (!StrongNameIsValidPublicKey (pbPublicKeyBlob, cbPublicKeyBlob))
298
268
SN_ERROR (CORSEC_E_INVALID_PUBLICKEY);
299
269
if (ppbStrongNameToken == NULL )
300
270
SN_ERROR (E_POINTER);
@@ -336,24 +306,6 @@ SNAPI StrongNameTokenFromPublicKey(BYTE *pbPublicKeyBlob, // [in] publ
336
306
goto Exit;
337
307
}
338
308
339
- #ifdef FEATURE_WINDOWSPHONE
340
-
341
- if (SN_IS_THE_MICROSOFT_PHONE_KEY (pbPublicKeyBlob))
342
- {
343
- memcpy_s (*ppbStrongNameToken, *pcbStrongNameToken, SN_THE_MICROSOFT_PHONE_KEYTOKEN (), SN_SIZEOF_TOKEN);
344
- retVal = TRUE ;
345
- goto Exit;
346
- }
347
-
348
- if (SN_IS_THE_MICROSOFT_XNA_KEY (pbPublicKeyBlob))
349
- {
350
- memcpy_s (*ppbStrongNameToken, *pcbStrongNameToken, SN_THE_MICROSOFT_XNA_KEYTOKEN (), SN_SIZEOF_TOKEN);
351
- retVal = TRUE ;
352
- goto Exit;
353
- }
354
-
355
- #endif // FEATURE_WINDOWSPHONE
356
-
357
309
// To compute the correct public key token, we need to make sure the public key blob
358
310
// was not padded with extra bytes that CAPI CryptImportKey would've ignored.
359
311
// Without this round trip, we would blindly compute the hash over the padded bytes
0 commit comments