System.Formats.Asn1.AsnContentException: 'The encoded length exceeds the maximum supported by this library (Int32.MaxValue).'
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 32/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- csharp
- Ambito
- networking, security
Direzione di ricerca
Inizia da Renci.SshNet.Security.RsaKey..ctor e dal percorso di PrivateKeyFile.Open mostrato nello stack trace. Riproduci il problema con la chiave privata generata da PuTTY e confronta la sua codifica con i formati attesi da questi punti di ingresso. Il lavoro è completato quando il formato della chiave supportato viene caricato correttamente oppure quando il suo stato di non supporto è chiaramente stabilito e coperto da un test di regressione appropriato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
System.Formats.Asn1.AsnContentException occurs when loading a private key file generated by PuTTY key generator.
PrivateKeyFile[] keyFiles = new[] { new PrivateKeyFile(PrivateKeyFilePath, PrivateKeyFilePassword) };
System.Formats.Asn1.AsnContentException
HResult=0x80131500
Message=The encoded length exceeds the maximum supported by this library (Int32.MaxValue).
Source=System.Formats.Asn1
StackTrace:
at System.Formats.Asn1.AsnDecoder.ReadLength(ReadOnlySpan`1 source, AsnEncodingRules ruleSet, Int32& bytesConsumed)
at System.Formats.Asn1.AsnDecoder.ReadTagAndLength(ReadOnlySpan`1 source, AsnEncodingRules ruleSet, Nullable`1& contentsLength, Int32& bytesRead)
at System.Formats.Asn1.AsnDecoder.ReadSequence(ReadOnlySpan`1 source, AsnEncodingRules ruleSet, Int32& contentOffset, Int32& contentLength, Int32& bytesConsumed, Nullable`1 expectedTag)
at System.Formats.Asn1.AsnReader.ReadSequence(Nullable`1 expectedTag)
at Renci.SshNet.Security.RsaKey..ctor(Byte[] privateKeyData)
at Renci.SshNet.PrivateKeyFile.Open(Stream privateKey, String passPhrase)
at Renci.SshNet.PrivateKeyFile..ctor(String fileName, String passPhrase, String certificateFileName)
at Renci.SshNet.PrivateKeyFile..ctor(String fileName, String passPhrase)
Changing the key produces a new error:
System.Formats.Asn1.AsnContentException: 'The provided data is tagged with 'ContextSpecific' class value '14', but it should have been 'Universal' class value '16'.'
at System.Formats.Asn1.AsnDecoder.CheckExpectedTag(Asn1Tag tag, Asn1Tag expectedTag, UniversalTagNumber tagNumber)
at System.Formats.Asn1.AsnDecoder.ReadSequence(ReadOnlySpan`1 source, AsnEncodingRules ruleSet, Int32& contentOffset, Int32& contentLength, Int32& bytesConsumed, Nullable`1 expectedTag)
at System.Formats.Asn1.AsnReader.ReadSequence(Nullable`1 expectedTag)
at Renci.SshNet.Security.RsaKey..ctor(Byte[] privateKeyData)
at Renci.SshNet.PrivateKeyFile.Open(Stream privateKey, String passPhrase)
at Renci.SshNet.PrivateKeyFile..ctor(String fileName, String passPhrase, String certificateFileName)
at Renci.SshNet.PrivateKeyFile..ctor(String fileName, String passPhrase)
- Lingua principale
- C#
- Stelle
- 4.4k
- Fork
- 993
- Merge medio
- 9g 21h
- PR unite (30g)
- 1
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sshnet/SSH.NET
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
-
Using SshClient on Linux under Wine throws System.Security.Cryptography.CryptographicException Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 67/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
Tutte le issue di sshnet/SSH.NET
Issue simili
-
CS0162 "Unreachable code detected" warning from a MSBuildTemp .tmp file in every game project Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Type: enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
apache/arrow-adbc#4809 ·
-
type/automation type/tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
microsoft/vscode-azurefunctions#5197 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
microsoft/microsoft-ui-reactor#1274 ·