Troubleshooting — EricksonLopez.Security
L3StableNuGet: v1.0.0Local HEAD: v2.2.0AOT: Partial
Common analyzer diagnostics, key-purpose errors, and Native AOT exclusions in EricksonLopez.Security (1.0.0).
Roslyn Security Analyzers (ELS0001–ELS0005)
Section titled “Roslyn Security Analyzers (ELS0001–ELS0005)”ELS0001(Non-constant-time comparison): Replace==/SequenceEqualon secret digests or tokens withIConstantTimeComparer(ConstantTimeComparer.Shared).ELS0002(UndisposedSecretBuffer): Always bindSecretBuffer/ISecretBufferin ausingstatement soCryptographicOperations.ZeroMemoryexecutes deterministically; when decrypting viaISecretProtector, unwrapResult<byte[]>withUnprotectAsyncor dispose theISecretBufferdirectly without leaving aResult<ISecretBuffer>variable undisposed.ELS0003(Hardcoded secret): Pass secrets from configuration, environment variables, or KMS/Vault providers rather than inline string literals.ELS0005(Logging raw secret): Never passSecretBufferor plaintext secrets toILoggercalls.
Saml2,XmlDSig,GoogleCloud,OpenTelemetry: These 4 runtime packages setIsAotCompatible=false; keep them on JIT services whileWebAuthn.Fido2andWebAuthn.Fido2.Mds3run cleanly on Native AOT.SecurityError.InvalidKey: Activate a key withKeyPurpose.SecretProtection(orKeyPurpose.Encryption) before callingISecretProtector.ProtectAsync.