Remove ski creds specific code

This commit is contained in:
Melon 2022-03-13 10:22:53 +00:00
parent c86bc8d7e1
commit ea5b79d8d8
Signed by: melon
GPG Key ID: B0ADD5395BCDAAB6
3 changed files with 12 additions and 28 deletions

12
ca.go
View File

@ -11,16 +11,10 @@ import (
"time" "time"
) )
func MakeCaTls() (*CertGen, error) { func MakeCaTls(name pkix.Name, serialNumber *big.Int) (*CertGen, error) {
ca := &x509.Certificate{ ca := &x509.Certificate{
SerialNumber: big.NewInt(29052019), SerialNumber: serialNumber,
Subject: pkix.Name{ Subject: name,
Organization: []string{"Ski Creds CA"},
Country: []string{"GB"},
Province: []string{""},
Locality: []string{"London"},
CommonName: "ski-creds-ca",
},
NotBefore: time.Now(), NotBefore: time.Now(),
NotAfter: time.Now().AddDate(10, 0, 0), NotAfter: time.Now().AddDate(10, 0, 0),
IsCA: true, IsCA: true,

View File

@ -11,16 +11,10 @@ import (
"time" "time"
) )
func MakeClientTls() (*CertGen, error) { func MakeClientTls(name pkix.Name, serialNumber *big.Int) (*CertGen, error) {
cert := &x509.Certificate{ cert := &x509.Certificate{
SerialNumber: big.NewInt(29052019), SerialNumber: serialNumber,
Subject: pkix.Name{ Subject: name,
Organization: []string{"Ski Creds Client"},
Country: []string{"GB"},
Province: []string{""},
Locality: []string{"London"},
CommonName: "ski-creds-client",
},
NotBefore: time.Now(), NotBefore: time.Now(),
NotAfter: time.Now().AddDate(10, 0, 0), NotAfter: time.Now().AddDate(10, 0, 0),
SubjectKeyId: []byte{1, 2, 3, 4, 6}, SubjectKeyId: []byte{1, 2, 3, 4, 6},

View File

@ -8,20 +8,16 @@ import (
"crypto/x509/pkix" "crypto/x509/pkix"
"log" "log"
"math/big" "math/big"
"net"
"time" "time"
) )
func MakeServerTls(ca *CertGen) (*CertGen, error) { func MakeServerTls(ca *CertGen, name pkix.Name, serialNumber *big.Int, dnsNames []string, ipAddresses []net.IP) (*CertGen, error) {
cert := &x509.Certificate{ cert := &x509.Certificate{
SerialNumber: big.NewInt(29052019), SerialNumber: serialNumber,
Subject: pkix.Name{ Subject: name,
Organization: []string{"Ski Creds Server"}, DNSNames: dnsNames,
Country: []string{"GB"}, IPAddresses: ipAddresses,
Province: []string{""},
Locality: []string{"London"},
CommonName: "ski-creds-server",
},
DNSNames: []string{"panda.local"},
NotBefore: time.Now(), NotBefore: time.Now(),
NotAfter: time.Now().AddDate(10, 0, 0), NotAfter: time.Now().AddDate(10, 0, 0),
SubjectKeyId: []byte{1, 2, 3, 4, 6}, SubjectKeyId: []byte{1, 2, 3, 4, 6},