Imported Upstream version 0.8~alpha1
[platform/upstream/syncevolution.git] / src / client-api / src / c++ / posix / spds / DESDecoder.cpp
index ab5b048..f27230d 100644 (file)
@@ -35,6 +35,9 @@
 
 #include "base/util/utils.h"
 #include "spds/DESDecoder.h"
+#include "base/globalsdef.h"
+
+USE_NAMESPACE
 
 
 DESDecoder::DESDecoder() : DataTransformer(DT_DES) {
@@ -52,7 +55,7 @@ char* DESDecoder::transform(char* data, TransformationInfo& info)
 /*
     TODO: implement this using openssl
 
-    BOOL res;
+    bool res;
 
     HCRYPTPROV prov = 0;
     HCRYPTKEY key = 0;
@@ -76,7 +79,7 @@ char* DESDecoder::transform(char* data, TransformationInfo& info)
         CRYPT_VERIFYCONTEXT
     );
 
-    if (res == FALSE) {
+    if (res == false) {
         lastErrorCode = ERR_DT_FAILURE;
         sprintf(lastErrorMsg, ERRMSG_DT_FAILURE, GetLastError());
         goto exit;
@@ -91,7 +94,7 @@ char* DESDecoder::transform(char* data, TransformationInfo& info)
         &hash      // handle to the hash object
     );
 
-    if (res == FALSE) {
+    if (res == false) {
         lastErrorCode = ERR_DT_FAILURE;
         sprintf(lastErrorMsg, ERRMSG_DT_FAILURE, GetLastError());
         goto exit;
@@ -105,7 +108,7 @@ char* DESDecoder::transform(char* data, TransformationInfo& info)
         0                              // flags not used
     );
 
-    if (res == FALSE) {
+    if (res == false) {
         lastErrorCode = ERR_DT_FAILURE;
         sprintf(lastErrorMsg, ERRMSG_DT_FAILURE, GetLastError());
         goto exit;
@@ -120,7 +123,7 @@ char* DESDecoder::transform(char* data, TransformationInfo& info)
         &key
     );
 
-    if (res == FALSE) {
+    if (res == false) {
         lastErrorCode = ERR_DT_FAILURE;
         sprintf(lastErrorMsg, ERRMSG_DT_FAILURE, GetLastError());
         goto exit;
@@ -135,7 +138,7 @@ char* DESDecoder::transform(char* data, TransformationInfo& info)
         0                          // flags not used
     );
 
-    if (res == FALSE) {
+    if (res == false) {
         lastErrorCode = ERR_DT_FAILURE;
         sprintf(lastErrorMsg, ERRMSG_DT_FAILURE, GetLastError());
         goto exit;
@@ -150,7 +153,7 @@ char* DESDecoder::transform(char* data, TransformationInfo& info)
         0                          // flags not used
     );
 
-    if (res == FALSE) {
+    if (res == false) {
         lastErrorCode = ERR_DT_FAILURE;
         sprintf(lastErrorMsg, ERRMSG_DT_FAILURE, GetLastError());
         goto exit;
@@ -159,20 +162,20 @@ char* DESDecoder::transform(char* data, TransformationInfo& info)
     res = CryptDecrypt (
         key,
         0,
-        TRUE,
+        true,
         0,
         (unsigned char*)data,
         &size
     );
 
-    if (res == FALSE) {
+    if (res == false) {
         lastErrorCode = ERR_DT_FAILURE;
         sprintf(lastErrorMsg, ERRMSG_DT_FAILURE, GetLastError());
         goto exit;
     }
 
     info.size = size;
-    info.newReturnedData = FALSE;
+    info.newReturnedData = false;
 
  exit: