mirror of
				https://github.com/SSLMate/certspotter.git
				synced 2025-07-03 10:47:17 +02:00 
			
		
		
		
	submitct: include cert index in log entries
This commit is contained in:
		
							parent
							
								
									e7a9ba6e7d
								
							
						
					
					
						commit
						779230cbc8
					
				| @ -164,7 +164,7 @@ func main() { | |||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	wg := sync.WaitGroup{} | 	wg := sync.WaitGroup{} | ||||||
| 	for _, cert := range certs { | 	for index, cert := range certs { | ||||||
| 		chain := buildChain(cert, certs) | 		chain := buildChain(cert, certs) | ||||||
| 		if len(chain) == 0 { | 		if len(chain) == 0 { | ||||||
| 			continue | 			continue | ||||||
| @ -172,17 +172,17 @@ func main() { | |||||||
| 		fingerprint := sha256.Sum256(chain[0].Raw) | 		fingerprint := sha256.Sum256(chain[0].Raw) | ||||||
| 		for _, ctlog := range logs { | 		for _, ctlog := range logs { | ||||||
| 			wg.Add(1) | 			wg.Add(1) | ||||||
| 			go func(ctlog Log) { | 			go func(index int, ctlog Log) { | ||||||
| 				sct, err := ctlog.SubmitChain(chain) | 				sct, err := ctlog.SubmitChain(chain) | ||||||
| 				if err != nil { | 				if err != nil { | ||||||
| 					log.Printf("%x: %s: Submission Error: %s", fingerprint, ctlog.info.Url, err) | 					log.Printf("%x [%d]: %s: Submission Error: %s", fingerprint, index, ctlog.info.Url, err) | ||||||
| 					atomic.AddUint32(&submitErrors, 1) | 					atomic.AddUint32(&submitErrors, 1) | ||||||
| 				} else if *verbose { | 				} else if *verbose { | ||||||
| 					timestamp := time.Unix(int64(sct.Timestamp)/1000, int64(sct.Timestamp%1000)*1000000) | 					timestamp := time.Unix(int64(sct.Timestamp)/1000, int64(sct.Timestamp%1000)*1000000) | ||||||
| 					log.Printf("%x: %s: Submitted at %s", fingerprint, ctlog.info.Url, timestamp) | 					log.Printf("%x [%d]: %s: Submitted at %s", fingerprint, index, ctlog.info.Url, timestamp) | ||||||
| 				} | 				} | ||||||
| 				wg.Done() | 				wg.Done() | ||||||
| 			}(ctlog) | 			}(index, ctlog) | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 	wg.Wait() | 	wg.Wait() | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Andrew Ayer
						Andrew Ayer