This commit is contained in:
Mustafa Gezen 2024-04-30 01:20:59 +02:00 committed by GitHub
commit 7aec0bbfa0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 0 deletions

View File

@ -66,6 +66,7 @@ import (
yumrepofspb "peridot.resf.org/peridot/yumrepofs/pb"
"peridot.resf.org/utils"
"regexp"
"strconv"
"strings"
"time"
)
@ -1400,6 +1401,9 @@ func (c *Controller) makeRepoChanges(tx peridotdb.Access, req *UpdateRepoRequest
pkgPrimary.Packages[0].Location.Href = fmt.Sprintf("Packages/%s", newObjectKey)
pkgPrimary.Packages[0].Checksum.Value = signedArtifact.HashSha256
if signedArtifact.SignedSize > 0 {
pkgPrimary.Packages[0].Size.Package = strconv.FormatInt(signedArtifact.SignedSize, 10)
}
for _, pkg := range pkgFilelists.Packages {
pkg.PkgId = signedArtifact.HashSha256

View File

@ -246,9 +246,16 @@ func (s *Server) SignArtifactActivity(ctx context.Context, artifactId string, ke
return nil, fmt.Errorf("failed to create task artifact signature: %v", err)
}
// Get the size of the file
fi, err := f.Stat()
if err != nil {
return nil, err
}
return &keykeeperpb.SignedArtifact{
Path: newObjectKey,
HashSha256: hash,
SignedSize: fi.Size(),
}, nil
}
verifySig := func() error {

View File

@ -86,6 +86,7 @@ message ImportKeyResponse {}
message SignedArtifact {
string path = 1;
string hash_sha256 = 2;
int64 signed_size = 3;
}
message SignArtifactsRequest {