Skip to content

Commit

Permalink
remove obsolete code
Browse files Browse the repository at this point in the history
  • Loading branch information
Zambiorix committed Aug 23, 2024
1 parent 0a92065 commit 3b9028f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
- name: Go Release Binary
uses: ngs/[email protected].2
uses: ngs/[email protected].3
10 changes: 3 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"encoding/pem"
"flag"
"fmt"
"io/ioutil"
"log"
"math"
"math/big"
Expand All @@ -37,8 +36,8 @@ type issuer struct {
}

func getIssuer(keyFile, certFile string) (*issuer, error) {
keyContents, keyErr := ioutil.ReadFile(keyFile)
certContents, certErr := ioutil.ReadFile(certFile)
keyContents, keyErr := os.ReadFile(keyFile)
certContents, certErr := os.ReadFile(certFile)
if os.IsNotExist(keyErr) && os.IsNotExist(certErr) {
err := makeIssuer(keyFile, certFile)
if err != nil {
Expand Down Expand Up @@ -108,9 +107,6 @@ func makeKey(filename string) (*rsa.PrivateKey, error) {
return nil, err
}
der := x509.MarshalPKCS1PrivateKey(key)
if err != nil {
return nil, err
}
file, err := os.OpenFile(filename, os.O_CREATE|os.O_EXCL|os.O_WRONLY, 0600)
if err != nil {
return nil, err
Expand Down Expand Up @@ -192,7 +188,7 @@ func publicKeysEqual(a, b interface{}) (bool, error) {
if err != nil {
return false, err
}
return bytes.Compare(aBytes, bBytes) == 0, nil
return bytes.Equal(aBytes, bBytes), nil
}

func calculateSKID(pubKey crypto.PublicKey) ([]byte, error) {
Expand Down

0 comments on commit 3b9028f

Please sign in to comment.