Discussion:
[turba] Problem displaying S/MIME certificate
Philipp Faeustlin
2018-03-16 16:41:18 UTC
Permalink
I'm using the latest horde version 5.2.22 from pear with Turba 4.2.21.

Displaying an S/MIME Public Certificate out of an ldap directory works
in most cases, but not for all ldap entries.

For some entries I get the following error:

S/MIME Public Certificate: Error parsing S/MIME certficate:
error:0D07209B:asn1 encoding routines:ASN1_get_object:too long

I traced the error down to the function "toTurbaKeys" in
"./turba/lib/Driver.php"

I think this function does the mapping between ldap and turba
attributes. In this function there is a "trim" function that's trimming
my SMIME certificate. This seems to be the issue.

In most cases this is not a problem, but the value of the SMIME
certificate ends with "<C1>P<E3>^HJ\\<E1><99>}ek^M", where trim seems to
cut off "^M" resulting in an incomplete and invalid certificate.

Would it be possible not to trim every value?
--
Philipp FÀustlin
Jan Schneider
2018-03-22 15:22:34 UTC
Permalink
Post by Philipp Faeustlin
I'm using the latest horde version 5.2.22 from pear with Turba 4.2.21.
Displaying an S/MIME Public Certificate out of an ldap directory
works in most cases, but not for all ldap entries.
error:0D07209B:asn1 encoding routines:ASN1_get_object:too long
I traced the error down to the function "toTurbaKeys" in
"./turba/lib/Driver.php"
I think this function does the mapping between ldap and turba
attributes. In this function there is a "trim" function that's
trimming my SMIME certificate. This seems to be the issue.
In most cases this is not a problem, but the value of the SMIME
certificate ends with "<C1>P<E3>^HJ\\<E1><99>}ek^M", where trim
seems to cut off "^M" resulting in an incomplete and invalid
certificate.
Would it be possible not to trim every value?
Doing some code archaeology, I found that I explicitly added this
trim() myself 10 years ago. So there must be a reason for it. :)
I'm afraid it's not that simple.
--
Jan Schneider
The Horde Project
https://www.horde.org/
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Philipp Faeustlin
2018-03-26 10:17:59 UTC
Permalink
Post by Philipp Faeustlin
I'm using the latest horde version 5.2.22 from pear with Turba 4.2.21.
Displaying an S/MIME Public Certificate out of an ldap directory works
in most cases, but not for all ldap entries.
error:0D07209B:asn1 encoding routines:ASN1_get_object:too long
I traced the error down to the function "toTurbaKeys" in
"./turba/lib/Driver.php"
I think this function does the mapping between ldap and turba
attributes. In this function there is a "trim" function that's
trimming my SMIME certificate. This seems to be the issue.
In most cases this is not a problem, but the value of the SMIME
certificate ends with "<C1>P<E3>^HJ\\<E1><99>}ek^M", where trim seems
to cut off "^M" resulting in an incomplete and invalid certificate.
Would it be possible not to trim every value?
Doing some code archaeology, I found that I explicitly added this trim()
myself 10 years ago. So there must be a reason for it. :)
I'm afraid it's not that simple.
Coding is never simple and I appreciate your work.
But is the 10 years old reason still relevant?

I don't know when the hook system was implemented, but I didn't expect
that the data from the backends would be altered before it reaches the
hook, which is designed for doing such operations.
It took me quite some time find this, because I first thought there is a
problem with my hook or the original data from the backend.

At least I think this trim function should be mentioned in the hooks
documentation, so that it is clear, that the data arriving at the hook
might already be trimmed.
--
Philipp FÀustlin
Loading...