@@ -106,7 +106,7 @@ func GPGKeyToEntity(ctx context.Context, k *GPGKey) (*openpgp.Entity, error) {
106
106
if err != nil {
107
107
return nil , err
108
108
}
109
- keys , err := checkArmoredGPGKeyString (impKey .Content )
109
+ keys , err := CheckArmoredGPGKeyString (impKey .Content )
110
110
if err != nil {
111
111
return nil , err
112
112
}
@@ -115,7 +115,7 @@ func GPGKeyToEntity(ctx context.Context, k *GPGKey) (*openpgp.Entity, error) {
115
115
116
116
// parseSubGPGKey parse a sub Key
117
117
func parseSubGPGKey (ownerID int64 , primaryID string , pubkey * packet.PublicKey , expiry time.Time ) (* GPGKey , error ) {
118
- content , err := base64EncPubKey (pubkey )
118
+ content , err := Base64EncPubKey (pubkey )
119
119
if err != nil {
120
120
return nil , err
121
121
}
@@ -183,7 +183,7 @@ func parseGPGKey(ctx context.Context, ownerID int64, e *openpgp.Entity, verified
183
183
}
184
184
}
185
185
186
- content , err := base64EncPubKey (pubkey )
186
+ content , err := Base64EncPubKey (pubkey )
187
187
if err != nil {
188
188
return nil , err
189
189
}
@@ -239,33 +239,3 @@ func DeleteGPGKey(ctx context.Context, doer *user_model.User, id int64) (err err
239
239
240
240
return committer .Commit ()
241
241
}
242
-
243
- func checkKeyEmails (ctx context.Context , email string , keys ... * GPGKey ) (bool , string ) {
244
- uid := int64 (0 )
245
- var userEmails []* user_model.EmailAddress
246
- var user * user_model.User
247
- for _ , key := range keys {
248
- for _ , e := range key .Emails {
249
- if e .IsActivated && (email == "" || strings .EqualFold (e .Email , email )) {
250
- return true , e .Email
251
- }
252
- }
253
- if key .Verified && key .OwnerID != 0 {
254
- if uid != key .OwnerID {
255
- userEmails , _ = user_model .GetEmailAddresses (ctx , key .OwnerID )
256
- uid = key .OwnerID
257
- user = & user_model.User {ID : uid }
258
- _ , _ = user_model .GetUser (ctx , user )
259
- }
260
- for _ , e := range userEmails {
261
- if e .IsActivated && (email == "" || strings .EqualFold (e .Email , email )) {
262
- return true , e .Email
263
- }
264
- }
265
- if user .KeepEmailPrivate && strings .EqualFold (email , user .GetEmail ()) {
266
- return true , user .GetEmail ()
267
- }
268
- }
269
- }
270
- return false , email
271
- }
0 commit comments