about summary refs log tree commit diff stats
path: root/widgets/aerc.go
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/aerc.go')
-rw-r--r--widgets/aerc.go18
1 files changed, 11 insertions, 7 deletions
diff --git a/widgets/aerc.go b/widgets/aerc.go
index 23b8901..273777b 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -537,11 +537,11 @@ func (aerc *Aerc) CloseBackends() error {
 	return returnErr
 }
 
-func (aerc *Aerc) GetPassword(title string, prompt string, cb func(string)) {
-	aerc.getpasswd = NewGetPasswd(title, prompt, func(pw string) {
+func (aerc *Aerc) GetPassword(title string, prompt string, cb func(string, error)) {
+	aerc.getpasswd = NewGetPasswd(title, prompt, func(pw string, err error) {
 		aerc.getpasswd = nil
 		aerc.Invalidate()
-		cb(pw)
+		cb(pw, err)
 	})
 	aerc.getpasswd.OnInvalidate(func(_ ui.Drawable) {
 		aerc.Invalidate()
@@ -553,7 +553,7 @@ func (aerc *Aerc) Initialize(ui *ui.UI) {
 	aerc.ui = ui
 }
 
-func (aerc *Aerc) DecryptKeys(keys []openpgp.Key, symmetric bool) ([]byte, error) {
+func (aerc *Aerc) DecryptKeys(keys []openpgp.Key, symmetric bool) (b []byte, err error) {
 	// HACK HACK HACK
 	for _, key := range keys {
 		var ident *openpgp.Identity
@@ -561,14 +561,18 @@ func (aerc *Aerc) DecryptKeys(keys []openpgp.Key, symmetric bool) ([]byte, error
 			break
 		}
 		aerc.GetPassword("Decrypt PGP private key",
-			fmt.Sprintf("Enter password for %s (%8X)",
+			fmt.Sprintf("Enter password for %s (%8X)\nPress <ESC> to cancel",
 				ident.Name, key.PublicKey.KeyId),
-			func(pass string) {
+			func(pass string, e error) {
+				if e != nil {
+					err = e
+					return
+				}
 				key.PrivateKey.Decrypt([]byte(pass))
 			})
 		for aerc.getpasswd != nil {
 			aerc.ui.Tick()
 		}
 	}
-	return nil, nil
+	return nil, err
 }
'oid'>b17de7ba ^
4f3d9065 ^
6f65d591 ^
f017a508 ^
4f3d9065 ^
f017a508 ^
48835572 ^
4f3d9065 ^

ad8161f3 ^
48835572 ^












4f3d9065 ^


b17de7ba ^
7a84094a ^

7c3bbb77 ^
b17de7ba ^

7c3bbb77 ^
51b0936f ^
b17de7ba ^



760f683f ^
b17de7ba ^
4a48bedc ^
b17de7ba ^
7c3bbb77 ^
748b6865 ^
b17de7ba ^

8bd3f99f ^

760f683f ^
b17de7ba ^
4a48bedc ^
7a84094a ^
4f3d9065 ^
7a84094a ^
88b8d612 ^
9d9da2ad ^
7c3bbb77 ^
88b8d612 ^
51b0936f ^

b17de7ba ^
dd660682 ^
88b8d612 ^
b17de7ba ^

48835572 ^
b17de7ba ^
4a48bedc ^
7a84094a ^
4f3d9065 ^
7a84094a ^
88b8d612 ^
9d9da2ad ^
7c3bbb77 ^
88b8d612 ^
48835572 ^






aed29290 ^
b17de7ba ^
cdb9fbee ^


4a48bedc ^
cdb9fbee ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109