1
0
Fork 0
mirror of https://git.sr.ht/~rjarry/aerc synced 2025-07-10 17:00:22 +02:00
aerc/lib/crypto/gpg/gpgbin/import-ownertrust.go
Marcin Serwin 63db443949 gpg: do not sign with untrusted keys
During encryption gpg was ignoring trust model of the user in favor of
always using the insecure "always". This change removes this override
and adds a helpful message if a user tries to encrypt a message with an
untrusted key. To revert to the previous behavior users can add
"trust-model always" to their gpg.conf file (default ~/.gnupg/gpg.conf).

Signed-off-by: Marcin Serwin <marcin@serwin.dev>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
2024-10-23 10:22:45 +02:00

16 lines
279 B
Go

package gpgbin
import (
"io"
)
// Import runs gpg --import-ownertrust and thus imports trusts for keys
func ImportOwnertrust(r io.Reader) error {
args := []string{"--import-ownertrust"}
g := newGpg(r, args)
err := g.cmd.Run()
if err != nil {
return err
}
return nil
}