[BlackBerry] CredentialBackingStore implement encryptString() and decryptString()
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Mar 2012 15:37:11 +0000 (15:37 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Mar 2012 15:37:11 +0000 (15:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82204

Patch by Jonathan Dong <jonathan.dong@torchmobile.com.cn> on 2012-03-26
Reviewed by Rob Buis.

Implemented encryptedString() and decryptedString() in class CredentialBackingStore
by calling BlackBerry::Platform::Encryptor::encryptString() and
BlackBerry::Platform::Encryptor::encryptString() respectively.

No new tests.

* platform/network/blackberry/CredentialBackingStore.cpp:
(WebCore::CredentialBackingStore::encryptedString):
(WebCore::CredentialBackingStore::decryptedString):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112104 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/network/blackberry/CredentialBackingStore.cpp

index a598e93..f23e582 100644 (file)
@@ -1,3 +1,20 @@
+2012-03-26  Jonathan Dong  <jonathan.dong@torchmobile.com.cn>
+
+        [BlackBerry] CredentialBackingStore implement encryptString() and decryptString()
+        https://bugs.webkit.org/show_bug.cgi?id=82204
+
+        Reviewed by Rob Buis.
+
+        Implemented encryptedString() and decryptedString() in class CredentialBackingStore
+        by calling BlackBerry::Platform::Encryptor::encryptString() and
+        BlackBerry::Platform::Encryptor::encryptString() respectively.
+
+        No new tests.
+
+        * platform/network/blackberry/CredentialBackingStore.cpp:
+        (WebCore::CredentialBackingStore::encryptedString):
+        (WebCore::CredentialBackingStore::decryptedString):
+
 2012-03-26  Pavel Feldman  <pfeldman@chromium.org>
 
         Web Inspector: 'use strict' exceptions stop in inspector code
index ae89dc8..ab9a892 100644 (file)
@@ -28,6 +28,7 @@
 #include "ProtectionSpaceHash.h"
 #include "SQLiteStatement.h"
 #include <BlackBerryPlatformClient.h>
+#include <BlackBerryPlatformEncryptor.h>
 
 #define HANDLE_SQL_EXEC_FAILURE(statement, returnValue, ...) \
     if (statement) { \
@@ -423,16 +424,16 @@ bool CredentialBackingStore::clearNeverRemember()
 
 String CredentialBackingStore::encryptedString(const String& plainText) const
 {
-    // FIXME: Need encrypt plainText here
-    notImplemented();
-    return plainText;
+    std::string cipherText;
+    BlackBerry::Platform::Encryptor::encryptString(std::string(plainText.latin1().data()), &cipherText);
+    return String(cipherText.c_str());
 }
 
 String CredentialBackingStore::decryptedString(const String& cipherText) const
 {
-    // FIXME: Need decrypt cipherText here
-    notImplemented();
-    return cipherText;
+    std::string plainText;
+    BlackBerry::Platform::Encryptor::decryptString(std::string(cipherText.latin1().data()), &plainText);
+    return String(plainText.c_str());
 }
 
 } // namespace WebCore