@@ -13,8 +13,8 @@ import (
1313 user_model "code.gitea.io/gitea/models/user"
1414 "code.gitea.io/gitea/modules/timeutil"
1515
16- "github.com/keybase /go-crypto/openpgp"
17- "github.com/keybase /go-crypto/openpgp/packet"
16+ "github.com/ProtonMail /go-crypto/openpgp"
17+ "github.com/ProtonMail /go-crypto/openpgp/packet"
1818 "xorm.io/builder"
1919)
2020
@@ -141,7 +141,11 @@ func parseGPGKey(ctx context.Context, ownerID int64, e *openpgp.Entity, verified
141141 // Parse Subkeys
142142 subkeys := make ([]* GPGKey , len (e .Subkeys ))
143143 for i , k := range e .Subkeys {
144- subs , err := parseSubGPGKey (ownerID , pubkey .KeyIdString (), k .PublicKey , expiry )
144+ subkeyExpiry := expiry
145+ if k .Sig .KeyLifetimeSecs != nil {
146+ subkeyExpiry = k .PublicKey .CreationTime .Add (time .Duration (* k .Sig .KeyLifetimeSecs ) * time .Second )
147+ }
148+ subs , err := parseSubGPGKey (ownerID , pubkey .KeyIdString (), k .PublicKey , subkeyExpiry )
145149 if err != nil {
146150 return nil , ErrGPGKeyParsing {ParseError : err }
147151 }
@@ -156,7 +160,7 @@ func parseGPGKey(ctx context.Context, ownerID int64, e *openpgp.Entity, verified
156160
157161 emails := make ([]* user_model.EmailAddress , 0 , len (e .Identities ))
158162 for _ , ident := range e .Identities {
159- if ident .Revocation != nil {
163+ if ident .Revoked ( time . Now ()) {
160164 continue
161165 }
162166 email := strings .ToLower (strings .TrimSpace (ident .UserId .Email ))
0 commit comments