terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
X509ChainImplMono.cs
Go to the documentation of this file.
1using System;
4
6{
7 // Token: 0x02000113 RID: 275
9 {
10 // Token: 0x06000659 RID: 1625 RVA: 0x00017788 File Offset: 0x00015988
12 {
13 this.location = StoreLocation.CurrentUser;
14 }
15
16 // Token: 0x1700015B RID: 347
17 // (get) Token: 0x0600065A RID: 1626 RVA: 0x000177A4 File Offset: 0x000159A4
18 public override bool IsValid
19 {
20 get
21 {
22 return true;
23 }
24 }
25
26 // Token: 0x1700015C RID: 348
27 // (get) Token: 0x0600065B RID: 1627 RVA: 0x000177B4 File Offset: 0x000159B4
29 {
30 get
31 {
32 return this.elements;
33 }
34 }
35
36 // Token: 0x1700015D RID: 349
37 // (get) Token: 0x0600065C RID: 1628 RVA: 0x000177C8 File Offset: 0x000159C8
39 {
40 get
41 {
42 return this.policy;
43 }
44 }
45
46 // Token: 0x0600065D RID: 1629 RVA: 0x000177DC File Offset: 0x000159DC
47 public override void AddStatus(X509ChainStatusFlags error)
48 {
49 }
50
51 // Token: 0x0600065E RID: 1630 RVA: 0x000177EC File Offset: 0x000159EC
52 [MonoTODO("Not totally RFC3280 compliant, but neither is MS implementation...")]
83
84 // Token: 0x0600065F RID: 1631 RVA: 0x000178B4 File Offset: 0x00015AB4
85 public override void Reset()
86 {
88 if (array == null || array != null)
89 {
90 }
94 if (x509Store != null)
95 {
97 }
99 if (x509Store2 != null)
100 {
102 }
104 if (x509Store3 != null)
105 {
107 }
109 if (x509Store4 != null)
110 {
112 }
113 }
114
115 // Token: 0x1700015E RID: 350
116 // (get) Token: 0x06000660 RID: 1632 RVA: 0x00017930 File Offset: 0x00015B30
118 {
119 get
120 {
121 /*
122An exception occurred when decompiling this method (06000660)
123
124ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Security.Cryptography.X509Certificates.X509Certificate2Collection System.Security.Cryptography.X509Certificates.X509ChainImplMono::get_Roots()
125
126 ---> System.Exception: Basic block has to end with unconditional control flow.
127{
128 Block_0:
129 stloc:X509Store(var_0_0E, callgetter:X509Store(X509ChainImplMono::get_LMRootStore, ldloc:X509ChainImplMono(this)))
130 stloc:StoreLocation(var_1_15, ldfld:StoreLocation(X509ChainImplMono::location, ldloc:X509ChainImplMono(this)))
131 stloc:X509Certificate2Collection(var_2_21, callgetter:X509Certificate2Collection(X509Store::get_Certificates, callgetter:X509Store(X509ChainImplMono::get_UserRootStore, ldloc:X509ChainImplMono(this))))
132 stloc:X509Certificate2Collection(var_3_28, callgetter:X509Certificate2Collection(X509Store::get_Certificates, ldloc:X509Store(var_0_0E)))
133}
134
135 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
136 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
137 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
138 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
139 --- End of inner exception stack trace ---
140 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
141 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
142*/;
143 }
144 }
145
146 // Token: 0x1700015F RID: 351
147 // (get) Token: 0x06000661 RID: 1633 RVA: 0x00017968 File Offset: 0x00015B68
149 {
150 get
151 {
152 /*
153An exception occurred when decompiling this method (06000661)
154
155ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Security.Cryptography.X509Certificates.X509Certificate2Collection System.Security.Cryptography.X509Certificates.X509ChainImplMono::get_CertificateAuthorities()
156
157 ---> System.Exception: Basic block has to end with unconditional control flow.
158{
159 Block_0:
160 stloc:X509Store(var_0_0E, callgetter:X509Store(X509ChainImplMono::get_LMCAStore, ldloc:X509ChainImplMono(this)))
161 stloc:StoreLocation(var_1_15, ldfld:StoreLocation(X509ChainImplMono::location, ldloc:X509ChainImplMono(this)))
162 stloc:X509Certificate2Collection(var_2_21, callgetter:X509Certificate2Collection(X509Store::get_Certificates, callgetter:X509Store(X509ChainImplMono::get_UserCAStore, ldloc:X509ChainImplMono(this))))
163 stloc:X509Certificate2Collection(var_3_28, callgetter:X509Certificate2Collection(X509Store::get_Certificates, ldloc:X509Store(var_0_0E)))
164}
165
166 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
167 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
168 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
169 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
170 --- End of inner exception stack trace ---
171 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
172 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
173*/;
174 }
175 }
176
177 // Token: 0x17000160 RID: 352
178 // (get) Token: 0x06000662 RID: 1634 RVA: 0x000179A0 File Offset: 0x00015BA0
180 {
181 get
182 {
183 if (this.root_store == null)
184 {
185 }
186 return this.root_store;
187 }
188 }
189
190 // Token: 0x17000161 RID: 353
191 // (get) Token: 0x06000663 RID: 1635 RVA: 0x000179C0 File Offset: 0x00015BC0
193 {
194 get
195 {
196 if (this.user_root_store == null)
197 {
198 }
199 return this.user_root_store;
200 }
201 }
202
203 // Token: 0x17000162 RID: 354
204 // (get) Token: 0x06000664 RID: 1636 RVA: 0x000179E0 File Offset: 0x00015BE0
206 {
207 get
208 {
209 if (this.ca_store == null)
210 {
211 }
212 return this.ca_store;
213 }
214 }
215
216 // Token: 0x17000163 RID: 355
217 // (get) Token: 0x06000665 RID: 1637 RVA: 0x00017A00 File Offset: 0x00015C00
219 {
220 get
221 {
222 if (this.user_ca_store == null)
223 {
224 }
225 return this.user_ca_store;
226 }
227 }
228
229 // Token: 0x17000164 RID: 356
230 // (get) Token: 0x06000666 RID: 1638 RVA: 0x00017A20 File Offset: 0x00015C20
245
246 // Token: 0x06000667 RID: 1639 RVA: 0x00017A58 File Offset: 0x00015C58
248 {
249 this.elements.Add(certificate);
250 bool flag = this.IsChainComplete(certificate);
251 X509Certificate2 x509Certificate = this.FindParent(certificate);
252 if (x509Certificate != null)
253 {
254 bool flag2 = this.elements.Contains(x509Certificate);
256 bool flag3 = this.Roots.Contains(x509Certificate);
260 x509ChainElement.compressed_status_flags = compressed_status_flags;
261 return;
262 }
263 }
264
265 // Token: 0x06000668 RID: 1640 RVA: 0x00017AD4 File Offset: 0x00015CD4
267 {
268 X509Certificate2 x509Certificate;
269 if (c.Count != 0)
270 {
271 long num = 0L;
272 x509Certificate = c[(int)num];
273 return x509Certificate;
274 }
275 return x509Certificate;
276 }
277
278 // Token: 0x06000669 RID: 1641 RVA: 0x00017B40 File Offset: 0x00015D40
297
298 // Token: 0x0600066A RID: 1642 RVA: 0x00017BAC File Offset: 0x00015DAC
299 private bool IsChainComplete(X509Certificate2 certificate)
300 {
301 int version = certificate.Version;
302 string text;
303 bool flag = string.IsNullOrEmpty(text);
305 bool flag2 = string.IsNullOrEmpty(authorityKeyIdentifier);
306 return true;
307 }
308
309 // Token: 0x0600066B RID: 1643 RVA: 0x00017BE8 File Offset: 0x00015DE8
310 private bool IsSelfIssued(X509Certificate2 certificate)
311 {
312 string issuer = certificate.Issuer;
313 string subject = certificate.Subject;
314 return issuer == subject;
315 }
316
317 // Token: 0x0600066C RID: 1644 RVA: 0x00017C0C File Offset: 0x00015E0C
333
334 // Token: 0x0600066D RID: 1645 RVA: 0x00017C8C File Offset: 0x00015E8C
335 private void Process(int n)
336 {
338 X509Certificate2 certificate = x509ChainElement.certificate;
341 if (monoCertificate == null)
342 {
346 }
348 if (asymmetricAlgorithm != null)
349 {
350 return;
351 }
352 AsymmetricAlgorithm key = certificate.PublicKey.Key;
353 if (key != null)
354 {
355 bool flag = X509Helper2.GetMonoCertificate(certificate).VerifySignature(key);
356 }
357 if (asymmetricAlgorithm != null)
358 {
360 }
361 X509ChainStatusFlags compressed_status_flags = x509ChainElement.compressed_status_flags;
362 x509ChainElement.compressed_status_flags = compressed_status_flags;
364 DateTime notBefore = certificate.GetNotBefore();
366 DateTime notAfter = certificate.GetNotAfter();
369 if (asymmetricAlgorithm != null)
370 {
376 return;
377 }
378 }
379
380 // Token: 0x0600066E RID: 1646 RVA: 0x00017D88 File Offset: 0x00015F88
381 private void PrepareForNextCertificate(int n)
382 {
384 X509Certificate2 certificate = x509ChainElement.certificate;
387 AsymmetricAlgorithm key = certificate.PublicKey.Key;
389 if (certificate.Extensions["2.5.29.19"] != null)
390 {
391 }
392 int version = certificate.Version;
393 }
394
395 // Token: 0x0600066F RID: 1647 RVA: 0x00017E74 File Offset: 0x00016074
406
407 // Token: 0x06000670 RID: 1648 RVA: 0x00017EB4 File Offset: 0x000160B4
409 {
411 bool flag = enumerator.MoveNext();
413 if (x509Extension._critical)
414 {
416 bool flag2 = value == "2.5.29.15";
417 bool flag3 = value == "2.5.29.19";
418 X509ChainStatusFlags compressed_status_flags = element.compressed_status_flags;
419 element.compressed_status_flags = compressed_status_flags;
420 }
421 bool flag4 = enumerator.MoveNext();
422 }
423
424 // Token: 0x06000671 RID: 1649 RVA: 0x00017F28 File Offset: 0x00016128
426 {
427 if (pubkey != null)
428 {
429 return X509Helper2.GetMonoCertificate(signed).VerifySignature(pubkey);
430 }
431 }
432
433 // Token: 0x06000672 RID: 1650 RVA: 0x00017F48 File Offset: 0x00016148
434 private string GetSubjectKeyIdentifier(X509Certificate2 certificate)
435 {
436 if (certificate.Extensions["2.5.29.14"] != null)
437 {
438 }
439 string text;
440 return text;
441 }
442
443 // Token: 0x06000673 RID: 1651 RVA: 0x00017F68 File Offset: 0x00016168
444 private static string GetAuthorityKeyIdentifier(X509Certificate2 certificate)
445 {
446 X509Certificate x509Certificate;
447 return X509ChainImplMono.GetAuthorityKeyIdentifier(x509Certificate.extensions["2.5.29.35"]);
448 }
449
450 // Token: 0x06000674 RID: 1652 RVA: 0x00017F8C File Offset: 0x0001618C
456
457 // Token: 0x06000675 RID: 1653 RVA: 0x00017FA0 File Offset: 0x000161A0
459 {
460 byte[] array;
461 while (array == null)
462 {
463 }
464 }
465
466 // Token: 0x06000676 RID: 1654 RVA: 0x00017FB4 File Offset: 0x000161B4
468 {
469 }
470
471 // Token: 0x06000677 RID: 1655 RVA: 0x0001802C File Offset: 0x0001622C
480
481 // Token: 0x06000678 RID: 1656 RVA: 0x00018064 File Offset: 0x00016264
483 {
484 if (ca_cert.Extensions["2.5.29.15"] != null)
485 {
486 }
487 X509Crl x509Crl = this.FindCrl(ca_cert);
488 if (x509Crl == null)
489 {
490 return X509ChainStatusFlags.RevocationStatusUnknown;
491 }
492 AsymmetricAlgorithm key = ca_cert.PublicKey.Key;
493 bool flag = x509Crl.VerifySignature(key);
496 if (crlEntry != null)
497 {
498 DateTime revocationDate = crlEntry.revocationDate;
500 return X509ChainStatusFlags.Revoked;
501 }
502 DateTime nextUpdate = x509Crl.nextUpdate;
504 return X509ChainStatusFlags.RevocationStatusUnknown;
505 }
506
507 // Token: 0x06000679 RID: 1657 RVA: 0x000180E0 File Offset: 0x000162E0
508 private static X509Crl CheckCrls(string subject, string ski, X509Store store)
509 {
511 if (ski != null)
512 {
513 if (arrayList != null)
514 {
515 }
516 object[] items = arrayList._items;
517 int stringLength = subject._stringLength;
518 if (stringLength != 0)
519 {
520 if (stringLength == 0)
521 {
522 }
523 string text;
524 bool flag = subject == text;
525 }
526 }
527 long num = 0L;
528 if (arrayList != null)
529 {
530 }
531 if (num == 0L)
532 {
533 throw new InvalidCastException();
534 }
535 throw new OutOfMemoryException();
536 }
537
538 // Token: 0x0600067A RID: 1658 RVA: 0x0001813C File Offset: 0x0001633C
540 {
541 for (;;)
542 {
544 X509Store store = this.LMCAStore.store;
545 string text;
546 string text2;
547 if (X509ChainImplMono.CheckCrls(text, text2, store) == null)
548 {
550 X509Store store2 = this.UserCAStore.store;
551 if (X509ChainImplMono.CheckCrls(text, text2, store2) == null)
552 {
554 if (X509ChainImplMono.CheckCrls(text, text2, store3) == null)
555 {
558 if (X509ChainImplMono.CheckCrls(text, text2, store4) == null)
559 {
560 return;
561 }
562 }
563 }
564 }
565 }
566 }
567
568 // Token: 0x0600067B RID: 1659 RVA: 0x000181C0 File Offset: 0x000163C0
570 {
571 IEnumerator enumerator = crl.extensions.GetEnumerator();
572 if (enumerator != null)
573 {
574 }
575 bool flag;
576 return flag;
577 }
578
579 // Token: 0x0600067C RID: 1660 RVA: 0x00018204 File Offset: 0x00016404
581 {
582 IEnumerator enumerator = entry.extensions.GetEnumerator();
583 if (enumerator != null)
584 {
585 }
586 bool flag;
587 return flag;
588 }
589
590 // Token: 0x0600067D RID: 1661 RVA: 0x00018248 File Offset: 0x00016448
591 // Note: this type is marked as 'beforefieldinit'.
593 {
594 }
595
596 // Token: 0x0400050E RID: 1294
598
599 // Token: 0x0400050F RID: 1295
601
602 // Token: 0x04000510 RID: 1296
604
605 // Token: 0x04000511 RID: 1297
607
608 // Token: 0x04000512 RID: 1298
609 private static X509ChainStatus[] Empty;
610
611 // Token: 0x04000513 RID: 1299
612 private int max_path_length;
613
614 // Token: 0x04000514 RID: 1300
616
617 // Token: 0x04000515 RID: 1301
619
620 // Token: 0x04000516 RID: 1302
622
623 // Token: 0x04000517 RID: 1303
625
626 // Token: 0x04000518 RID: 1304
628
629 // Token: 0x04000519 RID: 1305
631
632 // Token: 0x0400051A RID: 1306
634
635 // Token: 0x0400051B RID: 1307
637
638 // Token: 0x0400051C RID: 1308
640
641 // Token: 0x0400051D RID: 1309
643 }
644}
class f__AnonymousType0<< Count > j__TPar
X509Crl.X509CrlEntry GetCrlEntry(X509Certificate x509)
Definition X509Crl.cs:246
bool VerifySignature(X509Certificate x509)
Definition X509Crl.cs:270
static bool AreEqual(X500DistinguishedName name1, X500DistinguishedName name2)
X509Certificate2Collection Find(X509FindType findType, object findValue, bool validOnly)
X509Certificate2 SelectBestFromCollection(X509Certificate2 child, X509Certificate2Collection c)
X509ChainStatusFlags CheckRevocation(X509Certificate2 certificate, int ca, bool online)
X509ChainStatusFlags BuildChainFrom(X509Certificate2 certificate)
bool IsSignedWith(X509Certificate2 signed, AsymmetricAlgorithm pubkey)
static string GetAuthorityKeyIdentifier(X509Certificate2 certificate)
static X509Crl CheckCrls(string subject, string ski, X509Store store)
X509Certificate2 FindParent(X509Certificate2 certificate)
X509ChainStatusFlags CheckRevocation(X509Certificate2 certificate, X509Certificate2 ca_cert, bool online)
static X509Certificate GetMonoCertificate(X509Certificate2 certificate)
static string GetInformation(X509ChainStatusFlags flags)