jpillora / chisel

A fast TCP/UDP tunnel over HTTP
MIT License
12.77k stars 1.35k forks source link

Bump to Go 1.21 #440

Closed jpillora closed 1 year ago

jpillora commented 1 year ago
jpillora commented 1 year ago

Can you plz review @cmenginnz ?

jpillora commented 1 year ago

I’m thinking of switching keygenfile to use plain base 64, because PEM encoding is multi line and adds an extra step when passing it inline. I’m thinking ck-<n base64 chars> which would also make it easier to identify its inline - rather than a file path

cmenginnz commented 1 year ago

I’m thinking of switching keygenfile to use plain base 64, because PEM encoding is multi line and adds an extra step when passing it inline. I’m thinking ck-<n base64 chars> which would also make it easier to identify its inline - rather than a file path

The ssh.ParsePrivateKey(key) function actually supports RSA (PKCS#1), PKCS#8, DSA (OpenSSL), and ECDSA private keys. If we use a private file format here, we will lose the support of these algorithms and the existing tools such as openssl. Please let me know your decision and I'm willing to continue patching for it.

jpillora commented 1 year ago

I think we'd want the key parser to support both PEM and chisel-key format (ck-<163-base64-chars> drop the 2 equals)

cmenginnz commented 1 year ago

@jpillora I made a PR(https://github.com/jpillora/chisel/pull/441) to go121 branch that implements:

  1. --genkey generates a key file in CK format
  2. --keyfile accepts: 2.1 a file in CK format 2.2 a file in PEM formet 2.3 an inline key in CK format
jpillora commented 1 year ago

It took a while, but its in! Thanks for your help @cmenginnz 😄

jpillora commented 1 year ago

v1.9.0 releasing now https://github.com/jpillora/chisel/actions/runs/5908510975