@@ -204,20 +204,30 @@ func (pr *progressReader) Read(p []byte) (int, error) {
204204 return n , err
205205}
206206
207- // VerifyChecksum validates the downloaded archive
208- func (inst * Installer ) VerifyChecksum (data []byte , release * Release , assetName string ) error {
207+ // VerifyChecksum validates the downloaded archive.
208+ // Returns (verified bool, err error):
209+ // - (true, nil): checksum verified successfully
210+ // - (false, nil): checksum file not found, verification skipped
211+ // - (false, err): checksum mismatch or download error
212+ func (inst * Installer ) VerifyChecksum (data []byte , release * Release , assetName string ) (bool , error ) {
209213 checksumAsset , err := GetChecksumAsset (release , assetName )
210214 if err != nil {
211- return err
215+ // Checksum file not found in release - skip verification gracefully
216+ return false , nil
212217 }
213218
214219 // Download checksum file
215220 resp , err := http .Get (checksumAsset .BrowserDownloadURL )
216221 if err != nil {
217- return fmt .Errorf ("failed to download checksum: %w" , err )
222+ return false , fmt .Errorf ("failed to download checksum: %w" , err )
218223 }
219224 defer func () { _ = resp .Body .Close () }()
220225
226+ if resp .StatusCode == http .StatusNotFound {
227+ // Checksum file URL returned 404 - skip verification gracefully
228+ return false , nil
229+ }
230+
221231 // Parse checksum file (format: "sha256 filename" or just "sha256")
222232 var expectedHash string
223233 scanner := bufio .NewScanner (resp .Body )
@@ -234,18 +244,18 @@ func (inst *Installer) VerifyChecksum(data []byte, release *Release, assetName s
234244 }
235245
236246 if expectedHash == "" {
237- return fmt .Errorf ("could not parse checksum file" )
247+ return false , fmt .Errorf ("could not parse checksum file" )
238248 }
239249
240250 // Calculate actual hash
241251 hash := sha256 .Sum256 (data )
242252 actualHash := hex .EncodeToString (hash [:])
243253
244254 if actualHash != expectedHash {
245- return fmt .Errorf ("checksum mismatch: expected %s, got %s" , expectedHash , actualHash )
255+ return false , fmt .Errorf ("checksum mismatch: expected %s, got %s" , expectedHash , actualHash )
246256 }
247257
248- return nil
258+ return true , nil
249259}
250260
251261// ExtractAndInstall extracts the binary and installs to cosmovisor directory
0 commit comments