mirror of
				https://github.com/SSLMate/certspotter.git
				synced 2025-07-03 10:47:17 +02:00 
			
		
		
		
	Apply gofmt
This commit is contained in:
		
							parent
							
								
									c68cf401a3
								
							
						
					
					
						commit
						7a8a770d99
					
				@ -23,17 +23,17 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type discoveredCert struct {
 | 
			
		||||
	WatchItem   WatchItem
 | 
			
		||||
	LogEntry    *logEntry
 | 
			
		||||
	Info        *certspotter.CertInfo
 | 
			
		||||
	Chain       []ct.ASN1Cert // first entry is the leaf certificate or precertificate
 | 
			
		||||
	TBSSHA256   [32]byte      // computed over Info.TBS.Raw
 | 
			
		||||
	LeafSHA256  [32]byte      // computed over Chain[0]
 | 
			
		||||
	PubkeySHA256  [32]byte      // computed over Info.TBS.PublicKey.FullBytes
 | 
			
		||||
	Identifiers *certspotter.Identifiers
 | 
			
		||||
	CertPath    string // empty if not saved on the filesystem
 | 
			
		||||
	JSONPath    string // empty if not saved on the filesystem
 | 
			
		||||
	TextPath    string // empty if not saved on the filesystem
 | 
			
		||||
	WatchItem    WatchItem
 | 
			
		||||
	LogEntry     *logEntry
 | 
			
		||||
	Info         *certspotter.CertInfo
 | 
			
		||||
	Chain        []ct.ASN1Cert // first entry is the leaf certificate or precertificate
 | 
			
		||||
	TBSSHA256    [32]byte      // computed over Info.TBS.Raw
 | 
			
		||||
	LeafSHA256   [32]byte      // computed over Chain[0]
 | 
			
		||||
	PubkeySHA256 [32]byte      // computed over Info.TBS.PublicKey.FullBytes
 | 
			
		||||
	Identifiers  *certspotter.Identifiers
 | 
			
		||||
	CertPath     string // empty if not saved on the filesystem
 | 
			
		||||
	JSONPath     string // empty if not saved on the filesystem
 | 
			
		||||
	TextPath     string // empty if not saved on the filesystem
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (cert *discoveredCert) pemChain() []byte {
 | 
			
		||||
@ -51,7 +51,7 @@ func (cert *discoveredCert) pemChain() []byte {
 | 
			
		||||
 | 
			
		||||
func (cert *discoveredCert) json() []byte {
 | 
			
		||||
	object := map[string]any{
 | 
			
		||||
		"tbs_sha256":   hex.EncodeToString(cert.TBSSHA256[:]),
 | 
			
		||||
		"tbs_sha256":    hex.EncodeToString(cert.TBSSHA256[:]),
 | 
			
		||||
		"cert_sha256":   hex.EncodeToString(cert.LeafSHA256[:]),
 | 
			
		||||
		"pubkey_sha256": hex.EncodeToString(cert.PubkeySHA256[:]),
 | 
			
		||||
		"issuer_der":    cert.Info.TBS.Issuer.FullBytes,
 | 
			
		||||
 | 
			
		||||
@ -28,7 +28,7 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
	maxGetEntriesSize = 1000
 | 
			
		||||
	maxGetEntriesSize  = 1000
 | 
			
		||||
	monitorLogInterval = 5 * time.Minute
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -98,14 +98,14 @@ func processCertificate(ctx context.Context, config *Config, entry *logEntry, ce
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	cert := &discoveredCert{
 | 
			
		||||
		WatchItem:   watchItem,
 | 
			
		||||
		LogEntry:    entry,
 | 
			
		||||
		Info:        certInfo,
 | 
			
		||||
		Chain:       chain,
 | 
			
		||||
		TBSSHA256:   sha256.Sum256(certInfo.TBS.Raw),
 | 
			
		||||
		LeafSHA256:  sha256.Sum256(chain[0]),
 | 
			
		||||
	        PubkeySHA256: sha256.Sum256(certInfo.TBS.PublicKey.FullBytes),
 | 
			
		||||
		Identifiers: identifiers,
 | 
			
		||||
		WatchItem:    watchItem,
 | 
			
		||||
		LogEntry:     entry,
 | 
			
		||||
		Info:         certInfo,
 | 
			
		||||
		Chain:        chain,
 | 
			
		||||
		TBSSHA256:    sha256.Sum256(certInfo.TBS.Raw),
 | 
			
		||||
		LeafSHA256:   sha256.Sum256(chain[0]),
 | 
			
		||||
		PubkeySHA256: sha256.Sum256(certInfo.TBS.PublicKey.FullBytes),
 | 
			
		||||
		Identifiers:  identifiers,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var notifiedPath string
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user