mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 19:38:23 +00:00 
			
		
		
		
	Backport #30245 by @KN4CK3R Fixes #30235 If the key id "front" byte has a single digit, `%X` is missing the 0 prefix. ` 38D1A3EADDBEA9C` instead of `038D1A3EADDBEA9C` When using the `IssuerFingerprint` slice `%X` is enough but I changed it to `%016X` too to be consistent. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
This commit is contained in:
		| @@ -134,3 +134,13 @@ func extractSignature(s string) (*packet.Signature, error) { | ||||
| 	} | ||||
| 	return sig, nil | ||||
| } | ||||
|  | ||||
| func tryGetKeyIDFromSignature(sig *packet.Signature) string { | ||||
| 	if sig.IssuerKeyId != nil && (*sig.IssuerKeyId) != 0 { | ||||
| 		return fmt.Sprintf("%016X", *sig.IssuerKeyId) | ||||
| 	} | ||||
| 	if sig.IssuerFingerprint != nil && len(sig.IssuerFingerprint) > 0 { | ||||
| 		return fmt.Sprintf("%016X", sig.IssuerFingerprint[12:20]) | ||||
| 	} | ||||
| 	return "" | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user