Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump github.com/slackhq/nebula from 1.8.2 to 1.9.3 #1190

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions command/ca/renew.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@
return nil, errors.Wrap(err, "error renewing certificate")
}

if resp.CertChainPEM == nil || len(resp.CertChainPEM) == 0 {
if len(resp.CertChainPEM) == 0 {

Check warning on line 475 in command/ca/renew.go

View check run for this annotation

Codecov / codecov/patch

command/ca/renew.go#L475

Added line #L475 was not covered by tests
resp.CertChainPEM = []api.Certificate{resp.ServerPEM, resp.CaPEM}
}
var data []byte
Expand Down Expand Up @@ -503,7 +503,7 @@
if err != nil {
return nil, errors.Wrap(err, "error rekeying certificate")
}
if resp.CertChainPEM == nil || len(resp.CertChainPEM) == 0 {
if len(resp.CertChainPEM) == 0 {

Check warning on line 506 in command/ca/renew.go

View check run for this annotation

Codecov / codecov/patch

command/ca/renew.go#L506

Added line #L506 was not covered by tests
resp.CertChainPEM = []api.Certificate{resp.ServerPEM, resp.CaPEM}
}
var data []byte
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/smallstep/cli

go 1.21
go 1.22.0

require (
github.com/Microsoft/go-winio v0.6.2
Expand All @@ -14,7 +14,7 @@ require (
github.com/manifoldco/promptui v0.9.0
github.com/pkg/errors v0.9.1
github.com/pquerna/otp v1.4.0
github.com/slackhq/nebula v1.8.2
github.com/slackhq/nebula v1.9.3
github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262
github.com/smallstep/certificates v0.27.2
github.com/smallstep/certinfo v1.12.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5I
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/slackhq/nebula v1.8.2 h1:9lpJlivzjBPWxs9Y2tQqmJ1cP6hq+3kIodw021t3LrQ=
github.com/slackhq/nebula v1.8.2/go.mod h1:SVVwnlGdmLg387U0XQMOSHRrD3VlJeXqd2/x/w/vxPs=
github.com/slackhq/nebula v1.9.3 h1:WK5Oipy4NsVfNm41pywGmdy048F8RRkfSRG+lPHxcJQ=
github.com/slackhq/nebula v1.9.3/go.mod h1:PMJer5rZe0H/O+kUiKOL9AJ/pL9+ryzNXtSN7ABfjfM=
github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262 h1:unQFBIznI+VYD1/1fApl1A+9VcBk+9dcqGfnePY87LY=
github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262/go.mod h1:MyOHs9Po2fbM1LHej6sBUT8ozbxmMOFG+E+rx/GSGuc=
github.com/smallstep/certificates v0.27.2 h1:MrSJvJviS9pCUtGYYguYyB1VQzZBmkL6ngLQZfVwRqU=
Expand Down
48 changes: 26 additions & 22 deletions internal/crlutil/crl_extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,106 +85,110 @@
type Extension struct {
Name string `json:"-"`
Details []string `json:"-"`
json map[string]interface{}
json map[string]any
}

func (e *Extension) MarshalJSON() ([]byte, error) {
return json.Marshal(e.json)
}

func (e *Extension) AddDetailf(format string, args ...interface{}) {
func (e *Extension) AddDetailf(format string, args ...any) {

Check warning on line 95 in internal/crlutil/crl_extensions.go

View check run for this annotation

Codecov / codecov/patch

internal/crlutil/crl_extensions.go#L95

Added line #L95 was not covered by tests
e.Details = append(e.Details, fmt.Sprintf(format, args...))
}

func (e *Extension) AddDetail(detail string) {
e.Details = append(e.Details, detail)

Check warning on line 100 in internal/crlutil/crl_extensions.go

View check run for this annotation

Codecov / codecov/patch

internal/crlutil/crl_extensions.go#L99-L100

Added lines #L99 - L100 were not covered by tests
}

func newExtension(e pkix.Extension) Extension {
var ext Extension
switch {
case e.Id.Equal(oidExtensionReasonCode):
ext.Name = "X509v3 CRL Reason Code:"
value := parseReasonCode(e.Value)
ext.AddDetailf(value)
ext.json = map[string]interface{}{
ext.AddDetail(value)
ext.json = map[string]any{

Check warning on line 110 in internal/crlutil/crl_extensions.go

View check run for this annotation

Codecov / codecov/patch

internal/crlutil/crl_extensions.go#L109-L110

Added lines #L109 - L110 were not covered by tests
"crl_reason_code": value,
}

case e.Id.Equal(oidExtensionCRLNumber):
ext.Name = "X509v3 CRL Number:"
var n *big.Int
if _, err := asn1.Unmarshal(e.Value, &n); err == nil {
ext.AddDetailf(n.String())
ext.json = map[string]interface{}{
ext.AddDetail(n.String())
ext.json = map[string]any{

Check warning on line 119 in internal/crlutil/crl_extensions.go

View check run for this annotation

Codecov / codecov/patch

internal/crlutil/crl_extensions.go#L118-L119

Added lines #L118 - L119 were not covered by tests
"crl_number": n.String(),
}
} else {
ext.AddDetailf(sanitizeBytes(e.Value))
ext.json = map[string]interface{}{
ext.AddDetail(sanitizeBytes(e.Value))
ext.json = map[string]any{

Check warning on line 124 in internal/crlutil/crl_extensions.go

View check run for this annotation

Codecov / codecov/patch

internal/crlutil/crl_extensions.go#L123-L124

Added lines #L123 - L124 were not covered by tests
"crl_number": e.Value,
}
}

case e.Id.Equal(oidExtensionAuthorityKeyID):
var v authorityKeyID
ext.Name = "X509v3 Authority Key Identifier:"
ext.json = map[string]interface{}{
ext.json = map[string]any{

Check warning on line 132 in internal/crlutil/crl_extensions.go

View check run for this annotation

Codecov / codecov/patch

internal/crlutil/crl_extensions.go#L132

Added line #L132 was not covered by tests
"authority_key_id": hex.EncodeToString(e.Value),
}
if _, err := asn1.Unmarshal(e.Value, &v); err == nil {
var s string
for _, b := range v.ID {
s += fmt.Sprintf(":%02X", b)
}
ext.AddDetailf("keyid" + s)
ext.AddDetail("keyid" + s)

Check warning on line 140 in internal/crlutil/crl_extensions.go

View check run for this annotation

Codecov / codecov/patch

internal/crlutil/crl_extensions.go#L140

Added line #L140 was not covered by tests
} else {
ext.AddDetailf(sanitizeBytes(e.Value))
ext.AddDetail(sanitizeBytes(e.Value))

Check warning on line 142 in internal/crlutil/crl_extensions.go

View check run for this annotation

Codecov / codecov/patch

internal/crlutil/crl_extensions.go#L142

Added line #L142 was not covered by tests
}
case e.Id.Equal(oidExtensionIssuingDistributionPoint):
ext.Name = "X509v3 Issuing Distribution Point:"

var v distributionPoint
if _, err := asn1.Unmarshal(e.Value, &v); err != nil {
ext.AddDetailf(sanitizeBytes(e.Value))
ext.json = map[string]interface{}{
ext.AddDetail(sanitizeBytes(e.Value))
ext.json = map[string]any{

Check warning on line 150 in internal/crlutil/crl_extensions.go

View check run for this annotation

Codecov / codecov/patch

internal/crlutil/crl_extensions.go#L149-L150

Added lines #L149 - L150 were not covered by tests
"issuing_distribution_point": e.Value,
}
} else {
names := v.FullNames()
if len(names) > 0 {
ext.AddDetailf("Full Name:")
ext.AddDetail("Full Name:")

Check warning on line 156 in internal/crlutil/crl_extensions.go

View check run for this annotation

Codecov / codecov/patch

internal/crlutil/crl_extensions.go#L156

Added line #L156 was not covered by tests
for _, n := range names {
ext.AddDetailf(" " + n)
ext.AddDetail(" " + n)

Check warning on line 158 in internal/crlutil/crl_extensions.go

View check run for this annotation

Codecov / codecov/patch

internal/crlutil/crl_extensions.go#L158

Added line #L158 was not covered by tests
}
}
js := map[string]interface{}{
js := map[string]any{

Check warning on line 161 in internal/crlutil/crl_extensions.go

View check run for this annotation

Codecov / codecov/patch

internal/crlutil/crl_extensions.go#L161

Added line #L161 was not covered by tests
"full_names": names,
}

// Only one of this should be set to true. But for inspect we
// will allow more than one.
if v.OnlyContainsUserCerts {
ext.AddDetailf("Only User Certificates")
ext.AddDetail("Only User Certificates")

Check warning on line 168 in internal/crlutil/crl_extensions.go

View check run for this annotation

Codecov / codecov/patch

internal/crlutil/crl_extensions.go#L168

Added line #L168 was not covered by tests
js["only_user_certificates"] = true
}
if v.OnlyContainsCACerts {
ext.AddDetailf("Only CA Certificates")
ext.AddDetail("Only CA Certificates")

Check warning on line 172 in internal/crlutil/crl_extensions.go

View check run for this annotation

Codecov / codecov/patch

internal/crlutil/crl_extensions.go#L172

Added line #L172 was not covered by tests
js["only_ca_certificates"] = true
}
if v.OnlyContainsAttributeCerts {
ext.AddDetailf("Only Attribute Certificates")
ext.AddDetail("Only Attribute Certificates")

Check warning on line 176 in internal/crlutil/crl_extensions.go

View check run for this annotation

Codecov / codecov/patch

internal/crlutil/crl_extensions.go#L176

Added line #L176 was not covered by tests
js["only_attribute_certificates"] = true
}
if len(v.OnlySomeReasons.Bytes) > 0 {
ext.AddDetailf("Reasons: %x", v.OnlySomeReasons.Bytes)
js["only_some_reasons"] = v.OnlySomeReasons.Bytes
}

ext.json = map[string]interface{}{
ext.json = map[string]any{

Check warning on line 184 in internal/crlutil/crl_extensions.go

View check run for this annotation

Codecov / codecov/patch

internal/crlutil/crl_extensions.go#L184

Added line #L184 was not covered by tests
"issuing_distribution_point": js,
}
}
default:
ext.Name = e.Id.String()
ext.AddDetailf(sanitizeBytes(e.Value))
ext.json = map[string]interface{}{
ext.AddDetail(sanitizeBytes(e.Value))
ext.json = map[string]any{

Check warning on line 191 in internal/crlutil/crl_extensions.go

View check run for this annotation

Codecov / codecov/patch

internal/crlutil/crl_extensions.go#L190-L191

Added lines #L190 - L191 were not covered by tests
ext.Name: e.Value,
}
}
Expand Down
4 changes: 1 addition & 3 deletions internal/sshutil/sshutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ package sshutil

import (
"crypto"
//nolint:staticcheck // Maintain support for deprecated algorithms.
"crypto/dsa"
"crypto/dsa" // Maintain support for deprecated algorithms.
"crypto/ecdsa"
"crypto/ed25519"
"crypto/elliptic"
Expand Down Expand Up @@ -202,7 +201,6 @@ func parseECDSA(in []byte) (*ecdsa.PublicKey, error) {
return nil, errors.Errorf("unsupported curve %s", w.Curve)
}

//nolint:staticcheck // ignore this deprecation warning - golang will fix
key.X, key.Y = elliptic.Unmarshal(key.Curve, w.KeyBytes)
if key.X == nil || key.Y == nil {
return nil, errors.New("invalid curve point")
Expand Down
2 changes: 1 addition & 1 deletion utils/cautils/certificate_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
return err
}

if resp.CertChainPEM == nil || len(resp.CertChainPEM) == 0 {
if len(resp.CertChainPEM) == 0 {

Check warning on line 265 in utils/cautils/certificate_flow.go

View check run for this annotation

Codecov / codecov/patch

utils/cautils/certificate_flow.go#L265

Added line #L265 was not covered by tests
resp.CertChainPEM = []api.Certificate{resp.ServerPEM, resp.CaPEM}
}
var data []byte
Expand Down
2 changes: 1 addition & 1 deletion utils/cautils/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
if err != nil {
return nil, err
}
if signResponse.CertChainPEM == nil || len(signResponse.CertChainPEM) == 0 {
if len(signResponse.CertChainPEM) == 0 {

Check warning on line 187 in utils/cautils/client.go

View check run for this annotation

Codecov / codecov/patch

utils/cautils/client.go#L187

Added line #L187 was not covered by tests
signResponse.CertChainPEM = []api.Certificate{signResponse.ServerPEM, signResponse.CaPEM}
}
adminCert = make([]*x509.Certificate, len(signResponse.CertChainPEM))
Expand Down
Loading