-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "feat(GODT-1224): Add support for clear-signed sending packages"
This reverts commit d4a5c59.
- Loading branch information
1 parent
8213d7d
commit 607d8aa
Showing
2 changed files
with
9 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -380,63 +380,3 @@ func TestSendDraftReq_AddPackage(t *testing.T) { | |
}) | ||
} | ||
} | ||
|
||
func TestSendDraftReq_AddClearPackage(t *testing.T) { | ||
key, err := crypto.GenerateKey("name", "email", "rsa", 2048) | ||
require.NoError(t, err) | ||
|
||
kr, err := crypto.NewKeyRing(key) | ||
require.NoError(t, err) | ||
|
||
tests := []struct { | ||
name string | ||
body string | ||
prefs map[string]SendPreferences | ||
attKeys map[string]*crypto.SessionKey | ||
wantErr bool | ||
}{ | ||
{ | ||
name: "clear plain text with signature", | ||
body: "this is a text/plain body", | ||
prefs: map[string]SendPreferences{"[email protected]": { | ||
Encrypt: false, | ||
SignatureType: DetachedSignature, | ||
EncryptionScheme: ClearScheme, | ||
MIMEType: rfc822.TextPlain, | ||
}}, | ||
wantErr: false, | ||
}, | ||
{ | ||
name: "clear plain text with bad scheme (error)", | ||
body: "this is a text/plain body", | ||
prefs: map[string]SendPreferences{"[email protected]": { | ||
Encrypt: false, | ||
SignatureType: DetachedSignature, | ||
EncryptionScheme: PGPInlineScheme, | ||
MIMEType: rfc822.TextPlain, | ||
}}, | ||
wantErr: true, | ||
}, | ||
{ | ||
name: "clear rich text with signature (error)", | ||
body: "this is a text/html body", | ||
prefs: map[string]SendPreferences{"[email protected]": { | ||
Encrypt: false, | ||
SignatureType: DetachedSignature, | ||
EncryptionScheme: ClearScheme, | ||
MIMEType: rfc822.TextHTML, | ||
}}, | ||
wantErr: true, | ||
}, | ||
} | ||
|
||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
var req SendDraftReq | ||
|
||
if err := req.AddClearSignedPackage(kr, tt.body, tt.prefs, tt.attKeys); (err != nil) != tt.wantErr { | ||
t.Errorf("SendDraftReq.AddPackage() error = %v, wantErr %v", err, tt.wantErr) | ||
} | ||
}) | ||
} | ||
} |