Skip to content

Instantly share code, notes, and snippets.

@kryzhovnik
Created November 2, 2021 08:33
Show Gist options
  • Save kryzhovnik/370c0d5d43d2810b18e8e9e620c5f60d to your computer and use it in GitHub Desktop.
Save kryzhovnik/370c0d5d43d2810b18e8e9e620c5f60d to your computer and use it in GitHub Desktop.
./cpCryptGost "message to sign"  main ±
2021/11/02 12:32:34 Error getting response: Post "http://localhost:8080/signature": EOF
./cpCryptGost -s  main ±
2021/11/02 12:32:25 Serving on localhost:8080
E[-2146893798][NewHash: CryptAcquireContext]
2021/11/02 12:32:34 http: panic serving 127.0.0.1:54288: error code: -1
goroutine 22 [running]:
net/http.(*conn).serve.func1()
/usr/local/Cellar/go/1.17.2/libexec/src/net/http/server.go:1801 +0xb9
panic({0x426ab20, 0xc000098e60})
/usr/local/Cellar/go/1.17.2/libexec/src/runtime/panic.go:1047 +0x266
github.com/number571/go-cryptopro/gost_r_34_11_2012.New(0x50)
/tmp/cpCryptGost/vendor/github.com/number571/go-cryptopro/gost_r_34_11_2012/gost.go:82 +0x35b
github.com/number571/go-cryptopro/gost_r_34_11_2012.newHasher.func1()
/tmp/cpCryptGost/vendor/github.com/number571/go-cryptopro/gost_r_34_11_2012/gost.go:235 +0x1d
crypto/hmac.New(0xc0000b4460, {0xc0000b4418, 0x8, 0x8})
/usr/local/Cellar/go/1.17.2/libexec/src/crypto/hmac/hmac.go:130 +0x47
github.com/number571/go-cryptopro/gost_r_34_11_2012.SumHMAC(0x40, {0xc0000b4418, 0x8, 0x8}, {0xc0000b4450, 0x1, 0x1})
/tmp/cpCryptGost/vendor/github.com/number571/go-cryptopro/gost_r_34_11_2012/gost.go:228 +0x4f
github.com/number571/go-cryptopro/gost_r_34_10_2012.(*Config).wrap(0xc0000fb970)
/tmp/cpCryptGost/vendor/github.com/number571/go-cryptopro/gost_r_34_10_2012/init.go:78 +0x91
github.com/number571/go-cryptopro/gost_r_34_10_2012.NewConfig(...)
/tmp/cpCryptGost/vendor/github.com/number571/go-cryptopro/gost_r_34_10_2012/init.go:69
main.sign(0xc000098de0)
/tmp/cpCryptGost/sign.go:18 +0xdd
main.signHandler({0x43184c0, 0xc0001040e0}, 0xc00010e000)
/tmp/cpCryptGost/server.go:37 +0x1bf
net/http.HandlerFunc.ServeHTTP(0x4261340, {0x43184c0, 0xc0001040e0}, 0x4064102)
/usr/local/Cellar/go/1.17.2/libexec/src/net/http/server.go:2046 +0x2f
net/http.(*ServeMux).ServeHTTP(0x0, {0x43184c0, 0xc0001040e0}, 0xc00010e000)
/usr/local/Cellar/go/1.17.2/libexec/src/net/http/server.go:2424 +0x149
net/http.serverHandler.ServeHTTP({0x4317820}, {0x43184c0, 0xc0001040e0}, 0xc00010e000)
/usr/local/Cellar/go/1.17.2/libexec/src/net/http/server.go:2878 +0x43b
net/http.(*conn).serve(0xc0000bc960, {0x43197c0, 0xc00009af60})
/usr/local/Cellar/go/1.17.2/libexec/src/net/http/server.go:1929 +0xb08
created by net/http.(*Server).Serve
/usr/local/Cellar/go/1.17.2/libexec/src/net/http/server.go:3033 +0x4e8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment