Changeset 80407 in webkit


Ignore:
Timestamp:
Mar 4, 2011 10:02:45 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-03-04 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com>

Reviewed by Laszlo Gombos.

[Qt] Need symbian version of cryptographicallyRandomValuesFromOS
https://bugs.webkit.org/show_bug.cgi?id=55782

Implement Symbian version of cryptographicallyRandomValuesFromOS

  • wtf/OSRandomSource.cpp: (WTF::cryptographicallyRandomValuesFromOS):
Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r80397 r80407  
     12011-03-04  Viatcheslav Ostapenko  <ostapenko.viatcheslav@nokia.com>
     2
     3        Reviewed by Laszlo Gombos.
     4
     5        [Qt] Need symbian version of cryptographicallyRandomValuesFromOS
     6        https://bugs.webkit.org/show_bug.cgi?id=55782
     7
     8        Implement Symbian version of cryptographicallyRandomValuesFromOS
     9
     10        * wtf/OSRandomSource.cpp:
     11        (WTF::cryptographicallyRandomValuesFromOS):
     12
    1132011-03-04  Gavin Barraclough  <barraclough@apple.com>
    214
  • trunk/Source/JavaScriptCore/wtf/OSRandomSource.cpp

    r78421 r80407  
    3030#include <stdlib.h>
    3131
     32#if OS(SYMBIAN)
     33#include <e32math.h>
     34#endif
     35
    3236#if OS(UNIX)
    3337#include <fcntl.h>
     
    4549void cryptographicallyRandomValuesFromOS(unsigned char* buffer, size_t length)
    4650{
    47 #if OS(UNIX)
     51#if OS(SYMBIAN)
     52    TInt random;
     53    while (length > sizeof(random)) {
     54        random = Math::Random();
     55        memcpy(buffer, &random, sizeof(random));
     56        length -= sizeof(random);
     57        buffer += sizeof(random);
     58    }
     59    if (length > 0) {
     60        random = Math::Random();
     61        memcpy(buffer, &random, length);
     62    }
     63#elif OS(UNIX)
    4864    int fd = open("/dev/urandom", O_RDONLY, 0);
    4965    if (fd < 0)
Note: See TracChangeset for help on using the changeset viewer.