Use new KeyExpired function

This commit is contained in:
Daniel Huigens 2019-04-27 07:22:10 +02:00
parent ea2fcb9438
commit 2091fc106c
3 changed files with 5 additions and 5 deletions

View file

@ -320,7 +320,7 @@ func (pm *PmCrypto) IsKeyExpiredBin(publicKey []byte) (bool, error) {
if subkey.Sig.FlagsValid &&
subkey.Sig.FlagEncryptCommunications &&
subkey.PublicKey.PubKeyAlgo.CanEncrypt() &&
!subkey.Sig.KeyExpired(now) &&
!subkey.PublicKey.KeyExpired(subkey.Sig, now) &&
(maxTime.IsZero() || subkey.Sig.CreationTime.After(maxTime)) {
candidateSubkey = i
maxTime = subkey.Sig.CreationTime
@ -349,7 +349,7 @@ func (pm *PmCrypto) IsKeyExpiredBin(publicKey []byte) (bool, error) {
i := firstIdentity
if !i.SelfSignature.FlagsValid || i.SelfSignature.FlagEncryptCommunications &&
e.PrimaryKey.PubKeyAlgo.CanEncrypt() &&
!i.SelfSignature.KeyExpired(now) {
!e.PrimaryKey.KeyExpired(i.SelfSignature, now) {
return false, nil
}
}