grdp icon indicating copy to clipboard operation
grdp copied to clipboard

Does not work against Windows 2019

Open CaledoniaProject opened this issue 2 years ago • 10 comments

I believe the library is completely broken, does not work on any recent Windows version.

[INFO]2023/09/29 17:20:40 sec.go:721: sec ERROR_ALERT and ErrorCode: 7 [ERROR]2023/09/29 17:20:40 caps.go:647: unsupported Capability type 0x001e

CaledoniaProject avatar Sep 29 '23 09:09 CaledoniaProject

Are using latest version of code from master branch?

As far I see this works fine even with Windows Server 2022 with these security hardenings enabled: image

TLS 1.0, TLS 1.1 and 3DES cipher disabled (verified with sslscan): image

~Only challenge which I noticed is that this cannot be build with latest Go version so I used 1.18.10 instead of.~ EDIT: Building with latest Go version works fine as long you are using amd64 version instead of 386. However you need to have CGO support or include change from #26

olljanat avatar Nov 08 '23 19:11 olljanat

@CaledoniaProject Can you provide an example of your code on gist?

CaledoniaProject avatar Nov 08 '23 23:11 CaledoniaProject

I simply copied example code from integration test: https://github.com/tomatome/grdp/blob/b1e80faa1cf2df88e1b734eeb4d32239c3059457/client/client_test.go#L11-L19

olljanat avatar Nov 09 '23 05:11 olljanat

The test is broken

# go test github.com/tomatome/grdp/client -run TestClient
# github.com/tomatome/grdp/plugin/cliprdr
plugin/cliprdr/cliprdr.go:223:27: undefined: FILE_ATTRIBUTE_DIRECTORY
plugin/cliprdr/cliprdr.go:318:2: undefined: Control
plugin/cliprdr/cliprdr.go:328:5: undefined: ClipWatcher
plugin/cliprdr/cliprdr.go:434:4: c.withOpenClipboard undefined (type *CliprdrClient has no field or method withOpenClipboard)
plugin/cliprdr/cliprdr.go:435:7: undefined: EmptyClipboard
plugin/cliprdr/cliprdr.go:443:5: c.SendCliprdrMessage undefined (type *CliprdrClient has no field or method SendCliprdrMessage)
plugin/cliprdr/cliprdr.go:445:5: c.withOpenClipboard undefined (type *CliprdrClient has no field or method withOpenClipboard)
plugin/cliprdr/cliprdr.go:446:8: undefined: EmptyClipboard
plugin/cliprdr/cliprdr.go:451:5: undefined: SetClipboardData
plugin/cliprdr/cliprdr.go:475:37: undefined: GetFileInfo
plugin/cliprdr/cliprdr.go:475:37: too many errors
FAIL	github.com/tomatome/grdp/client [build failed]
FAIL

With cgo disabled

# CGO_ENABLED=0 go test github.com/tomatome/grdp/client -run TestClient
package github.com/tomatome/grdp/client
	imports github.com/tomatome/grdp/plugin: build constraints exclude all Go files in /home/tmp/grdp-master/plugin

CaledoniaProject avatar Nov 09 '23 08:11 CaledoniaProject

I mean, copy that code to new Go app and build normally.

olljanat avatar Nov 09 '23 09:11 olljanat

Same issue, the library is broken or incompatible with go1.21.4

../../../../go/pkg/mod/github.com/tomatome/[email protected]/client/rfb.go:28:14: c.vnc.Connect undefined (type *rfb.RFB has no field or method Connect)

CaledoniaProject avatar Nov 10 '23 08:11 CaledoniaProject

@tomatome Can you take a look at this?

CaledoniaProject avatar Nov 10 '23 08:11 CaledoniaProject

Same issue, the library is broken or incompatible with go1.21.4

../../../../go/pkg/mod/github.com/tomatome/[email protected]/client/rfb.go:28:14: c.vnc.Connect undefined (type *rfb.RFB has no field or method Connect)

Ah, this VNC error I did see also before disabled CGO. I would assume that it needs some very specific version of gcc. You can include #26 by adding this line to go.mod and running go mod tidy again:

replace github.com/tomatome/grdp => github.com/olljanat/grdp v0.0.0-20231109070701-045cbccd0693

olljanat avatar Nov 10 '23 08:11 olljanat

I've patched the code manually, your repo need to fix the mod name

go: github.com/olljanat/[email protected]: parsing go.mod: module declares its path as: github.com/tomatome/grdp but was required as: github.com/olljanat/grdp

CaledoniaProject avatar Nov 10 '23 09:11 CaledoniaProject

Don't change require command, just add that replace command. Like this:

require github.com/tomatome/grdp v0.1.1-0.20230622130233-b1e80faa1cf2
replace github.com/tomatome/grdp => github.com/olljanat/grdp v0.0.0-20231109070701-045cbccd0693

olljanat avatar Nov 10 '23 09:11 olljanat