Diffusion Kube 0ed9290279f0
Authored by knauss on Jul 14 2016, 4:36 PM.

Description

updated

knauss added inline comments.Jul 14 2016, 4:48 PM
/framework/domain/mimetreeparser/interface.h
252

CertPart is the same Idea like VCardPard or InvirationPart, help the viewer to display parts differntly, not a boring list of attachments.

  • GPGKeys are application/octetstream - so no nice mimetype to match, that why we may need so deeper inverstigation.
  • why not the handling complety in Client, because we want a very good and deep crypto intetration for every client that is using mimetreeparser.
  • the same is also true for vCard and Invitation handing, this could also "just be done" in client by mimetype matchnig.

previous discussion was done accidently inside kube phab: https://git.kolab.org/D196

cmollekopf added inline comments.
/framework/domain/mimetreeparser/interface.h
92–128

Why do we have those new parts? They shouldn't be necessary.

183

Why does this return a TextPart now and not the content?

No we also have TextPart "just" representing a QByteArray. To make GPGInline workable. And other structural elements like EncryptionPart and SignaturePart.

So we have different types of Parts:
StructuralParts: SignaturePart, EncryptionPart, MainContentPart
ContentParts: MimePart, AttachmentPart, TextPart

None of this new parts should exist in the interface.

void pointer - no way with that we really make the software not safer in terms of BIC and API breakage :D Because now nobody knows, that is inside this void pointer.

It does help for the interface.
It's then up to the user to deal with whatever is extracted from the void pointer.

If you assume that the void pointer always returns the same structure and that every user of the library will have to access that anyways, then this design isn't very useful of course.
But if we don't need to access it in the majority of cases and you simply want to make the it still possible for some future usecases, then this is a viable way to go.

The point of the void pointer is of course as well that it is a generic handle to whatever underlying datastructure, should we i.e. not use gpgme for some reason.

can something like this help:

class gpgmestructure;

class Signature {
  public:
     str::shared_ptr<gpgmestructure> getGPGmepointer();
}

and in private header:

class gpgmestructure
{
  public:
    GpgMe::Signature signature();
}

this way we make public interface free of use of GpgMe and make it obvious to use the private headers with risk?

I suppose this would be possible, although I don't know if it would really solve all BIC problems (but it seems to me like it)

If we have the risk of BIC/API breakage, than we need to add complete interface for the GpgMe structures.

This means:

class Singature

class GPGSignature : public Signaute

and anytime in future maybe:

class PEPSignature : public Signature

Which would break BC anyways so you could just as well return GPGSignature, unless you want to extend it somehow.

If you think GPGSignature is the right interface for clients to get to all they need to know for the signature then use that. Should we figure out that we need something different after all then we'll just break BIC and release version 2.

cmollekopf added inline comments.Jul 15 2016, 12:18 PM
/framework/domain/mimetreeparser/interface.h
252

Ok, so you want to have various AttachmentPart subclasses for specific attachments where we can provide some additional helpers to i.e. retrieve the "method" from the iTip part or things like that. Makes sense.

257

What would this do exactly? Or is this just an example?

258

Same here, what would this do? Is that really something the mimetreeparser should be doing?

I suppose this would be possible, although I don't know if it would really solve all BIC problems (but it seems to me like it)

well no it doesn't reslove the BIC problems, because also if GpgME breaks BIC, the cleitn software needs to be recompiled. But without void pointers it should be more clear, that there is this connection.

Singature/GPGSignature/PEPSignature

Which would break BC anyways so you could just as well return GPGSignature, unless you want to extend it somehow.
If you think GPGSignature is the right interface for clients to get to all they need to know for the signature then use that. Should we figure out that we need something different after all then we'll just break BIC and release version 2.

No this won't break BIC, because the existing classes aren't touched. So an existing client can still interact with mimetreeparser.All methods defined in Signature baseclass are still working and also the special GPGSignature routines works like before. We only break BIC if we touch the Signature class and remove methods and or change existing method headers.

/framework/domain/mimetreeparser/interface.h
183

Because otherwise we can't handle the GPGInline not correctly. Keep in mind, that you have one mainpart, that can be encrypted/signed partly. see (#INLINE GPG encrypted msg + attachment and #alternative msg with GPGInline)

here we have different TextParts that are encryped/signed differntly. Because GPG Inline is underspecified MUAs do much crap and we have to deal with it. mailman f.ex. also just adds his footer to text/plain messages at the end.

My thought was:
Part as BasisClass just handles the parent/subparts
TextPart is the BasisClasses for all ContentParts where you can get Content from.
The structual Classes you may want to deal with to request also all attachments for the current crypted container:

collect<AttachmentParts>(enc1part,...)

but okay now i see that we already can perform requests like this with the correct filter function

bool filter(AttachmentPart part){
    return enc1 in part.encryptions
}

or

bool filter(AttachmentPart part){
    return enc1 == part.encryptions[0]
}

okay so no need to add Signature/EncryptionParts to public interface

257

this was just a example.

258

I think that Cert detection should be really done in mimetreeparser, because it usecases is to detect special parts in the mimetree.

But if mimetreeparser is responsible for importing - mmh not really. And here it is quite easy, the cert is available as text via the content() method, so the client can get the cert.

These can be interessting and are available for every Cert:
Type is a thing that matters for the client ("GPG",SMIME" maybe SSH) ( I often get ssh pubkeys for acces to sever)
SubType ("Public", "Private")
KeyLength