[webkit-dev] MD5 in WebCore

Fumitoshi Ukai (鵜飼文敏) ukai at chromium.org
Tue Apr 20 03:32:29 PDT 2010


I'm implementing new protocol of WebSocket (
http://www.whatwg.org/specs/web-socket-protocol/ ).
Since it now requires MD5 in handshake, I wonder how I could add MD5 in
WebCore.  For now, there is no MD5 in WebCore.  It is in
WebKitTools/DumpRenderTree to get message digest of image file.

I'm thinking to add new header file as WebCore/platform/MD5.h, which
provides the following functions.

  struct MD5_CTX;
  void MD5_Init(MD5_CTX*);
  void MD5_Update(MD5_CTX*, unsigned char* input, unsigned length);
  void MD5_Final(unsigned char hash[16], MD5_CTX*);

In Windows platform, it is implemented using "Cryptdll.dll".   Is it ok to
copy WebKitTools/DumpRenderTree/win/MD5.cpp to WebCore/platform/win/MD5.cpp,
or move?
In Mac platform, it is provided by <CommonCrypto/CommonDigest.h> with
#define COMMON_DIGEST_FOR_OPENSSL ?
In Chromium, there is chrome/src/base/md5.{h,cc}.   Should I copy this in
WebCore/platform/chromium, or add dependency to base from WebCore?
How about other ports?  is it ok to link openssl or some other library?  (or
use implementation used in chromium?)

I'm also wonder I need to put these functions in namespace WebCore.

Thanks in advance,
ukai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20100420/ac883ed4/attachment.html>


More information about the webkit-dev mailing list