Skip to content

Commit 23931b8

Browse files
committed
Merge branch 'release/v0.5.2'
2 parents 0037fc7 + e8c7aab commit 23931b8

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

cert/cert.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ func CreateCertificate(organizationalUnit, organization, country, commonName str
3333
return tls.Certificate{}, err
3434
}
3535

36-
// Create the EEBUS service SKI using the private key
37-
asn1, err := x509.MarshalECPrivateKey(privateKey)
36+
// Create the EEBUS service SKI using the public key
37+
publicKey, err := privateKey.PublicKey.ECDH()
3838
if err != nil {
3939
return tls.Certificate{}, err
4040
}
4141
// SHIP 12.2: Required to be created according to RFC 3280 4.2.1.2
4242
// #nosec G401
43-
ski := sha1.Sum(asn1)
43+
ski := sha1.Sum(publicKey.Bytes())
4444

4545
subject := pkix.Name{
4646
OrganizationalUnit: []string{organizationalUnit},

cert/cert_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ func createInvalidCertificate(organizationalUnit, organization, country, commonN
5959
return tls.Certificate{}, err
6060
}
6161

62-
// Create the EEBUS service SKI using the private key
63-
asn1, err := x509.MarshalECPrivateKey(privateKey)
62+
// Create the EEBUS service SKI using the public key
63+
publicKey, err := privateKey.PublicKey.ECDH()
6464
if err != nil {
6565
return tls.Certificate{}, err
6666
}
6767
// SHIP 12.2: Required to be created according to RFC 3280 4.2.1.2
6868
// #nosec G401
69-
ski := sha1.Sum(asn1)
69+
ski := sha1.Sum(publicKey.Bytes())
7070

7171
subject := pkix.Name{
7272
OrganizationalUnit: []string{organizationalUnit},

mdns/mdns.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,10 @@ func (m *MdnsManager) processMdnsEntry(elements map[string]string, name, host st
397397
}
398398

399399
func (m *MdnsManager) RequestMdnsEntries() {
400+
if m.report == nil {
401+
return
402+
}
403+
400404
entries := m.copyMdnsEntries()
401405
go m.report.ReportMdnsEntries(entries)
402406
}

0 commit comments

Comments
 (0)