Open olerichter00 opened 8 years ago
Do you have a hex dump of the description?
Not yet and I won't be in the office until 2016.
Here is the hex dump
serviceName: 416e7374616c742066ffffffc3ffffffbc72204b6f6d6d756e616c6520446174656e766572617262656974756e6720696e2042617965726e3963316235396101
serviceURL: 68747470733a2f2f7777772e6275657267657273657276696365706f7274616c2e6465
certificateDescription: 4e616d652c20416e7363687269667420756e6420452d4d61696c2d4164726573736520646573204469656e737465616e626965746572733a0d0a416e7374616c742066ffffffc3ffffffbc72204b6f6d6d756e616c6520446174656e766572617262656974756e6720696e2042617965726e0d0a506f73746661636820313530203134300d0a3830333331204dffffffc3ffffffbc6e6368656e0d0a62756572676572736572766963652d626572656368746967756e67737a6572746966696b617440616b64622e64650d0a0d0a4765736368ffffffc3ffffffa46674737a7765636b3a0d0a53656c6273746175736b756e66740d0a0d0a48696e7765697320617566206469652066ffffffc3ffffffbc722064656e204469656e737465616e626965746572207a757374ffffffc3ffffffa46e646967656e205374656c6c656e2c20646965206469652045696e68616c74756e672064657220566f7273636872696674656e207a756d20446174656e73636875747a206b6f6e74726f6c6c696572656e3a0d0a4465722042617965726973636865204c616e64657362656175667472616774652066ffffffc3ffffffbc722064656e20446174656e73636875747a0d0a5761676dffffffc3ffffffbc6c6c657273747261ffffffc3ffffff9f652031380d0a3830353338204dffffffc3ffffffbc6e6368656e0d0a303839203231323637322d300d0a706f73747374656c6c6540646174656e73636875747a2d62617965726e2e64650d0a363145
The description is not correctly ASN.1 encoded. OpenSSL is not as tolerant as asn1c:
openssl asn1parse -inform DER -in description -dump
0:d=0 hl=2 l= 97 prim: appl [ 14 ]
99:d=0 hl=2 l= 116 cons: appl [ 9 ]
101:d=1 hl=2 l= 110 cons: appl [ 21 ]
103:d=2 hl=2 l= 32 cons: appl [ 7 ]
Error in encoding
140208391181968:error:0D07209B:asn1 encoding routines:ASN1_get_object:too long:asn1_lib.c:147:
You might want to contact the folks at https://www.buergerserviceportal.de with this problem. Actually this should not have happened in the first place with a legitimate SP.
This could in theory lead to code injection (e.g. when the description gets pasted into a html-textfield and the description includes javascript), However, any modern application should verify its inputs. You could add a note in the header file regarding this problem.
Could you please check whether your printed description is NUL
-terminated? I suppose it uses %s
instead of %.s
with printf()
and thus prints more data than available.
We get the error just with the SimpleClient. When I use the binary for the test case (Test_nPAClientLib_Selbstauskunft_Wuerzburg) everything is alright. I guess it has something to do with the eIDClientCore, because the SimpleClient and the TestCase both use the same code for the callback functions.
P.S. in eidui_cli.cpp the following code could potentially lead to a buffer overflow: snprintf(buf, MAX(sizeof buf, description->name.bufferSize), (char ) description->name.pDataBuffer); We changed it to: snprintf(buf, BUFFERSIZE, "%s", (char ) description->description.pDataBuffer);
Could you change it to the following?
snprintf(buf, BUFFERSIZE, "%.s", description->description.bufferSize, (char *) description->description.pDataBuffer);
ok.
There are some strange characters at the end of the url and at the end the text:
Zertifikat: Name, Anschrift und E-Mail-Adresse des Diensteanbieters: Anstalt für Kommunale Datenverarbeitung in Bayern Postfach 150 140 80331 München buergerservice-berechtigungszertifikat@akdb.de
Geschäftszweck: Selbstauskunft
Hinweis auf die für den Diensteanbieter zuständigen Stellen, die die Einhaltung der Vorschriften zum Datenschutz kontrollieren: Der Bayerische Landesbeauftragte für den Datenschutz Wagmüllerstraße 18 80538 München 089 212672-0 poststelle@datenschutz-bayern.de 61E