mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-23 10:26:44 +00:00
rename
This commit is contained in:
@ -291,7 +291,7 @@ func signAttachment(encrypter *crypto.KeyRing, data io.Reader) (signature io.Rea
|
|||||||
return bytes.NewReader(sig.GetBinary()), nil
|
return bytes.NewReader(sig.GetBinary()), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func createPackets(
|
func encryptAndEncodeSessionKeys(
|
||||||
pubkey *crypto.KeyRing,
|
pubkey *crypto.KeyRing,
|
||||||
bodyKey *crypto.SessionKey,
|
bodyKey *crypto.SessionKey,
|
||||||
attkeys map[string]*crypto.SessionKey,
|
attkeys map[string]*crypto.SessionKey,
|
||||||
@ -315,7 +315,7 @@ func createPackets(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func encryptSymmetric(
|
func encryptSymmDecryptKey(
|
||||||
kr *crypto.KeyRing,
|
kr *crypto.KeyRing,
|
||||||
textToEncrypt string,
|
textToEncrypt string,
|
||||||
) (decryptedKey *crypto.SessionKey, symEncryptedData []byte, err error) {
|
) (decryptedKey *crypto.SessionKey, symEncryptedData []byte, err error) {
|
||||||
|
|||||||
@ -24,13 +24,14 @@ import (
|
|||||||
"github.com/ProtonMail/gopenpgp/v2/crypto"
|
"github.com/ProtonMail/gopenpgp/v2/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Draft actions
|
||||||
const (
|
const (
|
||||||
DraftActionReply = 0
|
DraftActionReply = 0
|
||||||
DraftActionReplyAll = 1
|
DraftActionReplyAll = 1
|
||||||
DraftActionForward = 2
|
DraftActionForward = 2
|
||||||
)
|
)
|
||||||
|
|
||||||
// Message package types.
|
// Message send package types.
|
||||||
const (
|
const (
|
||||||
InternalPackage = 1
|
InternalPackage = 1
|
||||||
EncryptedOutsidePackage = 2
|
EncryptedOutsidePackage = 2
|
||||||
@ -40,13 +41,14 @@ const (
|
|||||||
ClearMIMEPackage = 32
|
ClearMIMEPackage = 32
|
||||||
)
|
)
|
||||||
|
|
||||||
// Signature types.
|
// Send signature types.
|
||||||
const (
|
const (
|
||||||
SignatureNone = 0
|
SignatureNone = 0
|
||||||
SignatureDetached = 1
|
SignatureDetached = 1
|
||||||
SignatureAttachedArmored = 2
|
SignatureAttachedArmored = 2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// DraftReq defines paylod for creating drafts
|
||||||
type DraftReq struct {
|
type DraftReq struct {
|
||||||
Message *Message
|
Message *Message
|
||||||
ParentID string `json:",omitempty"`
|
ParentID string `json:",omitempty"`
|
||||||
@ -77,19 +79,19 @@ type AlgoKey struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type MessageAddress struct {
|
type MessageAddress struct {
|
||||||
Type int
|
Type int
|
||||||
BodyKeyPacket string // base64-encoded key packet.
|
EncryptedBodyKeyPacket string `json:"BodyKeyPacket"` // base64-encoded key packet.
|
||||||
Signature int // 0 = None, 1 = Detached, 2 = Attached/Armored
|
Signature int
|
||||||
AttachmentKeyPackets map[string]string
|
EncryptedAttachmentKeyPackets map[string]string `json:"AttachmentKeyPackets"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MessagePackage struct {
|
type MessagePackage struct {
|
||||||
Addresses map[string]*MessageAddress
|
Addresses map[string]*MessageAddress
|
||||||
Type int
|
Type int
|
||||||
MIMEType string
|
MIMEType string
|
||||||
Body string // base64-encoded encrypted data packet.
|
EncryptedBody string `json:"Body"` // base64-encoded encrypted data packet.
|
||||||
BodyKey AlgoKey // base64-encoded session key (only if cleartext recipients).
|
DecryptedBodyKey AlgoKey `json:"BodyKey"` // base64-encoded session key (only if cleartext recipients).
|
||||||
AttachmentKeys map[string]AlgoKey // Only include if cleartext & attachments.
|
DecryptedAttachmentKeys map[string]AlgoKey `json:"AttachmentKeys"` // Only include if cleartext & attachments.
|
||||||
}
|
}
|
||||||
|
|
||||||
func newMessagePackage(
|
func newMessagePackage(
|
||||||
@ -97,32 +99,32 @@ func newMessagePackage(
|
|||||||
attKeys map[string]AlgoKey,
|
attKeys map[string]AlgoKey,
|
||||||
) (pkg *MessagePackage) {
|
) (pkg *MessagePackage) {
|
||||||
pkg = &MessagePackage{
|
pkg = &MessagePackage{
|
||||||
Body: base64.StdEncoding.EncodeToString(send.data),
|
EncryptedBody: base64.StdEncoding.EncodeToString(send.ciphertext),
|
||||||
Addresses: send.addressMap,
|
Addresses: send.addressMap,
|
||||||
MIMEType: send.contentType,
|
MIMEType: send.contentType,
|
||||||
Type: send.sharedScheme,
|
Type: send.sharedScheme,
|
||||||
}
|
}
|
||||||
|
|
||||||
if send.sharedScheme&ClearPackage == ClearPackage ||
|
if send.sharedScheme&ClearPackage == ClearPackage ||
|
||||||
send.sharedScheme&ClearMIMEPackage == ClearMIMEPackage {
|
send.sharedScheme&ClearMIMEPackage == ClearMIMEPackage {
|
||||||
pkg.BodyKey.Key = send.key.GetBase64Key()
|
pkg.DecryptedBodyKey.Key = send.decryptedBodyKey.GetBase64Key()
|
||||||
pkg.BodyKey.Algorithm = send.key.Algo
|
pkg.DecryptedBodyKey.Algorithm = send.decryptedBodyKey.Algo
|
||||||
}
|
}
|
||||||
|
|
||||||
if attKeys != nil && send.sharedScheme&ClearPackage == ClearPackage {
|
if attKeys != nil && send.sharedScheme&ClearPackage == ClearPackage {
|
||||||
pkg.AttachmentKeys = attKeys
|
pkg.DecryptedAttachmentKeys = attKeys
|
||||||
}
|
}
|
||||||
|
|
||||||
return pkg
|
return pkg
|
||||||
}
|
}
|
||||||
|
|
||||||
type sendData struct {
|
type sendData struct {
|
||||||
key *crypto.SessionKey //body session key
|
decryptedBodyKey *crypto.SessionKey //body session key
|
||||||
addressMap map[string]*MessageAddress
|
addressMap map[string]*MessageAddress
|
||||||
sharedScheme int
|
sharedScheme int
|
||||||
data []byte // ciphertext
|
ciphertext []byte
|
||||||
body string // cleartext
|
cleartext string
|
||||||
contentType string
|
contentType string
|
||||||
}
|
}
|
||||||
|
|
||||||
type SendMessageReq struct {
|
type SendMessageReq struct {
|
||||||
@ -148,9 +150,9 @@ func NewSendMessageReq(
|
|||||||
req.plain.addressMap = make(map[string]*MessageAddress)
|
req.plain.addressMap = make(map[string]*MessageAddress)
|
||||||
req.rich.addressMap = make(map[string]*MessageAddress)
|
req.rich.addressMap = make(map[string]*MessageAddress)
|
||||||
|
|
||||||
req.mime.body = mimeBody
|
req.mime.cleartext = mimeBody
|
||||||
req.plain.body = plainBody
|
req.plain.cleartext = plainBody
|
||||||
req.rich.body = richBody
|
req.rich.cleartext = richBody
|
||||||
|
|
||||||
req.attKeys = attKeys
|
req.attKeys = attKeys
|
||||||
req.kr = kr
|
req.kr = kr
|
||||||
@ -219,8 +221,8 @@ func (req *SendMessageReq) addNonMIMERecipient(
|
|||||||
return errMultipartInNonMIME
|
return errMultipartInNonMIME
|
||||||
}
|
}
|
||||||
|
|
||||||
if send.key == nil {
|
if send.decryptedBodyKey == nil {
|
||||||
if send.key, send.data, err = encryptSymmetric(req.kr, send.body); err != nil {
|
if send.decryptedBodyKey, send.ciphertext, err = encryptSymmDecryptKey(req.kr, send.cleartext); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -237,7 +239,7 @@ func (req *SendMessageReq) addNonMIMERecipient(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if doEncrypt {
|
if doEncrypt {
|
||||||
newAddress.BodyKeyPacket, newAddress.AttachmentKeyPackets, err = createPackets(pubkey, send.key, req.attKeys)
|
newAddress.EncryptedBodyKeyPacket, newAddress.EncryptedAttachmentKeyPackets, err = encryptAndEncodeSessionKeys(pubkey, send.decryptedBodyKey, req.attKeys)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -254,8 +256,8 @@ func (req *SendMessageReq) addMIMERecipient(
|
|||||||
) (err error) {
|
) (err error) {
|
||||||
|
|
||||||
req.mime.contentType = ContentTypeMultipartMixed
|
req.mime.contentType = ContentTypeMultipartMixed
|
||||||
if req.mime.key == nil {
|
if req.mime.decryptedBodyKey == nil {
|
||||||
if req.mime.key, req.mime.data, err = encryptSymmetric(req.kr, req.mime.body); err != nil {
|
if req.mime.decryptedBodyKey, req.mime.ciphertext, err = encryptSymmDecryptKey(req.kr, req.mime.cleartext); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -267,11 +269,11 @@ func (req *SendMessageReq) addMIMERecipient(
|
|||||||
// Attachment keys are not needed because attachments are part
|
// Attachment keys are not needed because attachments are part
|
||||||
// of MIME body and therefore attachments are encrypted with
|
// of MIME body and therefore attachments are encrypted with
|
||||||
// body session key.
|
// body session key.
|
||||||
mimeBodyPacket, _, err := createPackets(pubkey, req.mime.key, map[string]*crypto.SessionKey{})
|
mimeBodyPacket, _, err := encryptAndEncodeSessionKeys(pubkey, req.mime.decryptedBodyKey, map[string]*crypto.SessionKey{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
req.mime.addressMap[email] = &MessageAddress{Type: sendScheme, BodyKeyPacket: mimeBodyPacket, Signature: signature}
|
req.mime.addressMap[email] = &MessageAddress{Type: sendScheme, EncryptedBodyKeyPacket: mimeBodyPacket, Signature: signature}
|
||||||
} else {
|
} else {
|
||||||
req.mime.addressMap[email] = &MessageAddress{Type: sendScheme, Signature: signature}
|
req.mime.addressMap[email] = &MessageAddress{Type: sendScheme, Signature: signature}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,19 +76,19 @@ func (td *testData) prepareAndCheck(t *testing.T) {
|
|||||||
r.True(ok, "pkg %d email %s", i, email)
|
r.True(ok, "pkg %d email %s", i, email)
|
||||||
|
|
||||||
r.Equal(wantAddress.Type, haveAddress.Type, "pkg %d email %s", i, email)
|
r.Equal(wantAddress.Type, haveAddress.Type, "pkg %d email %s", i, email)
|
||||||
shouldBeEmpty(wantAddress.BodyKeyPacket)(t, haveAddress.BodyKeyPacket, "pkg %d email %s", i, email)
|
shouldBeEmpty(wantAddress.EncryptedBodyKeyPacket)(t, haveAddress.EncryptedBodyKeyPacket, "pkg %d email %s", i, email)
|
||||||
r.Equal(wantAddress.Signature, haveAddress.Signature, "pkg %d email %s", i, email)
|
r.Equal(wantAddress.Signature, haveAddress.Signature, "pkg %d email %s", i, email)
|
||||||
|
|
||||||
if len(td.attKeys) == 0 {
|
if len(td.attKeys) == 0 {
|
||||||
r.Len(haveAddress.AttachmentKeyPackets, 0)
|
r.Len(haveAddress.EncryptedAttachmentKeyPackets, 0)
|
||||||
} else {
|
} else {
|
||||||
r.Equal(
|
r.Equal(
|
||||||
len(wantAddress.AttachmentKeyPackets),
|
len(wantAddress.EncryptedAttachmentKeyPackets),
|
||||||
len(haveAddress.AttachmentKeyPackets),
|
len(haveAddress.EncryptedAttachmentKeyPackets),
|
||||||
"pkg %d email %s", i, email,
|
"pkg %d email %s", i, email,
|
||||||
)
|
)
|
||||||
for attID, wantAttKey := range wantAddress.AttachmentKeyPackets {
|
for attID, wantAttKey := range wantAddress.EncryptedAttachmentKeyPackets {
|
||||||
haveAttKey, ok := haveAddress.AttachmentKeyPackets[attID]
|
haveAttKey, ok := haveAddress.EncryptedAttachmentKeyPackets[attID]
|
||||||
r.True(ok, "pkg %d email %s att %s", i, email, attID)
|
r.True(ok, "pkg %d email %s att %s", i, email, attID)
|
||||||
shouldBeEmpty(wantAttKey)(t, haveAttKey, "pkg %d email %s att %s", i, email, attID)
|
shouldBeEmpty(wantAttKey)(t, haveAttKey, "pkg %d email %s att %s", i, email, attID)
|
||||||
}
|
}
|
||||||
@ -98,24 +98,24 @@ func (td *testData) prepareAndCheck(t *testing.T) {
|
|||||||
r.Equal(wantPackage.Type, havePackage.Type, "pkg %d", i)
|
r.Equal(wantPackage.Type, havePackage.Type, "pkg %d", i)
|
||||||
r.Equal(wantPackage.MIMEType, havePackage.MIMEType, "pkg %d", i)
|
r.Equal(wantPackage.MIMEType, havePackage.MIMEType, "pkg %d", i)
|
||||||
|
|
||||||
shouldBeEmpty(wantPackage.Body)(t, havePackage.Body, "pkg %d", i)
|
shouldBeEmpty(wantPackage.EncryptedBody)(t, havePackage.EncryptedBody, "pkg %d", i)
|
||||||
|
|
||||||
wantBodyKey := wantPackage.BodyKey
|
wantBodyKey := wantPackage.DecryptedBodyKey
|
||||||
haveBodyKey := havePackage.BodyKey
|
haveBodyKey := havePackage.DecryptedBodyKey
|
||||||
|
|
||||||
shouldBeEmpty(wantBodyKey.Algorithm)(t, haveBodyKey.Algorithm, "pkg %d", i)
|
shouldBeEmpty(wantBodyKey.Algorithm)(t, haveBodyKey.Algorithm, "pkg %d", i)
|
||||||
shouldBeEmpty(wantBodyKey.Key)(t, haveBodyKey.Key, "pkg %d", i)
|
shouldBeEmpty(wantBodyKey.Key)(t, haveBodyKey.Key, "pkg %d", i)
|
||||||
|
|
||||||
if len(td.attKeys) == 0 {
|
if len(td.attKeys) == 0 {
|
||||||
r.Len(havePackage.AttachmentKeys, 0)
|
r.Len(havePackage.DecryptedAttachmentKeys, 0)
|
||||||
} else {
|
} else {
|
||||||
r.Equal(
|
r.Equal(
|
||||||
len(wantPackage.AttachmentKeys),
|
len(wantPackage.DecryptedAttachmentKeys),
|
||||||
len(havePackage.AttachmentKeys),
|
len(havePackage.DecryptedAttachmentKeys),
|
||||||
"pkg %d", i,
|
"pkg %d", i,
|
||||||
)
|
)
|
||||||
for attID, wantAttKey := range wantPackage.AttachmentKeys {
|
for attID, wantAttKey := range wantPackage.DecryptedAttachmentKeys {
|
||||||
haveAttKey, ok := havePackage.AttachmentKeys[attID]
|
haveAttKey, ok := havePackage.DecryptedAttachmentKeys[attID]
|
||||||
r.True(ok, "pkg %d att %s", i, attID)
|
r.True(ok, "pkg %d att %s", i, attID)
|
||||||
shouldBeEmpty(wantAttKey.Key)(t, haveAttKey.Key, "pkg %d att %s", i, attID)
|
shouldBeEmpty(wantAttKey.Key)(t, haveAttKey.Key, "pkg %d att %s", i, attID)
|
||||||
shouldBeEmpty(wantAttKey.Algorithm)(t, haveAttKey.Algorithm, "pkg %d att %s", i, attID)
|
shouldBeEmpty(wantAttKey.Algorithm)(t, haveAttKey.Algorithm, "pkg %d att %s", i, attID)
|
||||||
@ -149,15 +149,15 @@ func TestSendReq(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"html@pm.me": {
|
"html@pm.me": {
|
||||||
Type: InternalPackage,
|
Type: InternalPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "not-empty",
|
EncryptedBodyKeyPacket: "not-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: InternalPackage,
|
Type: InternalPackage,
|
||||||
MIMEType: ContentTypeHTML,
|
MIMEType: ContentTypeHTML,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -169,15 +169,15 @@ func TestSendReq(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"plain@pm.me": {
|
"plain@pm.me": {
|
||||||
Type: InternalPackage,
|
Type: InternalPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "not-empty",
|
EncryptedBodyKeyPacket: "not-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: InternalPackage,
|
Type: InternalPackage,
|
||||||
MIMEType: ContentTypePlainText,
|
MIMEType: ContentTypePlainText,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -200,40 +200,40 @@ func TestSendReq(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"internal1@pm.me": {
|
"internal1@pm.me": {
|
||||||
Type: InternalPackage,
|
Type: InternalPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "not-empty",
|
EncryptedBodyKeyPacket: "not-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
"internal3@pm.me": {
|
"internal3@pm.me": {
|
||||||
Type: InternalPackage,
|
Type: InternalPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "not-empty",
|
EncryptedBodyKeyPacket: "not-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: InternalPackage,
|
Type: InternalPackage,
|
||||||
MIMEType: ContentTypePlainText,
|
MIMEType: ContentTypePlainText,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"internal2@pm.me": {
|
"internal2@pm.me": {
|
||||||
Type: InternalPackage,
|
Type: InternalPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "not-empty",
|
EncryptedBodyKeyPacket: "not-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
"internal4@pm.me": {
|
"internal4@pm.me": {
|
||||||
Type: InternalPackage,
|
Type: InternalPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "not-empty",
|
EncryptedBodyKeyPacket: "not-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: InternalPackage,
|
Type: InternalPackage,
|
||||||
MIMEType: ContentTypeHTML,
|
MIMEType: ContentTypeHTML,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -250,11 +250,11 @@ func TestSendReq(t *testing.T) {
|
|||||||
Signature: SignatureNone,
|
Signature: SignatureNone,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: ClearPackage,
|
Type: ClearPackage,
|
||||||
MIMEType: ContentTypeHTML,
|
MIMEType: ContentTypeHTML,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
BodyKey: AlgoKey{"non-empty", "non-empty"},
|
DecryptedBodyKey: AlgoKey{"non-empty", "non-empty"},
|
||||||
AttachmentKeys: attAlgoKeys,
|
DecryptedAttachmentKeys: attAlgoKeys,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -270,11 +270,11 @@ func TestSendReq(t *testing.T) {
|
|||||||
Signature: SignatureNone,
|
Signature: SignatureNone,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: ClearPackage,
|
Type: ClearPackage,
|
||||||
MIMEType: ContentTypePlainText,
|
MIMEType: ContentTypePlainText,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
BodyKey: AlgoKey{"non-empty", "non-empty"},
|
DecryptedBodyKey: AlgoKey{"non-empty", "non-empty"},
|
||||||
AttachmentKeys: attAlgoKeys,
|
DecryptedAttachmentKeys: attAlgoKeys,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -290,10 +290,10 @@ func TestSendReq(t *testing.T) {
|
|||||||
Signature: SignatureNone,
|
Signature: SignatureNone,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: ClearMIMEPackage,
|
Type: ClearMIMEPackage,
|
||||||
MIMEType: ContentTypeMultipartMixed,
|
MIMEType: ContentTypeMultipartMixed,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
BodyKey: AlgoKey{"non-empty", "non-empty"},
|
DecryptedBodyKey: AlgoKey{"non-empty", "non-empty"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -309,10 +309,10 @@ func TestSendReq(t *testing.T) {
|
|||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: ClearMIMEPackage,
|
Type: ClearMIMEPackage,
|
||||||
MIMEType: ContentTypeMultipartMixed,
|
MIMEType: ContentTypeMultipartMixed,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
BodyKey: AlgoKey{"non-empty", "non-empty"},
|
DecryptedBodyKey: AlgoKey{"non-empty", "non-empty"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -343,10 +343,10 @@ func TestSendReq(t *testing.T) {
|
|||||||
Signature: SignatureNone,
|
Signature: SignatureNone,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: ClearMIMEPackage,
|
Type: ClearMIMEPackage,
|
||||||
MIMEType: ContentTypeMultipartMixed,
|
MIMEType: ContentTypeMultipartMixed,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
BodyKey: AlgoKey{"non-empty", "non-empty"},
|
DecryptedBodyKey: AlgoKey{"non-empty", "non-empty"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
@ -355,11 +355,11 @@ func TestSendReq(t *testing.T) {
|
|||||||
Signature: SignatureNone,
|
Signature: SignatureNone,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: ClearPackage,
|
Type: ClearPackage,
|
||||||
MIMEType: ContentTypePlainText,
|
MIMEType: ContentTypePlainText,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
BodyKey: AlgoKey{"non-empty", "non-empty"},
|
DecryptedBodyKey: AlgoKey{"non-empty", "non-empty"},
|
||||||
AttachmentKeys: attAlgoKeys,
|
DecryptedAttachmentKeys: attAlgoKeys,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
@ -368,11 +368,11 @@ func TestSendReq(t *testing.T) {
|
|||||||
Signature: SignatureNone,
|
Signature: SignatureNone,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: ClearPackage,
|
Type: ClearPackage,
|
||||||
MIMEType: ContentTypeHTML,
|
MIMEType: ContentTypeHTML,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
BodyKey: AlgoKey{"non-empty", "non-empty"},
|
DecryptedBodyKey: AlgoKey{"non-empty", "non-empty"},
|
||||||
AttachmentKeys: attAlgoKeys,
|
DecryptedAttachmentKeys: attAlgoKeys,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -385,14 +385,14 @@ func TestSendReq(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"mime@gpg.com": {
|
"mime@gpg.com": {
|
||||||
Type: PGPMIMEPackage,
|
Type: PGPMIMEPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "non-empty",
|
EncryptedBodyKeyPacket: "non-empty",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: PGPMIMEPackage,
|
Type: PGPMIMEPackage,
|
||||||
MIMEType: ContentTypeMultipartMixed,
|
MIMEType: ContentTypeMultipartMixed,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -404,15 +404,15 @@ func TestSendReq(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"inline-plain@gpg.com": {
|
"inline-plain@gpg.com": {
|
||||||
Type: PGPInlinePackage,
|
Type: PGPInlinePackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "non-empty",
|
EncryptedBodyKeyPacket: "non-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: PGPInlinePackage,
|
Type: PGPInlinePackage,
|
||||||
MIMEType: ContentTypePlainText,
|
MIMEType: ContentTypePlainText,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -424,15 +424,15 @@ func TestSendReq(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"inline-html@gpg.com": {
|
"inline-html@gpg.com": {
|
||||||
Type: PGPInlinePackage,
|
Type: PGPInlinePackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "non-empty",
|
EncryptedBodyKeyPacket: "non-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: PGPInlinePackage,
|
Type: PGPInlinePackage,
|
||||||
MIMEType: ContentTypeHTML,
|
MIMEType: ContentTypeHTML,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -456,40 +456,40 @@ func TestSendReq(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"mime@gpg.com": {
|
"mime@gpg.com": {
|
||||||
Type: PGPMIMEPackage,
|
Type: PGPMIMEPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "non-empty",
|
EncryptedBodyKeyPacket: "non-empty",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: PGPMIMEPackage,
|
Type: PGPMIMEPackage,
|
||||||
MIMEType: ContentTypeMultipartMixed,
|
MIMEType: ContentTypeMultipartMixed,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"inline-plain@gpg.com": {
|
"inline-plain@gpg.com": {
|
||||||
Type: PGPInlinePackage,
|
Type: PGPInlinePackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "non-empty",
|
EncryptedBodyKeyPacket: "non-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: PGPInlinePackage,
|
Type: PGPInlinePackage,
|
||||||
MIMEType: ContentTypePlainText,
|
MIMEType: ContentTypePlainText,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"inline-html@gpg.com": {
|
"inline-html@gpg.com": {
|
||||||
Type: PGPInlinePackage,
|
Type: PGPInlinePackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "non-empty",
|
EncryptedBodyKeyPacket: "non-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: PGPInlinePackage,
|
Type: PGPInlinePackage,
|
||||||
MIMEType: ContentTypeHTML,
|
MIMEType: ContentTypeHTML,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -503,21 +503,21 @@ func TestSendReq(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"inline-html@gpg.com": {
|
"inline-html@gpg.com": {
|
||||||
Type: PGPInlinePackage,
|
Type: PGPInlinePackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "non-empty",
|
EncryptedBodyKeyPacket: "non-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
"internal@pm.me": {
|
"internal@pm.me": {
|
||||||
Type: InternalPackage,
|
Type: InternalPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "non-empty",
|
EncryptedBodyKeyPacket: "non-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: PGPInlinePackage | InternalPackage,
|
Type: PGPInlinePackage | InternalPackage,
|
||||||
MIMEType: ContentTypeHTML,
|
MIMEType: ContentTypeHTML,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -530,21 +530,21 @@ func TestSendReq(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"inline-plain@gpg.com": {
|
"inline-plain@gpg.com": {
|
||||||
Type: PGPInlinePackage,
|
Type: PGPInlinePackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "non-empty",
|
EncryptedBodyKeyPacket: "non-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
"internal@pm.me": {
|
"internal@pm.me": {
|
||||||
Type: InternalPackage,
|
Type: InternalPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "non-empty",
|
EncryptedBodyKeyPacket: "non-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: PGPInlinePackage | InternalPackage,
|
Type: PGPInlinePackage | InternalPackage,
|
||||||
MIMEType: ContentTypePlainText,
|
MIMEType: ContentTypePlainText,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -557,21 +557,21 @@ func TestSendReq(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"internal@pm.me": {
|
"internal@pm.me": {
|
||||||
Type: InternalPackage,
|
Type: InternalPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "not-empty",
|
EncryptedBodyKeyPacket: "not-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
"html@email.com": {
|
"html@email.com": {
|
||||||
Type: ClearPackage,
|
Type: ClearPackage,
|
||||||
Signature: SignatureNone,
|
Signature: SignatureNone,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: InternalPackage | ClearPackage,
|
Type: InternalPackage | ClearPackage,
|
||||||
MIMEType: ContentTypeHTML,
|
MIMEType: ContentTypeHTML,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
BodyKey: AlgoKey{"non-empty", "non-empty"},
|
DecryptedBodyKey: AlgoKey{"non-empty", "non-empty"},
|
||||||
AttachmentKeys: attAlgoKeys,
|
DecryptedAttachmentKeys: attAlgoKeys,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -584,21 +584,21 @@ func TestSendReq(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"internal@pm.me": {
|
"internal@pm.me": {
|
||||||
Type: InternalPackage,
|
Type: InternalPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "not-empty",
|
EncryptedBodyKeyPacket: "not-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
"html@email.com": {
|
"html@email.com": {
|
||||||
Type: ClearPackage,
|
Type: ClearPackage,
|
||||||
Signature: SignatureNone,
|
Signature: SignatureNone,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: InternalPackage | ClearPackage,
|
Type: InternalPackage | ClearPackage,
|
||||||
MIMEType: ContentTypeHTML,
|
MIMEType: ContentTypeHTML,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
BodyKey: AlgoKey{"non-empty", "non-empty"},
|
DecryptedBodyKey: AlgoKey{"non-empty", "non-empty"},
|
||||||
AttachmentKeys: attAlgoKeys,
|
DecryptedAttachmentKeys: attAlgoKeys,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -611,21 +611,21 @@ func TestSendReq(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"inline-html@gpg.com": {
|
"inline-html@gpg.com": {
|
||||||
Type: PGPInlinePackage,
|
Type: PGPInlinePackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "non-empty",
|
EncryptedBodyKeyPacket: "non-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
"html@email.com": {
|
"html@email.com": {
|
||||||
Type: ClearPackage,
|
Type: ClearPackage,
|
||||||
Signature: SignatureNone,
|
Signature: SignatureNone,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: PGPInlinePackage | ClearPackage,
|
Type: PGPInlinePackage | ClearPackage,
|
||||||
MIMEType: ContentTypeHTML,
|
MIMEType: ContentTypeHTML,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
BodyKey: AlgoKey{"non-empty", "non-empty"},
|
DecryptedBodyKey: AlgoKey{"non-empty", "non-empty"},
|
||||||
AttachmentKeys: attAlgoKeys,
|
DecryptedAttachmentKeys: attAlgoKeys,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -642,17 +642,17 @@ func TestSendReq(t *testing.T) {
|
|||||||
Signature: SignatureNone,
|
Signature: SignatureNone,
|
||||||
},
|
},
|
||||||
"inline-plain@gpg.com": {
|
"inline-plain@gpg.com": {
|
||||||
Type: PGPInlinePackage,
|
Type: PGPInlinePackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "non-empty",
|
EncryptedBodyKeyPacket: "non-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: PGPInlinePackage | ClearPackage,
|
Type: PGPInlinePackage | ClearPackage,
|
||||||
MIMEType: ContentTypePlainText,
|
MIMEType: ContentTypePlainText,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
BodyKey: AlgoKey{"non-empty", "non-empty"},
|
DecryptedBodyKey: AlgoKey{"non-empty", "non-empty"},
|
||||||
AttachmentKeys: attAlgoKeys,
|
DecryptedAttachmentKeys: attAlgoKeys,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -665,19 +665,19 @@ func TestSendReq(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"mime@gpg.com": {
|
"mime@gpg.com": {
|
||||||
Type: PGPMIMEPackage,
|
Type: PGPMIMEPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "non-empty",
|
EncryptedBodyKeyPacket: "non-empty",
|
||||||
},
|
},
|
||||||
"signed@email.com": {
|
"signed@email.com": {
|
||||||
Type: ClearMIMEPackage,
|
Type: ClearMIMEPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: ClearMIMEPackage | PGPMIMEPackage,
|
Type: ClearMIMEPackage | PGPMIMEPackage,
|
||||||
MIMEType: ContentTypeMultipartMixed,
|
MIMEType: ContentTypeMultipartMixed,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
BodyKey: AlgoKey{"non-empty", "non-empty"},
|
DecryptedBodyKey: AlgoKey{"non-empty", "non-empty"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -690,19 +690,19 @@ func TestSendReq(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"mime@gpg.com": {
|
"mime@gpg.com": {
|
||||||
Type: PGPMIMEPackage,
|
Type: PGPMIMEPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "non-empty",
|
EncryptedBodyKeyPacket: "non-empty",
|
||||||
},
|
},
|
||||||
"mime@email.com": { // can this be combined ?
|
"mime@email.com": { // can this be combined ?
|
||||||
Type: ClearMIMEPackage,
|
Type: ClearMIMEPackage,
|
||||||
Signature: SignatureNone,
|
Signature: SignatureNone,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: ClearMIMEPackage | PGPMIMEPackage,
|
Type: ClearMIMEPackage | PGPMIMEPackage,
|
||||||
MIMEType: ContentTypeMultipartMixed,
|
MIMEType: ContentTypeMultipartMixed,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
BodyKey: AlgoKey{"non-empty", "non-empty"},
|
DecryptedBodyKey: AlgoKey{"non-empty", "non-empty"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -724,9 +724,9 @@ func TestSendReq(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{ // TODO can this three be combined
|
Addresses: map[string]*MessageAddress{ // TODO can this three be combined
|
||||||
"mime@gpg.com": {
|
"mime@gpg.com": {
|
||||||
Type: PGPMIMEPackage,
|
Type: PGPMIMEPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "non-empty",
|
EncryptedBodyKeyPacket: "non-empty",
|
||||||
},
|
},
|
||||||
"mime@email.com": {
|
"mime@email.com": {
|
||||||
Type: ClearMIMEPackage,
|
Type: ClearMIMEPackage,
|
||||||
@ -737,60 +737,60 @@ func TestSendReq(t *testing.T) {
|
|||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: ClearMIMEPackage | PGPMIMEPackage,
|
Type: ClearMIMEPackage | PGPMIMEPackage,
|
||||||
MIMEType: ContentTypeMultipartMixed,
|
MIMEType: ContentTypeMultipartMixed,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
BodyKey: AlgoKey{"non-empty", "non-empty"},
|
DecryptedBodyKey: AlgoKey{"non-empty", "non-empty"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"plain@pm.me": {
|
"plain@pm.me": {
|
||||||
Type: InternalPackage,
|
Type: InternalPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "not-empty",
|
EncryptedBodyKeyPacket: "not-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
"plain@email.com": {
|
"plain@email.com": {
|
||||||
Type: ClearPackage,
|
Type: ClearPackage,
|
||||||
Signature: SignatureNone,
|
Signature: SignatureNone,
|
||||||
},
|
},
|
||||||
"inline-plain@gpg.com": {
|
"inline-plain@gpg.com": {
|
||||||
Type: PGPInlinePackage,
|
Type: PGPInlinePackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "non-empty",
|
EncryptedBodyKeyPacket: "non-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: InternalPackage | ClearPackage | PGPInlinePackage,
|
Type: InternalPackage | ClearPackage | PGPInlinePackage,
|
||||||
MIMEType: ContentTypePlainText,
|
MIMEType: ContentTypePlainText,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
BodyKey: AlgoKey{"non-empty", "non-empty"},
|
DecryptedBodyKey: AlgoKey{"non-empty", "non-empty"},
|
||||||
AttachmentKeys: attAlgoKeys,
|
DecryptedAttachmentKeys: attAlgoKeys,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Addresses: map[string]*MessageAddress{
|
Addresses: map[string]*MessageAddress{
|
||||||
"html@pm.me": {
|
"html@pm.me": {
|
||||||
Type: InternalPackage,
|
Type: InternalPackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "not-empty",
|
EncryptedBodyKeyPacket: "not-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
"html@email.com": {
|
"html@email.com": {
|
||||||
Type: ClearPackage,
|
Type: ClearPackage,
|
||||||
Signature: SignatureNone,
|
Signature: SignatureNone,
|
||||||
},
|
},
|
||||||
"inline-html@gpg.com": {
|
"inline-html@gpg.com": {
|
||||||
Type: PGPInlinePackage,
|
Type: PGPInlinePackage,
|
||||||
Signature: SignatureDetached,
|
Signature: SignatureDetached,
|
||||||
BodyKeyPacket: "non-empty",
|
EncryptedBodyKeyPacket: "non-empty",
|
||||||
AttachmentKeyPackets: attKeyPackets,
|
EncryptedAttachmentKeyPackets: attKeyPackets,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: InternalPackage | ClearPackage | PGPInlinePackage,
|
Type: InternalPackage | ClearPackage | PGPInlinePackage,
|
||||||
MIMEType: ContentTypeHTML,
|
MIMEType: ContentTypeHTML,
|
||||||
Body: "non-empty",
|
EncryptedBody: "non-empty",
|
||||||
BodyKey: AlgoKey{"non-empty", "non-empty"},
|
DecryptedBodyKey: AlgoKey{"non-empty", "non-empty"},
|
||||||
AttachmentKeys: attAlgoKeys,
|
DecryptedAttachmentKeys: attAlgoKeys,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user