@@ -106,7 +106,7 @@ func GPGKeyToEntity(ctx context.Context, k *GPGKey) (*openpgp.Entity, error) {
106106 if err != nil {
107107 return nil , err
108108 }
109- keys , err := checkArmoredGPGKeyString (impKey .Content )
109+ keys , err := CheckArmoredGPGKeyString (impKey .Content )
110110 if err != nil {
111111 return nil , err
112112 }
@@ -115,7 +115,7 @@ func GPGKeyToEntity(ctx context.Context, k *GPGKey) (*openpgp.Entity, error) {
115115
116116// parseSubGPGKey parse a sub Key
117117func parseSubGPGKey (ownerID int64 , primaryID string , pubkey * packet.PublicKey , expiry time.Time ) (* GPGKey , error ) {
118- content , err := base64EncPubKey (pubkey )
118+ content , err := Base64EncPubKey (pubkey )
119119 if err != nil {
120120 return nil , err
121121 }
@@ -183,7 +183,7 @@ func parseGPGKey(ctx context.Context, ownerID int64, e *openpgp.Entity, verified
183183 }
184184 }
185185
186- content , err := base64EncPubKey (pubkey )
186+ content , err := Base64EncPubKey (pubkey )
187187 if err != nil {
188188 return nil , err
189189 }
@@ -239,33 +239,3 @@ func DeleteGPGKey(ctx context.Context, doer *user_model.User, id int64) (err err
239239
240240 return committer .Commit ()
241241}
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