summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-12-05 13:42:41 +0800
committerGitHub <noreply@github.com>2023-12-05 13:42:41 +0800
commitb71d4c3ec01ac8db71f5c417ea570f258b165cb6 (patch)
tree8f11d8d78db75ff97b6c10ae8c13b553bb92a5f3 /services
parentbf537adf8ab2f1e92efc396b3ab9a1d64c632d3e (diff)
downloadgitea-b71d4c3ec01ac8db71f5c417ea570f258b165cb6.tar.gz
gitea-b71d4c3ec01ac8db71f5c417ea570f258b165cb6.zip
Fix RPM/Debian signature key creation (#28352) (#28353)
Backport #28352 by @KN4CK3R Fixes #28324 The name parameter can't contain some characters (https://github.com/keybase/go-crypto/blob/master/openpgp/keys.go#L680) but is optional. Therefore just use an empty string. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Diffstat (limited to 'services')
-rw-r--r--services/packages/debian/repository.go2
-rw-r--r--services/packages/rpm/repository.go5
2 files changed, 3 insertions, 4 deletions
diff --git a/services/packages/debian/repository.go b/services/packages/debian/repository.go
index 1cc687ec87..373fa7abc9 100644
--- a/services/packages/debian/repository.go
+++ b/services/packages/debian/repository.go
@@ -67,7 +67,7 @@ func GetOrCreateKeyPair(ctx context.Context, ownerID int64) (string, string, err
}
func generateKeypair() (string, string, error) {
- e, err := openpgp.NewEntity(setting.AppName, "Debian Registry", "", nil)
+ e, err := openpgp.NewEntity("", "Debian Registry", "", nil)
if err != nil {
return "", "", err
}
diff --git a/services/packages/rpm/repository.go b/services/packages/rpm/repository.go
index 1d0dc83cae..c9db0247f6 100644
--- a/services/packages/rpm/repository.go
+++ b/services/packages/rpm/repository.go
@@ -22,7 +22,6 @@ import (
"code.gitea.io/gitea/modules/json"
packages_module "code.gitea.io/gitea/modules/packages"
rpm_module "code.gitea.io/gitea/modules/packages/rpm"
- "code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
packages_service "code.gitea.io/gitea/services/packages"
@@ -68,7 +67,7 @@ func GetOrCreateKeyPair(ctx context.Context, ownerID int64) (string, string, err
}
func generateKeypair() (string, string, error) {
- e, err := openpgp.NewEntity(setting.AppName, "RPM Registry", "", nil)
+ e, err := openpgp.NewEntity("", "RPM Registry", "", nil)
if err != nil {
return "", "", err
}
@@ -126,7 +125,7 @@ type packageData struct {
type packageCache = map[*packages_model.PackageFile]*packageData
-// BuildSpecificRepositoryFiles builds metadata files for the repository
+// BuildRepositoryFiles builds metadata files for the repository
func BuildRepositoryFiles(ctx context.Context, ownerID int64) error {
pv, err := GetOrCreateRepositoryVersion(ctx, ownerID)
if err != nil {