CLI doesn't work when remote specified with a port

Bug #1891256 reported by Ben Doyle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
golang-github-cloudflare-cfssl (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hi folks,

OS: Ubuntu 20.04 LTS
Apt info:
Package: golang-cfssl
Version: 1.2.0+git20160825.89.7fb22c8-3
Built-Using: golang-1.8 (= 1.8.1-1ubuntu3), golang-github-cloudflare-go-metrics (= 0.0~git20151117.0.6a9aea3-2), golang-github-cloudflare-redoctober (= 0.0~git20161017.0.78e9720-2), golang-github-daaku-go.zipexe (= 0.0~git20150329.0.a5fe243-2), golang-github-geertjohan-go.rice (= 0.0~git20160123.0.0f3f5fd-3), golang-github-go-sql-driver-mysql (= 1.3-1), golang-github-google-certificate-transparency (= 0.0~git20160709.0.0f6e3d1~ds1-2), golang-github-jmhodges-clock (= 1.0-3), golang-github-jmoiron-sqlx (= 1.1+git20160206.61.398dd58-2), golang-github-kisielk-sqlstruct (= 0.0~git20150917.0.0b86a3e-2), golang-github-kisom-goutils (= 0.0~git20161101.0.858c9cb-2), golang-github-lib-pq (= 0.0~git20151007.0.ffe986a-1), golang-github-mattn-go-sqlite3 (= 1.1.0~dfsg1-3ubuntu1), golang-go.crypto (= 1:0.0~git20170407.0.55a552f-1ubuntu1), golang-golang-x-net-dev (= 1:0.0+git20170114.0.f249948+dfsg-0ubuntu2), golang-osext (= 0.0~git20170309.0.9d302b5-1)
Priority: extra
Section: universe/devel
Source: golang-github-cloudflare-cfssl
Origin: Ubuntu
Maintainer: Ubuntu Developers <email address hidden>
Original-Maintainer: Debian Go Packaging Team <email address hidden>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 37.0 MB
Depends: libc6 (>= 2.4), libsqlite3-0 (>= 3.7.15)
Homepage: https://github.com/cloudflare/cfssl
Download-Size: 5856 kB
APT-Manual-Installed: yes
APT-Sources: http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
Description: CloudFlare's PKI and TLS toolkit

Info Command:
Expected behaviour: the command "$ cfssl info -remote ipaddress:port" to return info on remote
Actual behaviour:
$ cfssl info -remote 172.17.0.2:8888
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x702a2e]

goroutine 1 [running]:
github.com/cloudflare/cfssl/cli/info.getInfoFromRemote(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
 /build/golang-github-cloudflare-cfssl-pInTHY/golang-github-cloudflare-cfssl-1.2.0+git20160825.89.7fb22c8/obj-x86_64-linux-gnu/src/github.com/cloudflare/cfssl/cli/info/info.go:45 +0x20e
github.com/cloudflare/cfssl/cli/info.infoMain(0xc420072130, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
 /build/golang-github-cloudflare-cfssl-pInTHY/golang-github-cloudflare-cfssl-1.2.0+git20160825.89.7fb22c8/obj-x86_64-linux-gnu/src/github.com/cloudflare/cfssl/cli/info/info.go:84 +0x313
github.com/cloudflare/cfssl/cli.Start(0xc420071e90, 0xc420071e90, 0xc420047f68)
 /build/golang-github-cloudflare-cfssl-pInTHY/golang-github-cloudflare-cfssl-1.2.0+git20160825.89.7fb22c8/obj-x86_64-linux-gnu/src/github.com/cloudflare/cfssl/cli/cli.go:142 +0x329
main.main()
 /build/golang-github-cloudflare-cfssl-pInTHY/golang-github-cloudflare-cfssl-1.2.0+git20160825.89.7fb22c8/obj-x86_64-linux-gnu/src/github.com/cloudflare/cfssl/cmd/cfssl/cfssl.go:78 +0x7c7

Actual behaviour without port ($ cfssl info -remote 172.17.0.2) works fine.

Gencert Command (with port):
$ cfssl gencert -remote 172.17.0.2:8888 csr.json
2020/08/12 01:25:02 [INFO] generate received request
2020/08/12 01:25:02 [INFO] received CSR
2020/08/12 01:25:02 [INFO] generating key: rsa-4096
2020/08/12 01:25:06 [INFO] encoded CSR
{"code":5300,"message":"failed to connect to remote"}

Gencert Command (without):
$ cfssl gencert -remote 172.17.0.2 csr.json
2020/08/12 01:26:12 [INFO] generate received request
2020/08/12 01:26:12 [INFO] received CSR
2020/08/12 01:26:12 [INFO] generating key: rsa-4096
...
(... works as expected...)

I'm not having this issue locally when I've built the tool with versions of Go > 1.12+.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.