Hi,
The code you are describing is general wap code and doesn't have anything to do
with the wtls patch. This is part of the wap_event_assert() function and should
be there. If you use buggy emulators that send NULL data, you should disable
assertions, not introduce bugs to wap_event_support. In production you should
also not use assertions anyway.
As far as the MAC length goes, I have been using the Openwave 6.2.2 emulator,
among others. I am not getting the problem you stet, however, I am getting
Invalid WSP packet received by kannel. Therefore, I do not use Openwave for
wtls tests, rather I use the Nokia NMBS 4.0 and Winwap. What version Openwave
are you using?
The mac[10] used there is just for printing purposes in debug logs, not the
algos. That's why propably I've never had it in production, since I don't use
debug level in production logs, for performance reasons. Largest names are
SHA_NOLIMIT and MD5_NOLIMIT, each 11 bytes long. So mac[15] should be fine.
Can you submit a patch to devel, or should I do it?
BR,
Nikos
- Original Message -
From: Armindo Antunes
To: Nikos Balkanas
Cc: us...@vm1.kannel.org
Sent: Friday, July 22, 2011 5:02 PM
Subject: Re: wap 1.x and wtls
Ops, wrong line numbering.
wap/wap_events.c:
229: #define OCTSTR(name)
230: //gw_assert(p-name != NULL);
231: /* This is a trick to make the Octstr module run its
assertions */
232: //gw_assert(octstr_len(p-name) = 0);
On 22-07-2011 14:57, Armindo Antunes wrote:
Hi again :)
I'm now able to use WTLS with the openwave simulator.
I've commented the `p-user_data != NULL' assert section in the code
wap/wap_events.c
233: #define OCTSTR(name)
234: //gw_assert(p-name != NULL);
235: /* This is a trick to make the Octstr module run its
assertions */
236: //gw_assert(octstr_len(p-name) = 0);
I'm not sure why this was null but removing the null assertion seems to
work.
Best regards,
Armindo Antunes
On 22-07-2011 12:15, Armindo Antunes wrote:
Hi all
@Nikos: Thanks for posting the WTLS documentation and for all the
support! :)
About the code, I'me using the version 1.5 from a yesterday daily
snapshot, so I have the right code.
By analyzing the code, I've solved the crash:
In the file wap/wtls_statesupport.c:1174, mac size of 10 is too small
for macs like: SHA_NOLIMIT, MD5_NOLIMIT
I've fixed this issue by increasing mac size:
1174: char cipher[20], mac[15];
But now, I have another crash :-(
2011-07-22 12:02:25 [20568] [5] PANIC: wap/wap_events.def:142:
wap_event_assert: Assertion `p-user_data != NULL' failed.
Detailed logs:
2011-07-22 12:02:25 [20568] [1] WARNING: Did not expect value-length with
'Accept-Charset' header, skipping.
2011-07-22 12:02:25 [20568] [1] WARNING: WSP: Accept-Charset: skipping 2
trailing octets.
2011-07-22 12:02:25 [20568] [1] WARNING: Skipping faulty header.
2011-07-22 12:02:25 [20568] [1] WARNING: Did not expect value-length with
'Accept-Charset' header, skipping.
2011-07-22 12:02:25 [20568] [1] WARNING: WSP: Accept-Charset: skipping 2
trailing octets.
2011-07-22 12:02:25 [20568] [1] WARNING: Skipping faulty header.
2011-07-22 12:02:25 [20568] [1] DEBUG: WSP: decoded headers:
2011-07-22 12:02:25 [20568] [1] DEBUG: Encoding-version: 1.3
2011-07-22 12:02:25 [20568] [1] DEBUG: Accept: application/vnd.wap.wmlc,
application/vnd.wap.wmlscriptc, application/vnd.wap.multipart.related,
application/vnd.wap.multipart.mixed, application/vnd.phonecom.mmc-wbxml,
application/octet-stream, application/vnd.oma.drm.message, text/plain,
text/css, image/bmp, image/gif, image/jpeg, image/png, image/vnd.wap.wbmp,
application/vnd.wap.sic, application/vnd.wap.slc, application/vnd.wap.coc,
application/vnd.wap.connectivity-wbxml, application/vnd.wap.xhtml+xml,
application/xhtml+xml;profile=http://www.wapforum.org/xhtml;, text/html,
application/smil, application/vnd.wap.mms-message,
application/vnd.oma.drm.content, application/vnd.oma.drm.message,
application/vnd.oma.drm.rights+xml, application/vnd.oma.drm.rights+wbxml,
image/svg+xml, image/pjpeg, application/x-shockwave-flash,
image/x-vnd.openwave.lzrw1, application/vnd.openwave.svg,
text/vnd.sun.j2me.app-descriptor, application/java-archive, application/java,
application/vnd.oma.dd+xml, text/x-vmessage, image/ems, audio/wav, audio/x-wav,
audio/midi, audio/x-midi, application/vnd.uplanet.bearer-choice-wbxml
2011-07-22 12:02:25 [20568] [1] DEBUG: User-Agent: OPWV-SDK
UP.Browser/7.0.2.3.119 (GUI) MMP/2.0 Push/PO
2011-07-22 12:02:25 [20568] [1] DEBUG: Accept-Language: en-GB
2011-07-22 12:02:25 [20568] [1] DEBUG: Accept-Language: en; q=0.8
2011-07-22 12:02:25 [20568] [1] DEBUG: Profile: