Comment 57 for bug 1085526

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

I've had look at the code (in poppler/ not glib/ i'll leave that to the glib/ experts) and have some minor and some major comments.

Minor:
 * There's 3 use of malloc i could find, for completion i guess it's better if you use gmalloc
 * SigStatusStruct should be a C++ class

Medium:
 * I'm not convinced getSigningTime should return a char *, i'd very much prefer it returning an integer and shifting the responsability to turn it into a string to upper layers, since allows for translations, etc.

Major:
 * There's lots of repeated code (the loops searching for "Annot"+"Sig" some of these with more checks for nulls than others) and some functions that make no sense in PDFDoc like Object *getByteRange(int index);

If you see in Form::Form we're already parsing "Fields" and creating FormFieldSignature for each "Sig" object.

My suggestion is that you expand FormFieldSignature with your implementation.

That also solves API issues like for for example getSignerName should not be in PDFDoc since you need to have called validateSignature before and then it returns the signer name for the signature of that index, so it should be part of a signature object, i.e. FormFieldSignature.

Do you think it makes sense?