{"record":{"id":"7513067ed8e1c471","repo":"shadow1ng/fscan","slug":"invalid-public-key-type","errorCode":null,"errorMessage":"invalid public key type","messagePattern":"invalid public key type","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"libs/grdp/core/socket.go","lineNumber":78,"sourceCode":"\treturn s.tlsConn.Handshake()\n}\n\ntype PublicKey struct {\n\tN *big.Int `asn1:\"explicit,tag:0\"` // modulus\n\tE int      `asn1:\"explicit,tag:1\"` // public exponent\n}\n\nfunc (s *SocketLayer) TlsPubKey() ([]byte, error) {\n\tif s.tlsConn == nil {\n\t\treturn nil, errors.New(\"TLS conn does not exist\")\n\t}\n\tcerts := s.tlsConn.ConnectionState().PeerCertificates\n\tif len(certs) == 0 {\n\t\treturn nil, errors.New(\"no peer certificates\")\n\t}\n\tpub, ok := certs[0].PublicKey.(*rsa.PublicKey)\n\tif !ok {\n\t\treturn nil, errors.New(\"invalid public key type\")\n\t}\n\treturn asn1ber.Marshal(*pub)\n}\n","sourceCodeStart":60,"sourceCodeEnd":82,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/libs/grdp/core/socket.go#L60-L82","documentation":"Raised in SocketLayer.TlsPubKey when the server certificate's public key is present but is not *rsa.PublicKey (e.g. an ECDSA/Ed25519 certificate), so it cannot be ASN.1-marshaled for RDP CredSSP key derivation, which expects RSA.","triggerScenarios":"Thrown at libs/grdp/core/socket.go:78 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry targeting a host whose TLS certificate uses an RSA key","Force an RSA-compatible cipher suite in the TLS config if the server supports both","Fall back to standard RDP security when NLA key exchange is impossible"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}