fix coding rule error 42/150242/4 accepted/tizen/unified/20170920.174505 submit/tizen/20170918.094635
authorjkjo92 <jkjo92@samsung.com>
Fri, 15 Sep 2017 02:09:27 +0000 (11:09 +0900)
committerjkjo92 <jkjo92@samsung.com>
Mon, 18 Sep 2017 07:28:40 +0000 (16:28 +0900)
Change-Id: I0381ea60810e68ccf8f0850f64e6b14c4ac7de8f
Signed-off-by: jkjo92 <jkjo92@samsung.com>
127 files changed:
common/AsmHelper.h
common/cryptoutil/inc/asmcrypto.h
common/cryptoutil/src/AsmCrypto.cpp
common/datatypes/auth/AuthnrTypes.h [changed mode: 0644->0755]
common/datatypes/inc/AsmAuthRequest.h [changed mode: 0644->0755]
common/datatypes/inc/AsmAuthResponse.h [changed mode: 0644->0755]
common/datatypes/inc/AsmDeregRequest.h [changed mode: 0644->0755]
common/datatypes/inc/AsmDeregResponse.h [changed mode: 0644->0755]
common/datatypes/inc/AsmGetInfoRequest.h [changed mode: 0644->0755]
common/datatypes/inc/AsmGetRegsResponse.h [changed mode: 0644->0755]
common/datatypes/inc/AsmRegRequest.h [changed mode: 0644->0755]
common/datatypes/inc/AsmRequest.h [changed mode: 0644->0755]
common/datatypes/inc/AsmResponse.h [changed mode: 0644->0755]
common/datatypes/inc/GetInfoResponse.h [changed mode: 0644->0755]
common/datatypes/src/AsmAuthRequest.cpp [changed mode: 0644->0755]
common/datatypes/src/AsmAuthResponse.cpp [changed mode: 0644->0755]
common/datatypes/src/AsmDeregRequest.cpp [changed mode: 0644->0755]
common/datatypes/src/AsmGetRegsResponse.cpp [changed mode: 0644->0755]
common/datatypes/src/AsmRegRequest.cpp [changed mode: 0644->0755]
common/datatypes/src/AsmRegResponse.cpp [changed mode: 0644->0755]
common/datatypes/src/AsmRequest.cpp [changed mode: 0644->0755]
common/datatypes/src/AsmResponse.cpp [changed mode: 0644->0755]
common/jsonutil/inc/JsonUtil.h [changed mode: 0644->0755]
common/jsonutil/src/JsonUtil.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/inc/AttBasicFullTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/AttBasicSurrTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/AuthAssertionInfoTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/AuthCountersInfoTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/BufferTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/DeRegReqTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/DeRegRespTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/GetInfoReqTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/GetInfoRespTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/ITlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/IntTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/RegAssertionInfoTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/RegAuthAssertionTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/RegCountersInfoTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/RegReqTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/RegRespTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/SignAuthAssertionTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/SignReqTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/SignRespTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/SignedDataTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/StringTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/TlvData.h [changed mode: 0644->0755]
common/uafv1tlvutil/inc/Uafv1KrdTlvEncoder.h [changed mode: 0644->0755]
common/uafv1tlvutil/src/AttBasicFullTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/AuthAssertionInfoTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/AuthCountersInfoTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/BufferTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/DeRegReqTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/DeRegRespTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/GetInfoRespTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/IntTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/RegAssertionInfoTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/RegAuthAssertionTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/RegCountersInfoTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/RegReqTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/RegRespTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/SignAuthAssertionTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/SignReqTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/SignRespTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/SignedDataTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/StringTlvEncoder.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/Tlv.cpp [changed mode: 0644->0755]
common/uafv1tlvutil/src/Uafv1KrdTlvEncoder.cpp [changed mode: 0644->0755]
common/uiutil/src/AcUiAdaptor.cpp [changed mode: 0644->0755]
common/uiutil/src/PinAuthUiAdaptor.cpp [changed mode: 0644->0755]
common/uiutil/src/TCUiAdaptor.cpp [changed mode: 0644->0755]
server/auth_discovery/inc/AuthIndexHanlder.h [changed mode: 0644->0755]
server/auth_discovery/inc/AuthManager.h [changed mode: 0644->0755]
server/auth_discovery/inc/BAuthStub.h [changed mode: 0644->0755]
server/auth_discovery/inc/BoundADProvider.h [changed mode: 0644->0755]
server/auth_discovery/inc/BtAdProvider.h [changed mode: 0644->0755]
server/auth_discovery/inc/BtCon.h [changed mode: 0644->0755]
server/auth_discovery/inc/IADProvider.h [changed mode: 0644->0755]
server/auth_discovery/inc/IAuthConnection.h [changed mode: 0644->0755]
server/auth_discovery/inc/IAuthStub.h [changed mode: 0644->0755]
server/auth_discovery/inc/LocalCon.h [changed mode: 0644->0755]
server/auth_discovery/inc/RAuthStub.h [changed mode: 0644->0755]
server/auth_discovery/inc/RoamingUtil.h [changed mode: 0644->0755]
server/auth_discovery/src/AuthIndexHanlder.cpp [changed mode: 0644->0755]
server/auth_discovery/src/AuthManager.cpp [changed mode: 0644->0755]
server/auth_discovery/src/BAuthStub.cpp [changed mode: 0644->0755]
server/auth_discovery/src/BoundADProvider.cpp
server/auth_discovery/src/BtADProvider.cpp
server/auth_discovery/src/BtCon.cpp [changed mode: 0644->0755]
server/auth_discovery/src/RAuthStub.cpp [changed mode: 0644->0755]
server/auth_discovery/src/RoamingUtil.cpp
server/inc/AsmStorage.h [changed mode: 0644->0755]
server/inc/ClientListener.h [changed mode: 0644->0755]
server/ops/inc/AsmOp.h [changed mode: 0644->0755]
server/ops/inc/AuthenticateOp.h [changed mode: 0644->0755]
server/ops/inc/DeregOp.h [changed mode: 0644->0755]
server/ops/inc/GetInfoOp.h [changed mode: 0644->0755]
server/ops/inc/GetRegsOp.h [changed mode: 0644->0755]
server/ops/inc/OpenSettingOp.h [changed mode: 0644->0755]
server/ops/inc/RegisterOp.h [changed mode: 0644->0755]
server/ops/src/AsmOp.cpp [changed mode: 0644->0755]
server/ops/src/AsmOpFactory.cpp [changed mode: 0644->0755]
server/ops/src/GetInfoOp.cpp [changed mode: 0644->0755]
server/src/AsmStorage.cpp
server/src/ClientListener.cpp [changed mode: 0644->0755]
server/states/inc/AuthenticateState.h [changed mode: 0644->0755]
server/states/inc/DeregState.h [changed mode: 0644->0755]
server/states/inc/EnrollState.h [changed mode: 0644->0755]
server/states/inc/GetRegsState.h [changed mode: 0644->0755]
server/states/inc/InitState.h [changed mode: 0644->0755]
server/states/inc/RegisterState.h [changed mode: 0644->0755]
server/states/inc/TCState.h [changed mode: 0644->0755]
server/states/inc/VerifyState.h [changed mode: 0644->0755]
server/states/src/AuthenticateState.cpp [changed mode: 0644->0755]
server/states/src/DeregState.cpp [changed mode: 0644->0755]
server/states/src/EnrollState.cpp [changed mode: 0644->0755]
server/states/src/GetRegsState.cpp [changed mode: 0644->0755]
server/states/src/RegisterState.cpp [changed mode: 0644->0755]
server/states/src/TCState.cpp [changed mode: 0644->0755]
server/states/src/VerifyState.cpp [changed mode: 0644->0755]
silent_auth/silent_auth_entry.cpp
test/RADemoTV/inc/util.h [changed mode: 0644->0755]
test/RADemoTV/src/fido_handler.c
test/shell_tc/fido_asm_shell_tc.cpp
test/shell_tc/fido_asm_shell_tc_util.cpp [changed mode: 0644->0755]
test/shell_tc/fido_asm_shell_tc_util.h [changed mode: 0644->0755]
ui/src/asm_ui.c
ui/src/asm_ui_ipc.c [changed mode: 0644->0755]

index c44f577..dea67ba 100755 (executable)
 #include <stdlib.h>
 
 #define RET_IF_FAIL_VOID(cond) do {\
-               if (!(cond)){\
+               if (!(cond)) {\
                        return;\
-               }\
-} while(0)
+               } \
+} while (0)
 
 #define RET_IF_FAIL(cond, err) do {\
-               if (!(cond)){\
+               if (!(cond)) {\
                        return err;\
-               }\
-} while(0)
+               } \
+} while (0)
 
 #define CATCH_IF_FAIL(cond) do {\
-               if (!(cond)){\
+               if (!(cond)) {\
                        goto CATCH;\
-               }\
-} while(0)
+               } \
+} while (0)
 
 #define CATCH_IF_FAIL_X(cond, expr) do {\
-               if (!(cond)){\
+               if (!(cond)) {\
                        expr;\
                        goto CATCH;\
-               }\
-} while(0)
+               } \
+} while (0)
 
 #define GOTO_IF_FAIL(cond, catch_block) do {\
-               if (!(cond)){\
+               if (!(cond)) {\
                        goto catch_block;\
-               }\
-} while(0)
+               } \
+} while (0)
 
 #define SAFE_DELETE(x) do {\
        if (x != NULL) {\
                free(x);    \
                x = NULL;\
-       }\
-} while(0)
+       } \
+} while (0)
 
 #define _SAFE_DUP(x) ((x) ? strdup(x) : NULL)
 
index edb6b0b..d753417 100755 (executable)
 #include <pkgmgr-info.h>
 
 class AsmCrypto {
-
 public:
        static int genRandom(unsigned char *random, int num);
        static bool genHash256(const void* input, unsigned long length, unsigned char* md);
        static int genRSAKeyPair(char *pubkey, char *prikey, const char *passwd, int keysize);
-       static int genRSASignValue(const char *privkey, const char * passwd, const unsigned char * msg, unsigned int len, unsigned char *sign,unsigned int *signlen);
+       static int genRSASignValue(const char *privkey, const char * passwd, const unsigned char * msg, unsigned int len, unsigned char *sign, unsigned int *signlen);
        static int genB64Encode(const unsigned char *input, int inlen, unsigned char * output, int *outlen);
        static unsigned char *ToBase64Url(const unsigned char *input, int inputLen);
        static int genB64Decodes(const unsigned char *input, int inlen, unsigned char * output, int *outlen);
index 8abdfe5..a8ed962 100755 (executable)
@@ -40,45 +40,55 @@ void
 AsmCrypto::logDataToFile(const char *file_name_prefix, const char *data, int data_len)
 {
        char fn[128] = {0, };
-       char resolved_path[128];
+       char *realpath_res = NULL;
        snprintf(fn, 127, "%s%s", LOG_FILE_PATH, file_name_prefix);
 
-       if(realpath(fn, resolved_path) == NULL) {
+       realpath_res = realpath(fn, NULL);
+       if (realpath_res == NULL) {
                _ERR("realpath error");
+               SAFE_DELETE(realpath_res);
                return;
        }
        FILE *fp = fopen(fn, "w+");
-       if (fp == NULL)
+       if (fp == NULL) {
+               SAFE_DELETE(realpath_res);
                return;
+       }
 
        int num = fwrite(data, sizeof(char), data_len, fp);
 
        _INFO("[%d] bytes logged in [%s]", num, fn);
 
        fclose(fp);
+       SAFE_DELETE(realpath_res);
 }
 
 void
 AsmCrypto::logRawDataToFile(const char *file_name_prefix, const unsigned char *data, int data_len)
 {
        char fn[128] = {0, };
-       char resolved_path[128];
+       char *realpath_res = NULL;
        snprintf(fn, 127, "%s%s", LOG_FILE_PATH, file_name_prefix);
 
-       if(realpath(fn, resolved_path) == NULL) {
+       realpath_res = realpath(fn, NULL);
+       if (realpath_res == NULL) {
                _ERR("realpath error");
+               SAFE_DELETE(realpath_res);
                return;
        }
 
        FILE *fp = fopen(fn, "w+");
-       if (fp == NULL)
+       if (fp == NULL) {
+               SAFE_DELETE(realpath_res);
                return;
+       }
 
        int num = fwrite(data, sizeof(unsigned char), data_len, fp);
 
        _INFO("[%d] bytes logged in [%s]", num, fn);
 
        fclose(fp);
+       SAFE_DELETE(realpath_res);
 }
 
 static int
@@ -88,17 +98,17 @@ __der_cert_new(unsigned char *raw_cert, size_t cert_size, _der_cert_s **ppcert)
 
        _der_cert_s *pcert;
 
-       if(raw_cert == NULL || cert_size <= 0 || ppcert == NULL) {
+       if (raw_cert == NULL || cert_size <= 0 || ppcert == NULL) {
                return -1;
        }
 
        pcert = static_cast<_der_cert_s*>(malloc(sizeof(_der_cert_s)));
-       if(pcert == NULL) {
+       if (pcert == NULL) {
                return -1;
        }
 
        pcert->raw_cert = reinterpret_cast<unsigned char*>(malloc(cert_size));
-       if(pcert->raw_cert == NULL) {
+       if (pcert->raw_cert == NULL) {
                free(pcert);
                return -1;
        }
@@ -117,7 +127,7 @@ __load_cert_from_x509(X509 *xCert, _der_cert_s **cert)
 {
         _INFO("__load_cert_from_x509 start");
 
-       if(xCert == NULL) {
+       if (xCert == NULL) {
        return -1;
        }
 
@@ -190,10 +200,12 @@ AsmCrypto::getAsmToken(void)
                return macStr;
        }
 
-       char resolved_path[128];
+       char *realpath_res = NULL;
 
-       if(realpath(ASM_CONFIG_FILE, resolved_path) == NULL) {
+       realpath_res = realpath(ASM_CONFIG_FILE, NULL);
+       if (realpath_res == NULL) {
                _ERR("realpath error");
+               SAFE_DELETE(realpath_res);
                return std::string();
        }
 
@@ -237,9 +249,9 @@ AsmCrypto::getAsmToken(void)
                SAFE_DELETE(mac);
 
                bt_deinitialize();
+               SAFE_DELETE(realpath_res);
                return tok;
-       }
-       else {
+       } else {
                fseek(file, 0, SEEK_END);
                long size = ftell(file);
                if (size <= 0) {
@@ -247,6 +259,7 @@ AsmCrypto::getAsmToken(void)
                        _END;
 
                        bt_deinitialize();
+                       SAFE_DELETE(realpath_res);
                        return std::string();
                } else if (size > 1000) {
                        _ERR("Too big config file, size=[%d], allowed=[1000]", size);
@@ -254,6 +267,7 @@ AsmCrypto::getAsmToken(void)
                        _END;
 
                        bt_deinitialize();
+                       SAFE_DELETE(realpath_res);
                        return std::string();
                }
 
@@ -267,6 +281,7 @@ AsmCrypto::getAsmToken(void)
                        _END;
 
                        bt_deinitialize();
+                       SAFE_DELETE(realpath_res);
                        return std::string();
                }
 
@@ -279,7 +294,7 @@ AsmCrypto::getAsmToken(void)
                asmTok = strdup(config);
                SAFE_DELETE(config);
 
-               bt_deinitialize();
+               SAFE_DELETE(realpath_res);
                return tok;
        }
 }
@@ -308,12 +323,9 @@ AsmCrypto::genRandom(unsigned char *random, int num)
 {
        int ret;
        ret = RAND_bytes(random, num);
-       if(ret != -1)
-       {
+       if (ret != -1)  {
                return 0;
-       }
-       else
-       {
+       } else {
                return -1;
        }
 }
@@ -322,13 +334,13 @@ bool
 AsmCrypto::genHash256(const void* input, unsigned long length, unsigned char* md)
 {
        SHA256_CTX context;
-       if(!SHA256_Init(&context))
+       if (!SHA256_Init(&context))
                return false;
 
-       if(!SHA256_Update(&context, (unsigned char*)input, length))
+       if (!SHA256_Update(&context, (unsigned char*)input, length))
                return false;
 
-       if(!SHA256_Final(md, &context))
+       if (!SHA256_Final(md, &context))
                return false;
 
        return true;
@@ -341,7 +353,7 @@ AsmCrypto::genRSAKeyPair(char *pubkey, char *prikey, const char *passwd, int key
 }
 
 int
-AsmCrypto::genRSASignValue(const char *privkey, const char * passwd, const unsigned char * msg, unsigned int len, unsigned char *sign,unsigned int *signlen)
+AsmCrypto::genRSASignValue(const char *privkey, const char * passwd, const unsigned char * msg, unsigned int len, unsigned char *sign, unsigned int *signlen)
 {
        return -1;
 }
@@ -349,20 +361,11 @@ AsmCrypto::genRSASignValue(const char *privkey, const char * passwd, const unsig
 int
 AsmCrypto::genB64Encode(const unsigned char *input, int inlen, unsigned char * output, int *outlen)
 {
-#if 0
-       EVP_ENCODE_CTX ctx;
-       int t = 0;
-       EVP_EncodeInit(&ctx);
-       EVP_EncodeUpdate(&ctx, output,outlen,input,inlen);
-       EVP_EncodeFinal(&ctx,output + *outlen, &t);
-       *outlen += t -1;
-#else
        BIO * bmem = NULL;
        BIO * b64 = NULL;
        BUF_MEM * bptr = NULL;
        b64 = BIO_new(BIO_f_base64());
-       if(b64 == NULL)
-       {
+       if (b64 == NULL) {
                _ERR("BIO_new failed \n");
                return -1;
        }
@@ -377,24 +380,15 @@ AsmCrypto::genB64Encode(const unsigned char *input, int inlen, unsigned char * o
        memcpy(output, bptr->data, bptr->length);
        output[bptr->length] = 0;
        *outlen = bptr->length;
-       if(b64)
-       {
+       if (b64)
                BIO_free_all(b64);
-       }
-       //printf("outlen is %d, out is %s\n",*outlen, output);
-#endif
-       for(int i =0; i < *outlen ; i++)
-       {
-               if(output[i] == '+')
-               {
+
+       for (int i =0; i < *outlen ; i++) {
+               if (output[i] == '+') {
                        output[i] = '-';
-               }
-               else if(output[i] == '/')
-               {
+               } else if (output[i] == '/') {
                        output[i] = '_';
-               }
-               else if(output[i] == '=')
-               {
+               } else if (output[i] == '=') {
                        *outlen = i ;
                        output[i] = '\0';
                        break;
@@ -415,24 +409,21 @@ AsmCrypto::genB64Decodes(const unsigned char *input, int inlen, unsigned char *
 
        int npadChars = (inlen %4) == 0 ? 0 : (4 - (inlen%4));
        unsigned char *base64 = (unsigned char *) malloc(inlen + npadChars);
-       if(base64 == NULL)
+       if (base64 == NULL)
        {
                _ERR("malloc failed \n");
                return -1;
        }
        memcpy(base64, input, inlen);
-       for(int i =0; i < inlen ; i++)
+       for (int i =0; i < inlen ; i++)
        {
-               if(base64[i] == '-')
-               {
+               if (base64[i] == '-') {
                        base64[i] = '+';
-               }
-               else if(base64[i] == '_')
-               {
+               } else if (base64[i] == '_') {
                        base64[i] = '/';
                }
        }
-       if(npadChars != 0)
+       if (npadChars != 0)
        {
                memset(base64 + inlen, '=', npadChars);
        }
@@ -441,7 +432,7 @@ AsmCrypto::genB64Decodes(const unsigned char *input, int inlen, unsigned char *
        BIO * b64 = NULL;
        BIO * bmem = NULL;
        b64 = BIO_new(BIO_f_base64());
-       if(b64 == NULL)
+       if (b64 == NULL)
        {
                free(base64);
                _ERR("BIO_new failed");
@@ -449,7 +440,7 @@ AsmCrypto::genB64Decodes(const unsigned char *input, int inlen, unsigned char *
        }
        BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
        bmem = BIO_new_mem_buf(base64, inlen + npadChars);
-       if(bmem == NULL)
+       if (bmem == NULL)
        {
                _ERR("BIO_new_mem_buf failed");
                BIO_free(b64);
@@ -458,14 +449,14 @@ AsmCrypto::genB64Decodes(const unsigned char *input, int inlen, unsigned char *
        }
        bmem = BIO_push(b64, bmem);
        *outlen = BIO_read(bmem, output, inlen + npadChars);
-       if(*outlen <=0)
+       if (*outlen <=0)
        {
                BIO_free(b64);
                free(base64);
                _ERR("BIO_read failed. size or data error");
                return -1;
        }
-       if(b64) {
+       if (b64) {
                BIO_free_all(b64);
        }
 
@@ -488,19 +479,19 @@ AsmCrypto::aesEncrypt(const unsigned char *plaintext, int plaintext_len, const u
        int ciphertext_len;
 
 
-       if(!(ctx = EVP_CIPHER_CTX_new()))
+       if (!(ctx = EVP_CIPHER_CTX_new()))
        {
          _ERR("EVP_CIPHER_CTX_new() failed");
          return -1;
        }
 
-       if(1 != EVP_EncryptInit_ex(ctx, EVP_aes_256_cbc(), NULL, key, iv))
+       if (1 != EVP_EncryptInit_ex(ctx, EVP_aes_256_cbc(), NULL, key, iv))
        {
          _ERR("EVP_EncryptInit_ex() failed");
          return -1;
        }
 
-       if(1 != EVP_EncryptUpdate(ctx, ciphertext, &len, plaintext, plaintext_len))
+       if (1 != EVP_EncryptUpdate(ctx, ciphertext, &len, plaintext, plaintext_len))
        {
          _ERR("EVP_EncryptUpdate() failed");
          return -1;
@@ -508,7 +499,7 @@ AsmCrypto::aesEncrypt(const unsigned char *plaintext, int plaintext_len, const u
 
        ciphertext_len = len;
 
-       if(1 != EVP_EncryptFinal_ex(ctx, ciphertext + len, &len))
+       if (1 != EVP_EncryptFinal_ex(ctx, ciphertext + len, &len))
        {
          _ERR("EVP_EncryptFinal_ex() failed");
          return -1;
@@ -533,19 +524,19 @@ AsmCrypto::aesDecrypt(const unsigned char *ciphertext, int ciphertext_len, const
 
        int plaintext_len;
 
-       if(!(ctx = EVP_CIPHER_CTX_new()))
+       if (!(ctx = EVP_CIPHER_CTX_new()))
        {
          _ERR("EVP_CIPHER_CTX_new() failed");
          return -1;
        }
 
-       if(1 != EVP_DecryptInit_ex(ctx, EVP_aes_256_cbc(), NULL, key, iv))
+       if (1 != EVP_DecryptInit_ex(ctx, EVP_aes_256_cbc(), NULL, key, iv))
        {
          _ERR("EVP_DecryptInit_ex() failed");
          return -1;
        }
 
-       if(1 != EVP_DecryptUpdate(ctx, plaintext, &len, ciphertext, ciphertext_len))
+       if (1 != EVP_DecryptUpdate(ctx, plaintext, &len, ciphertext, ciphertext_len))
        {
          _ERR("EVP_DecryptUpdate() failed");
          return -1;
@@ -553,7 +544,7 @@ AsmCrypto::aesDecrypt(const unsigned char *ciphertext, int ciphertext_len, const
 
        plaintext_len = len;
 
-       if(1 != EVP_DecryptFinal_ex(ctx, plaintext + len, &len))
+       if (1 != EVP_DecryptFinal_ex(ctx, plaintext + len, &len))
        {
          _ERR("EVP_DecryptFinal_ex() failed");
          return -1;
@@ -630,7 +621,7 @@ AsmCrypto::readDer(const char *der_file_name, int *len)
        _INFO("ReadDERCertFile start");
 
        FILE *fp = fopen(der_file_name, "r");
-       if(fp == NULL)
+       if (fp == NULL)
                return NULL;
 
        X509 *pcert = NULL;
@@ -643,7 +634,7 @@ AsmCrypto::readDer(const char *der_file_name, int *len)
        _der_cert_s *cert = (_der_cert_s*)(calloc(1, sizeof(_der_cert_s)));
 
        int ret = __load_cert_from_x509(pcert, &cert);
-       if(ret != 0) {
+       if (ret != 0) {
                SAFE_DELETE(cert);
                return NULL;
        }
@@ -733,7 +724,7 @@ void hex2bin(const char *str, int str_len, void *mem)
        char *M = (char *) mem;
        byte[2] = 0;
 
-       for(i = 0; i < len; i+=2)
+       for (i = 0; i < len; i+=2)
        {
                byte[0] = str[i];
                byte[1] = str[i+1];
@@ -774,13 +765,13 @@ AsmCrypto::digestSignRSAPSSMGF1(const char *message, int m_len,
 
        // Create the Message Digest Context
 
-       if(EVP_SUCCESS != EVP_DigestSignInit(mdctx, &pctx, EVP_sha256(), NULL, privKey)) {
+       if (EVP_SUCCESS != EVP_DigestSignInit(mdctx, &pctx, EVP_sha256(), NULL, privKey)) {
                 _ERR("EVP_DigestSignInit failed");
                 return -1;
        }
 
        /* Set padding algorithm */
-       if(EVP_SUCCESS != EVP_PKEY_CTX_set_rsa_padding(pctx, RSA_PKCS1_PSS_PADDING)) {
+       if (EVP_SUCCESS != EVP_PKEY_CTX_set_rsa_padding(pctx, RSA_PKCS1_PSS_PADDING)) {
                _ERR("EVP_PKEY_CTX_set_rsa_padding failed");
                return -1;
        }
@@ -791,13 +782,13 @@ AsmCrypto::digestSignRSAPSSMGF1(const char *message, int m_len,
        _INFO("After EVP_PKEY_CTX_set_rsa_pss_saltlen with 32");
 
        /* Set masking */
-       if(EVP_SUCCESS != EVP_PKEY_CTX_set_rsa_mgf1_md(pctx, EVP_sha256())) {
+       if (EVP_SUCCESS != EVP_PKEY_CTX_set_rsa_mgf1_md(pctx, EVP_sha256())) {
                _ERR("EVP_PKEY_CTX_set_rsa_padding failed");
                return -1;
        }
 
        /* Call update with the message */
-       if(EVP_SUCCESS != EVP_DigestSignUpdate(mdctx, message, m_len)) {
+       if (EVP_SUCCESS != EVP_DigestSignUpdate(mdctx, message, m_len)) {
                 _ERR("EVP_DigestSignUpdate failed");
                 return -1;
        }
@@ -806,7 +797,7 @@ AsmCrypto::digestSignRSAPSSMGF1(const char *message, int m_len,
        /* First call EVP_DigestSignFinal with a NULL sig parameter to obtain the length of the
        * signature. Length is returned in slen */
        size_t slen;
-       if(EVP_SUCCESS != EVP_DigestSignFinal(mdctx, NULL, &slen)) {
+       if (EVP_SUCCESS != EVP_DigestSignFinal(mdctx, NULL, &slen)) {
                 _ERR("EVP_DigestSignFinal failed");
                 return -1;
        }
@@ -816,7 +807,7 @@ AsmCrypto::digestSignRSAPSSMGF1(const char *message, int m_len,
        //int slen = 0;
 
        /* Obtain the signature */
-       if(EVP_SUCCESS != EVP_DigestSignFinal(mdctx, sig, &slen)) {
+       if (EVP_SUCCESS != EVP_DigestSignFinal(mdctx, sig, &slen)) {
                 _ERR("EVP_DigestSignFinal failed");
                 SAFE_DELETE(sig);
                 return -1;
@@ -1022,7 +1013,7 @@ AsmCrypto::onPkgList(pkgmgrinfo_pkginfo_h handle, void *user_data)
 
        author_cert_hash = __get_pub_key_from_cert(author_cert);
        _INFO("");
-       if(author_cert_hash == NULL) {
+       if (author_cert_hash == NULL) {
                pkgmgrinfo_pkginfo_destroy_certinfo(cert_handle);
                return 0;
        }
@@ -1071,9 +1062,9 @@ AsmCrypto::getAppId(const char *appIdPubKey)
                return NULL;
        }
 
-       if(certInfo->pkgId != NULL)
+       if (certInfo->pkgId != NULL) {
                _INFO("AsmCrypto::getAppId:: pkgId = [%s]", certInfo->pkgId);
-       else {
+       else {
                _INFO("AsmCrypto::getAppId:: pkgId NULL");
                /*TODO For requests coming from remote device, we can not use pkgmgr to
                * find out App-Id, instead Client Device's ASM must send it explicitly
@@ -1107,7 +1098,7 @@ AsmCrypto::fidoSignWithKey(const unsigned char *msg, int msg_len,
 
        _INFO("");
        rsa = PEM_read_bio_RSAPrivateKey(bio, NULL, NULL, NULL);
-       if(rsa == NULL) {
+       if (rsa == NULL) {
                _ERR("BIO_new_mem_buf failed");
                return NULL;
        }
old mode 100644 (file)
new mode 100755 (executable)
index 887a477..dedb35d
@@ -26,8 +26,7 @@
 
 #define AUTH_TYPE_HAS_SETTINGS 0x0010
 
-typedef enum
-{
+typedef enum {
        UAF_CMD_STATUS_OK = 0x00,
        UAF_CMD_STATUS_ERR_UNKNOWN = 0x01,
        UAF_CMD_STATUS_ACCESS_DENIED = 0x02,
@@ -36,7 +35,7 @@ typedef enum
        UAF_CMD_STATUS_USER_CANCELLED = 0x05,
        UAF_CMD_STATUS_CMD_NOT_SUPPORTED = 0x06,
        UAF_CMD_STATUS_ATTESTATION_NOT_SUPPORTED = 0x07
-}UAF_AUTHNR_STATUS_CODE;
+} UAF_AUTHNR_STATUS_CODE;
 
 typedef enum {
        TLV_ASSRT_TYPE_REG,
@@ -44,27 +43,24 @@ typedef enum {
 } tlv_assertion_type_e;
 
 /** Authenticator algorithms */
-typedef enum
-{
+typedef enum {
        UAF_ALG_SIGN_SECP256R1_ECDSA_SHA256_RAW = 0x01,
        UAF_ALG_SIGN_SECP256R1_ECDSA_SHA256_DER = 0x02,
        UAF_ALG_SIGN_RSASSA_PSS_SHA256_RAW = 0x03,
        UAF_ALG_SIGN_RSASSA_PSS_SHA256_DER = 0x04,
        UAF_ALG_SIGN_SECP256K1_ECDSA_SHA256_RAW = 0x05,
        UAF_ALG_SIGN_SECP256K1_ECDSA_SHA256_DER = 0x06
-}AUTHENTICATOR_ALGORITHM;
+} AUTHENTICATOR_ALGORITHM;
 
 /** Public key representation format */
-typedef enum
-{
+typedef enum {
        UAF_ALG_KEY_ECC_X962_RAW = 0x100,
        UAF_ALG_KEY_ECC_X962_DER = 0x101,
        UAF_ALG_KEY_RSA_2048_PSS_RAW = 0x102,
        UAF_ALG_KEY_RSA_2048_PSS_DER = 0x103,
-}PUBLIC_KEY_FORMAT;
+} PUBLIC_KEY_FORMAT;
 
-typedef enum
-{
+typedef enum {
        AUTHNR_2ND_FACTOR = 0x0001,
        AUTHNR_ROAMING = 0x0002,
        AUTHNR_STORE_KEYHANDLES_INSIDE = 0x0004,
@@ -72,10 +68,9 @@ typedef enum
        AUTHNR_HAS_BUILTIN_SETTINGS_UI = 0x0010,
        AUTHNR_REQUIRE_TAG_APPID = 0x0020,
        AUTHNR_AT_LEAST_ONE_USER_ENROLLED = 0x0040
-}AUTHENTICATOR_TYPE;
+} AUTHENTICATOR_TYPE;
 
-typedef enum
-{
+typedef enum {
        USER_VERIFY_PRESENCE = 0x01,
        USER_VERIFY_FINGERPRINT = 0x02,
        USER_VERIFY_PASSCODE = 0x04,
@@ -87,33 +82,30 @@ typedef enum
        USER_VERIFY_HANDPRINT = 0x100,
        USER_VERIFY_NONE = 0x200,
        USER_VERIFY_ALL = 0x400
-}USER_VERIFICATION_METHOD;
+} USER_VERIFICATION_METHOD;
 
-typedef enum
-{
+typedef enum {
        KEY_PROTECTION_SOFTWARE = 0x01,
        KEY_PROTECTION_HARDWARE = 0x02,
        KEY_PROTECTION_TEE = 0x04,
        KEY_PROTECTION_SECURE_ELEMENT = 0x08,
        KEY_PROTECTION_REMOTE_HANDLE = 0x10
-}KEY_PROTECTION_TYPE;
+} KEY_PROTECTION_TYPE;
 
 /** Matcher protection types */
-typedef enum
-{
+typedef enum {
        MATCHER_PROTECTION_SOFTWARE = 0x01,
        MATCHER_PROTECTION_TEE = 0x02,
        MATCHER_PROTECTION_ON_CHIP = 0x04
-}MATCHER_PROTECTION_TYPE;
+} MATCHER_PROTECTION_TYPE;
 
-typedef enum
-{
+typedef enum {
        TRANSACTION_CONFIRMATION_DISPLAY_ANY = 0x01,
        TRANSACTION_CONFIRMATION_DISPLAY_PRIVILEGED_SOFTWARE = 0x02,
        TRANSACTION_CONFIRMATION_DISPLAY_TEE = 0x04,
        TRANSACTION_CONFIRMATION_DISPLAY_HARDWARE = 0x08,
        TRANSACTION_CONFIRMATION_DISPLAY_REMOTE = 0x10
-}TRANSACTION_CONFIRMATION_DISPLAY_TYPE;
+} TRANSACTION_CONFIRMATION_DISPLAY_TYPE;
 
 typedef enum {
        ATTACHMENT_HINT_INTERNAL = 0x01,
@@ -258,7 +250,6 @@ typedef struct _AuthenticateReq {
        Buffer *khATok;
        char *userVToken;
        GList *khHList;/*List of char* */
-
 } AuthenticateReq;
 
 /*
old mode 100644 (file)
new mode 100755 (executable)
index 03456e9..da95304
@@ -24,7 +24,6 @@
 class DisplayChar;
 
 class Transaction {
-
 public:
        std::string getTransContent(void);
 
@@ -38,7 +37,6 @@ public:
  * https://fidoalliance.org/specs/fido-uaf-v1.0-ps-20141208/fido-uaf-asm-api-v1.0-ps-20141208.html#dictionary-authenticatein-members
  */
 class AsmAuthRequest {
-
 public:
        ~AsmAuthRequest(void);
 
old mode 100644 (file)
new mode 100755 (executable)
index ee03bc3..7758953
@@ -26,7 +26,6 @@
  * https://fidoalliance.org/specs/fido-uaf-v1.0-ps-20141208/fido-uaf-asm-api-v1.0-ps-20141208.html#dictionary-authenticateout-members
  */
 class AsmAuthResponse {
-
 public:
        ~AsmAuthResponse(void);
 
@@ -41,7 +40,6 @@ private:
        std::string __assertionScheme;
 
        friend class AuthenticateState;
-
 };
 
 #endif //__ASM_AUTH_RESP_H__
old mode 100644 (file)
new mode 100755 (executable)
index 5587f78..8603f58
@@ -25,7 +25,6 @@
  * https://fidoalliance.org/specs/fido-uaf-v1.0-ps-20141208/fido-uaf-asm-api-v1.0-ps-20141208.html#dictionary-deregisterin-members
  */
 class AsmDeregRequest {
-
 public:
        ~AsmDeregRequest(void);
 
old mode 100644 (file)
new mode 100755 (executable)
index 803288f..aea9c55
 #include <vector>
 
 class AsmDeregResponse {
-
 public:
        ~AsmDeregResponse(void);
 
 private:
        AsmDeregResponse(void);
-
 };
 
 #endif //__ASM_DEREG_RESP_H__
old mode 100644 (file)
new mode 100755 (executable)
index d0b4063..b163168
@@ -19,7 +19,6 @@
 #define ASMGETINFOREQUEST_H
 
 class AsmGetInfoRequest {
-
 public:
        ~AsmGetInfoRequest(void);
 
old mode 100644 (file)
new mode 100755 (executable)
index 29bcf3a..d73bf7c
@@ -24,7 +24,6 @@
 class GetRegsState;
 
 class AppRegistration {
-
 public:
        ~AppRegistration(void);
        std::string getAppId(void);
@@ -46,7 +45,6 @@ private:
  * https://fidoalliance.org/specs/fido-uaf-v1.0-ps-20141208/fido-uaf-asm-api-v1.0-ps-20141208.html#dictionary-getregistrationsout-members
  */
 class AsmGetRegsResponse {
-
 public:
        ~AsmGetRegsResponse(void);
 
@@ -58,7 +56,6 @@ private:
 private:
        std::vector<AppRegistration> __appRegList;
        friend class GetRegsState;
-
 };
 
 #endif //__ASM_GET_REGS_RESP_H__
old mode 100644 (file)
new mode 100755 (executable)
index 69374a1..1a5afec
@@ -26,7 +26,6 @@
  * https://fidoalliance.org/specs/fido-uaf-v1.0-ps-20141208/fido-uaf-asm-api-v1.0-ps-20141208.html#dictionary-registerin-members
  */
 class AsmRegRequest {
-
 public:
        ~AsmRegRequest(void);
 
old mode 100644 (file)
new mode 100755 (executable)
index 61072ee..8232666
@@ -27,7 +27,6 @@ class JsonUtil;
  * https://fidoalliance.org/specs/fido-uaf-v1.0-ps-20141208/fido-uaf-protocol-v1.0-ps-20141208.html#version-interface
  */
 class AsmVersion {
-
 public:
        ~AsmVersion(void);
 
@@ -46,7 +45,6 @@ private:
  * https://fidoalliance.org/specs/fido-uaf-v1.0-ps-20141208/fido-uaf-protocol-v1.0-ps-20141208.html#dictionary-extension-members
  */
 class Extension {
-
 public:
        ~Extension(void);
 
@@ -63,7 +61,6 @@ private:
 * https://fidoalliance.org/specs/fido-uaf-v1.0-ps-20141208/fido-uaf-asm-api-v1.0-ps-20141208.html#dictionary-asmrequest-members
 */
 class AsmRequest {
-
 public:
        ~AsmRequest(void);
 
old mode 100644 (file)
new mode 100755 (executable)
index 55cc379..6a1b3da
@@ -25,22 +25,19 @@ class Extension;
 class RegisterState;
 class AuthenticateState;
 class GetRegsState;
-
 /*
  * https://fidoalliance.org/specs/fido-uaf-v1.0-ps-20141208/fido-uaf-asm-api-v1.0-ps-20141208.html#dictionary-asmresponse-members
  */
 class AsmResponse {
-
 public:
        ~AsmResponse(void);
 
        int getStatusCode(void);
        void* getResponseData(void);
-       std::vector<Extension*>getExtensionList(void);
+       std::vector<Extension*> *getExtensionList(void);
 
 private:
        AsmResponse(void);
-
 private:
        int __statusCode;
        void *__respData;
old mode 100644 (file)
new mode 100755 (executable)
index dbecb09..29f8715
  * https://fidoalliance.org/specs/fido-uaf-v1.0-ps-20141208/fido-uaf-asm-api-v1.0-ps-20141208.html#dictionary-getinfoout-members
  */
 class GetInfoResponse {
-
 public:
        ~GetInfoResponse(void);
 
-       std::vector<AuthenticatorInfo*>getAuthnrList(void);
+       std::vector<AuthenticatorInfo*> *getAuthnrList(void);
 
 private:
        GetInfoResponse(void);
 
 private:
        std::vector<AuthenticatorInfo*> *__authList;
-
 };
 
 #endif //__ASM_GET_INFO_RESP_H__
old mode 100644 (file)
new mode 100755 (executable)
index 4779a14..dbf9021
@@ -24,10 +24,7 @@ Transaction::getTransContent(void)
        return __content;
 }
 
-AsmAuthRequest::~AsmAuthRequest(void)
-{
-
-}
+AsmAuthRequest::~AsmAuthRequest(void) {}
 
 std::string
 AsmAuthRequest::getAppId(void)
@@ -53,7 +50,5 @@ AsmAuthRequest::getFCH(void)
        return __fc;
 }
 
-AsmAuthRequest::AsmAuthRequest(void)
-{
+AsmAuthRequest::AsmAuthRequest(void) {}
 
-}
old mode 100644 (file)
new mode 100755 (executable)
index 9313cd8..ae0c461
 #include "AsmAuthResponse.h"
 #include <vector>
 
-AsmAuthResponse::~AsmAuthResponse(void)
-{
-
-}
+AsmAuthResponse::~AsmAuthResponse(void) {}
 
 std::string
 AsmAuthResponse::getAssertion(void)
@@ -34,8 +31,5 @@ AsmAuthResponse::getAssertionScheme(void)
        return __assertionScheme;
 }
 
-AsmAuthResponse::AsmAuthResponse(void)
-{
-
-}
+AsmAuthResponse::AsmAuthResponse(void) {}
 
old mode 100644 (file)
new mode 100755 (executable)
index 8771ec7..4db1dfc
 #include "AsmDeregRequest.h"
 #include <vector>
 
-AsmDeregRequest::~AsmDeregRequest(void)
-{
-
-}
+AsmDeregRequest::~AsmDeregRequest(void) {}
 
 std::string
 AsmDeregRequest::getAppId(void)
@@ -35,7 +32,4 @@ AsmDeregRequest::getKeyId(void)
        return __keyId;
 }
 
-AsmDeregRequest::AsmDeregRequest(void)
-{
-
-}
+AsmDeregRequest::AsmDeregRequest(void) {}
old mode 100644 (file)
new mode 100755 (executable)
index 50f1330..5c23fda
 #include "GetRegsState.h"
 #include <vector>
 
-AppRegistration::~AppRegistration(void)
-{
-
-}
+AppRegistration::~AppRegistration(void) {}
 
 std::string
 AppRegistration::getAppId(void)
@@ -37,15 +34,9 @@ AppRegistration::getKeyIdList(void)
 }
 
 
-AppRegistration::AppRegistration(void)
-{
+AppRegistration::AppRegistration(void) {}
 
-}
-
-AsmGetRegsResponse::~AsmGetRegsResponse(void)
-{
-
-}
+AsmGetRegsResponse::~AsmGetRegsResponse(void) {}
 
 std::vector<AppRegistration>
 AsmGetRegsResponse::getAppRegList(void)
@@ -53,7 +44,5 @@ AsmGetRegsResponse::getAppRegList(void)
        return __appRegList;
 }
 
-AsmGetRegsResponse::AsmGetRegsResponse(void)
-{
+AsmGetRegsResponse::AsmGetRegsResponse(void) {}
 
-}
old mode 100644 (file)
new mode 100755 (executable)
index 99b2930..b2a59ca
 #include "AsmRegRequest.h"
 #include <vector>
 
-AsmRegRequest::~AsmRegRequest(void)
-{
-
-}
+AsmRegRequest::~AsmRegRequest(void) {}
 
 std::string
 AsmRegRequest::getServerChallenge(void)
@@ -58,6 +55,3 @@ AsmRegRequest::AsmRegRequest(void)
 {
        __attType = -1;
 }
-
-
-
old mode 100644 (file)
new mode 100755 (executable)
index 9f95b55..1f82a96
 #include "AsmRegResponse.h"
 #include <vector>
 
-AsmRegResponse::AsmRegResponse(void)
-{
-
-}
+AsmRegResponse::AsmRegResponse(void) {}
 
-AsmRegResponse::~AsmRegResponse(void)
-{
-
-}
+AsmRegResponse::~AsmRegResponse(void) {}
 
 std::string
 AsmRegResponse::getAssertion(void)
old mode 100644 (file)
new mode 100755 (executable)
index 7452121..4b6ee64
@@ -36,11 +36,9 @@ AsmRequest::~AsmRequest(void)
        if (__args != NULL) {
                if (__requestType == "Register") {
                        delete static_cast<AsmRegRequest*>(__args);
-               }
-               else if (__requestType == "Authenticate") {
+               } else if (__requestType == "Authenticate") {
                        delete static_cast<AsmAuthRequest*>(__args);
-               }
-               else if (__requestType == "Deregister") {
+               } else if (__requestType == "Deregister") {
                        delete static_cast<AsmDeregRequest*>(__args);
                }
        }
@@ -89,10 +87,7 @@ AsmRequest::getCustomRequest(void)
        return __customRequest;
 }
 
-AsmVersion::~AsmVersion(void)
-{
-
-}
+AsmVersion::~AsmVersion(void) {}
 
 int
 AsmVersion::getMajor(void)
@@ -106,7 +101,4 @@ AsmVersion::getMinor(void)
        return __minor;
 }
 
-AsmVersion::AsmVersion(void)
-{
-
-}
+AsmVersion::AsmVersion(void) {}
old mode 100644 (file)
new mode 100755 (executable)
index 1ad2761..0845e99
@@ -31,10 +31,7 @@ AsmResponse::AsmResponse(void)
        __extList = NULL;
 }
 
-AsmResponse::~AsmResponse(void)
-{
-
-}
+AsmResponse::~AsmResponse(void) {}
 
 int
 AsmResponse::getStatusCode(void)
old mode 100644 (file)
new mode 100755 (executable)
index 4efc013..ca6c6fa
@@ -21,7 +21,7 @@
 #include "AsmRequest.h"
 #include "AuthnrTypes.h"
 #include <glib.h>
-#if !GLIB_CHECK_VERSION (2, 31, 0)
+#if !GLIB_CHECK_VERSION(2, 31, 0)
 #include <glib/gmacros.h>
 #endif
 #include <json-glib/json-glib.h>
@@ -33,7 +33,6 @@ class IAuthStub;
 class AsmResponse;
 
 class JsonUtil {
-
 public:
        static AsmRequest* parseAsmRequestJson(const char *json);
 
@@ -72,7 +71,6 @@ private:
 
        static JsonBuilder* initComposer(int statusCode);
        static char* finishComposer(JsonBuilder *builder);
-
 };
 
 
old mode 100644 (file)
new mode 100755 (executable)
index 4a6b6c8..ffbe6ac
@@ -42,7 +42,6 @@ __print_big_string(const char *str)
                strncpy(sub_str, str + i, chunk_size);
                _INFO("log : [%s]", sub_str);
        }
-
 }
 
 #define GET_ROOT_NODE(json) \
@@ -139,7 +138,6 @@ JsonUtil::parseAsmRequestArgAuth(JsonObject *argObj)
 
                int i = 0;
                for (; i < keyArrLen; i++) {
-
                        const char *keyId = json_array_get_string_element(keyArr, i);
                        if (keyId != NULL) {
                                _INFO("keyId is = [%s]", keyId);
@@ -156,17 +154,14 @@ JsonUtil::parseAsmRequestArgAuth(JsonObject *argObj)
 
                int i = 0;
                for (; i < tcArrLen; i++) {
-
                        JsonObject *tcObj = json_array_get_object_element(tcArr, i);
                        if (tcObj != NULL) {
-
                                std::string conTypeStr = getString(tcObj, "contentType");
                                std::string conStr = getString(tcObj, "content");
                                /*TODO: Add tcDisplayPNGCharacteristics when ASM UI is capable of image display*/
 
                                if ((conTypeStr.empty() == false)
                                                && (conStr.empty() == false)) {
-
                                        Transaction *tc = new Transaction();
 
                                        tc->__contentType = conTypeStr;
@@ -247,7 +242,7 @@ JsonUtil::parseAsmRequestJson(const char *json)
 
        asmReq->__authenticatorIndex = json_object_get_int_member(rootObj, "authenticatorIndex");
 
-       if(reqType == REQ_TYPE_GET_REGS) {
+       if (reqType == REQ_TYPE_GET_REGS) {
                if (parser != NULL)
                        g_object_unref(parser);
 
@@ -257,7 +252,6 @@ JsonUtil::parseAsmRequestJson(const char *json)
        argObj = json_object_get_object_member(rootObj, "args");
 
        switch (reqType) {
-
        case REQ_TYPE_REG:
                asmReq->__args = parseAsmRequestArgReg(argObj);
                break;
@@ -332,7 +326,6 @@ JsonUtil::addJsonObjectAuthInfo(JsonBuilder *builder, GetAuthInfoResp *getInfoRe
        GList *authListIter = g_list_first(authList);
        /*Supports one authenticator per authenticator*/
        while (authListIter != NULL) {
-
                AuthenticatorInfo *authInfo = (AuthenticatorInfo *)(authListIter->data);
 
                /*AuthenticatorInfo*/
@@ -379,11 +372,9 @@ JsonUtil::addJsonObjectAuthInfo(JsonBuilder *builder, GetAuthInfoResp *getInfoRe
 
                GList *attTypeList = authInfo->__attestationTypes;
                if (attTypeList != NULL) {
-
                        GList *attTypeListIter = g_list_first(attTypeList);
 
                        if (g_list_length(attTypeListIter) > 0) {
-
                                json_builder_set_member_name(builder, "attestationTypes");
                                json_builder_begin_array(builder);
 
@@ -399,10 +390,8 @@ JsonUtil::addJsonObjectAuthInfo(JsonBuilder *builder, GetAuthInfoResp *getInfoRe
                }
 
                GList *extList = authInfo->__extList;
-               if(extList != NULL) {
-
-                       if(g_list_length(extList) > 0) {
-
+               if (extList != NULL) {
+                       if (g_list_length(extList) > 0) {
                                json_builder_set_member_name(builder, "supportedExtensionIDs");
                                json_builder_begin_array(builder);
 
@@ -515,7 +504,6 @@ JsonUtil::composeAsmGetInfoResponse(int statusCode,
 
        if ((getInfoList != NULL) &&
                        (getInfoList->size() > 0)) {
-
                _INFO("Auth Stub List is not NULL");
 
                json_builder_set_member_name(builder, "responseData");
@@ -622,7 +610,6 @@ JsonUtil::composeAsmGetRegsResponse(AsmResponse *regResp)
                builder = initComposer(UAF_ASM_STATUS_ACCESS_DENIED);
 
        if (regResp != NULL) {
-
                json_builder_set_member_name(builder, "responseData");
                json_builder_begin_object(builder);
 
@@ -633,10 +620,9 @@ JsonUtil::composeAsmGetRegsResponse(AsmResponse *regResp)
 
                std::vector<AppRegistration> appRegList = respData->getAppRegList();
 
-               if(appRegList.empty() == false) {
+               if (appRegList.empty() == false) {
                        std::vector<AppRegistration>::iterator iter = appRegList.begin();
                        for (; iter != appRegList.end(); ++iter) {
-
                                json_builder_begin_object(builder);
 
                                AppRegistration appReg = *iter;
@@ -648,7 +634,6 @@ JsonUtil::composeAsmGetRegsResponse(AsmResponse *regResp)
 
                                std::vector<std::string> keyIdList = appReg.getKeyIdList();
                                if (keyIdList.size() > 0) {
-
                                        json_builder_set_member_name(builder, "keyIDs");
                                        json_builder_begin_array(builder);
 
old mode 100644 (file)
new mode 100755 (executable)
index b5e95be..d64f626
@@ -25,8 +25,7 @@
 #include "StringTlvEncoder.h"
 #include "BufferTlvEncoder.h"
 
-class AttBasicFullTlvEncoder : public ITlvEncoder {
-
+class AttBasicFullTlvEncoder:public ITlvEncoder {
 public:
        AttBasicFullTlvEncoder(void);
        /*I/p: RegisterResp, O/p: TLV raw data*/
old mode 100644 (file)
new mode 100755 (executable)
index d5eebcb..dbe4f8c
@@ -25,8 +25,7 @@
 #include "StringTlvEncoder.h"
 #include "BufferTlvEncoder.h"
 
-class AttBasicSurrTlvEncoder : public ITlvEncoder {
-
+class AttBasicSurrTlvEncoder:public ITlvEncoder {
 public:
        AttBasicSurrTlvEncoder(void);
        /*I/p: RegisterResp, O/p: TLV raw data*/
old mode 100644 (file)
new mode 100755 (executable)
index ba96538..dd745cb
@@ -24,7 +24,6 @@
 
 class AuthAssertionInfoTlvEncoder
 {
-
 public:
        AuthAssertionInfoTlvEncoder(void);
        /*I/p: RegisterResp, O/p: TLV raw data*/
old mode 100644 (file)
new mode 100755 (executable)
index 7fa855a..eaf6132
@@ -24,7 +24,6 @@
 
 class AuthCountersInfoTlvEncoder
 {
-
 public:
        AuthCountersInfoTlvEncoder(void);
        /*I/p: RegisterResp, O/p: TLV raw data*/
old mode 100644 (file)
new mode 100755 (executable)
index f50d653..90709f9
@@ -22,9 +22,8 @@
 #include "TlvData.h"
 #include "ITlvEncoder.h"
 
-class BufferTlvEncoder : public ITlvEncoder
+class BufferTlvEncoder:public ITlvEncoder
 {
-
 public:
        BufferTlvEncoder(void);
 
old mode 100644 (file)
new mode 100755 (executable)
index b2ade74..a1d3a38
@@ -25,8 +25,7 @@
 #include "StringTlvEncoder.h"
 #include "BufferTlvEncoder.h"
 
-class DeRegReqTlvEncoder : public ITlvEncoder {
-
+class DeRegReqTlvEncoder:public ITlvEncoder {
 public:
        DeRegReqTlvEncoder(void);
        /*I/p: RegisterResp, O/p: TLV raw data*/
old mode 100644 (file)
new mode 100755 (executable)
index 63aa04e..f93b34c
@@ -25,8 +25,7 @@
 #include "StringTlvEncoder.h"
 #include "BufferTlvEncoder.h"
 
-class DeRegRespTlvEncoder : public ITlvEncoder {
-
+class DeRegRespTlvEncoder:public ITlvEncoder {
 public:
        DeRegRespTlvEncoder(void);
        /*I/p: RegisterResp, O/p: TLV raw data*/
old mode 100644 (file)
new mode 100755 (executable)
index 61ebf2e..1477839
 #include "TlvData.h"
 
 
-class GetInfoReqTlvEncoder : public ITlvEncoder {
-
+class GetInfoReqTlvEncoder:public ITlvEncoder {
 public:
        GetInfoReqTlvEncoder(void);
        virtual ~GetInfoReqTlvEncoder(void);
 
        /*I/p: Authenticator Specific data struct, O/p: TLV raw data*/
-       virtual Buffer* encode(const void *authData);
+       virtual Buffer * encode(const void *authData);
 
        /*I/p: TLV raw data, O/p: Authenticator Specific data struct*/
        virtual void* decode(const unsigned char *rawData);
-
 };
 
 #endif /* GETINFO_REQ_TLV_ENCODER_H_ */
old mode 100644 (file)
new mode 100755 (executable)
index a22819f..0ea0b35
 #include "IntTlvEncoder.h"
 #include "StringTlvEncoder.h"
 
-class AuthMetaTlvEncoder : public ITlvEncoder
+class AuthMetaTlvEncoder:public ITlvEncoder
 {
-
 public:
        AuthMetaTlvEncoder(void);
 
-       virtual Buffer* encode(const void *authData);
+       virtual Buffer * encode(const void *authData);
 
        virtual void* decode(const uint8_t *rawData);
 
@@ -39,13 +38,12 @@ private:
        StringTlvEncoder __strTlvEncoder;
 };
 
-class TcDispPNGChTlvEncoder : public ITlvEncoder
+class TcDispPNGChTlvEncoder:public ITlvEncoder
 {
-
 public:
        TcDispPNGChTlvEncoder(void);
 
-       virtual Buffer* encode(const void *authData);
+       virtual Buffer * encode(const void *authData);
 
        virtual void* decode(const uint8_t *rawData);
 
@@ -55,9 +53,8 @@ private:
 };
 
 
-class AuthInfoTlvEncoder : public ITlvEncoder
+class AuthInfoTlvEncoder:public ITlvEncoder
 {
-
 public:
        AuthInfoTlvEncoder(void);
 
@@ -72,9 +69,8 @@ private:
        TcDispPNGChTlvEncoder __tcDispPNGChTlvEncoder;
 };
 
-class GetInfoRespTlvEncoder : public ITlvEncoder
+class GetInfoRespTlvEncoder:public ITlvEncoder
 {
-
 public:
        GetInfoRespTlvEncoder(void);
        /*I/p: GetAuthInfoResp, O/p: TLV raw data*/
old mode 100644 (file)
new mode 100755 (executable)
index 517d2a7..cc41a2a
 #include "Tlv.h"
 
 class ITlvEncoder {
-
 public:
        virtual ~ITlvEncoder(void){}
 
        /*I/p: Authenticator Specific data struct, O/p: TLV raw data*/
-       virtual Buffer* encode(const void *authData) = 0;
+       virtual Buffer * encode(const void *authData) = 0;
 
        /*I/p: TLV raw data, O/p: Authenticator Specific data struct*/
        virtual void* decode(const uint8_t *rawData) = 0;
old mode 100644 (file)
new mode 100755 (executable)
index aeadd20..897efbe
@@ -22,9 +22,8 @@
 #include "TlvData.h"
 #include "ITlvEncoder.h"
 
-class IntTlvEncoder : public ITlvEncoder
+class IntTlvEncoder:public ITlvEncoder
 {
-
 public:
        IntTlvEncoder(void);
 
old mode 100644 (file)
new mode 100755 (executable)
index 00572c6..71e4092
@@ -24,8 +24,7 @@
 #include "IntTlvEncoder.h"
 #include "StringTlvEncoder.h"
 
-class RegAssertionInfoTlvEncoder : public ITlvEncoder {
-
+class RegAssertionInfoTlvEncoder:public ITlvEncoder {
 public:
        RegAssertionInfoTlvEncoder(void);
        /*I/p: RegisterResp, O/p: TLV raw data*/
old mode 100644 (file)
new mode 100755 (executable)
index 0319b64..c050b75
@@ -29,8 +29,7 @@
 #include "StringTlvEncoder.h"
 #include "BufferTlvEncoder.h"
 
-class RegAuthAssertionTlvEncoder : public ITlvEncoder {
-
+class RegAuthAssertionTlvEncoder:public ITlvEncoder {
 public:
        RegAuthAssertionTlvEncoder(void);
        /*I/p: RegisterResp, O/p: TLV raw data*/
old mode 100644 (file)
new mode 100755 (executable)
index c79449d..5fbb523
@@ -23,7 +23,6 @@
 #include "ITlvEncoder.h"
 
 class RegCountersInfoTlvEncoder {
-
 public:
        RegCountersInfoTlvEncoder(void);
        /*I/p: RegisterResp, O/p: TLV raw data*/
old mode 100644 (file)
new mode 100755 (executable)
index 23f5183..ddb6782
@@ -25,8 +25,7 @@
 #include "StringTlvEncoder.h"
 #include "BufferTlvEncoder.h"
 
-class RegAssertionTlvEncoder : public ITlvEncoder {
-
+class RegAssertionTlvEncoder:public ITlvEncoder {
 public:
        RegAssertionTlvEncoder(void);
        /*I/p: RegAssertion, O/p: TLV raw data*/
old mode 100644 (file)
new mode 100755 (executable)
index 7eb239d..8e12557
@@ -32,8 +32,7 @@
 #include "StringTlvEncoder.h"
 #include "BufferTlvEncoder.h"
 
-class RegRespTlvEncoder : public ITlvEncoder {
-
+class RegRespTlvEncoder:public ITlvEncoder {
 public:
        RegRespTlvEncoder(void);
        /*I/p: RegisterResp, O/p: TLV raw data*/
old mode 100644 (file)
new mode 100755 (executable)
index 5660f38..05f0818
@@ -27,8 +27,7 @@
 #include "StringTlvEncoder.h"
 #include "BufferTlvEncoder.h"
 
-class SignAuthAssertionTlvEncoder : public ITlvEncoder {
-
+class SignAuthAssertionTlvEncoder:public ITlvEncoder {
 public:
        SignAuthAssertionTlvEncoder(void);
        /*I/p: RegisterResp, O/p: TLV raw data*/
old mode 100644 (file)
new mode 100755 (executable)
index ecd68c1..064d18b
@@ -25,8 +25,7 @@
 #include "StringTlvEncoder.h"
 #include "BufferTlvEncoder.h"
 
-class SignReqTlvEncoder : public ITlvEncoder {
-
+class SignReqTlvEncoder:public ITlvEncoder {
 public:
        SignReqTlvEncoder(void);
        /*I/p: RegisterResp, O/p: TLV raw data*/
old mode 100644 (file)
new mode 100755 (executable)
index b713bda..96eb075
@@ -30,8 +30,7 @@
 #include "StringTlvEncoder.h"
 #include "BufferTlvEncoder.h"
 
-class UserNameKhTlvEncoder : public ITlvEncoder {
-
+class UserNameKhTlvEncoder:public ITlvEncoder {
 public:
        UserNameKhTlvEncoder(void);
        /*I/p: RegisterResp, O/p: TLV raw data*/
@@ -46,8 +45,7 @@ private:
        BufferTlvEncoder __buffTlvEncoder;
 };
 
-class SignRespTlvEncoder : public ITlvEncoder {
-
+class SignRespTlvEncoder:public ITlvEncoder {
 public:
        SignRespTlvEncoder(void);
        /*I/p: RegisterResp, O/p: TLV raw data*/
old mode 100644 (file)
new mode 100755 (executable)
index b13de53..2de826c
@@ -27,8 +27,7 @@
 #include "StringTlvEncoder.h"
 #include "BufferTlvEncoder.h"
 
-class SignedDataTlvEncoder : public ITlvEncoder {
-
+class SignedDataTlvEncoder:public ITlvEncoder {
 public:
        SignedDataTlvEncoder(void);
        /*I/p: RegisterResp, O/p: TLV raw data*/
old mode 100644 (file)
new mode 100755 (executable)
index a149851..fa22ca7
@@ -22,9 +22,8 @@
 #include "TlvData.h"
 #include "ITlvEncoder.h"
 
-class StringTlvEncoder : public ITlvEncoder
+class StringTlvEncoder:public ITlvEncoder
 {
-
 public:
        StringTlvEncoder(void);
 
old mode 100644 (file)
new mode 100755 (executable)
index f86150b..b475a31
@@ -46,7 +46,7 @@ public:
        static ITlvEncoder* getTlvEncoderById(int id);
 private:
        TlvEncoderFactory(void);
-       static std::map<int, ITlvEncoder*>loadAllEncoders(void);
+       static std::map<int, ITlvEncoder*> *loadAllEncoders(void);
 
 private:
        static std::map<int, ITlvEncoder*> *__encoderTable;
@@ -60,7 +60,7 @@ public:
                __authData = NULL;
        }
 
-       TlvEncodable(const T *authData) : __authData(authData), __encoder(NULL){}
+       TlvEncodable(const T *authData) : __authData(authData), __encoder(NULL) {}
 
        virtual ~TlvEncodable(void){}
 
old mode 100644 (file)
new mode 100755 (executable)
index 271acae..0d211f1
@@ -28,8 +28,7 @@
 #include "StringTlvEncoder.h"
 #include "BufferTlvEncoder.h"
 
-class Uafv1KrdTlvEncoder : public ITlvEncoder {
-
+class Uafv1KrdTlvEncoder:public ITlvEncoder {
 public:
        Uafv1KrdTlvEncoder(void);
        /*I/p: RegisterResp, O/p: TLV raw data*/
old mode 100644 (file)
new mode 100755 (executable)
index 233d16b..de354c4
 #include "AuthnrTypes.h"
 #include "stdio.h"
 
-AttBasicFullTlvEncoder::AttBasicFullTlvEncoder(void)
-{
-
-}
+AttBasicFullTlvEncoder::AttBasicFullTlvEncoder(void) {}
 
 Buffer *
 AttBasicFullTlvEncoder::encode(const void *authData)
@@ -86,9 +83,7 @@ AttBasicFullTlvEncoder::decode(const unsigned char *rawData)
        bool foundMember = false;
 
        while(1) {
-
                switch(child->tag) {
-
                        case TAG_SIGNATURE:
                                _INFO("");
                                getAttBasicFullInfo->sig = (Buffer*)__buffTlvEncoder.decode(rawData + rawIter);
@@ -109,7 +104,7 @@ AttBasicFullTlvEncoder::decode(const unsigned char *rawData)
 
                _INFO("");
                rawIter = rawIter + 2 + 2 + child->len;
-               if(rawIter >= endIter)
+               if (rawIter >= endIter)
                        break;
 
                SAFE_DELETE(child->val);
@@ -130,7 +125,7 @@ AttBasicFullTlvEncoder::decode(const unsigned char *rawData)
        SAFE_DELETE(child->val);
        SAFE_DELETE(child);
 
-       if(foundMember == false) {
+       if (foundMember == false) {
                free(getAttBasicFullInfo);
                return NULL;
        }
old mode 100644 (file)
new mode 100755 (executable)
index eff8d70..a5177e3
 #include "AsmHelper.h"
 #include "AuthnrTypes.h"
 
-AuthAssertionInfoTlvEncoder::AuthAssertionInfoTlvEncoder(void)
-{
-
-}
+AuthAssertionInfoTlvEncoder::AuthAssertionInfoTlvEncoder(void) {}
 
 Buffer *
 AuthAssertionInfoTlvEncoder::encode(const void *authData)
old mode 100644 (file)
new mode 100755 (executable)
index 71c7565..2c6eb0f
 #include "AsmHelper.h"
 #include "AuthnrTypes.h"
 
-AuthCountersInfoTlvEncoder::AuthCountersInfoTlvEncoder(void)
-{
-
-}
+AuthCountersInfoTlvEncoder::AuthCountersInfoTlvEncoder(void) {}
 
 Buffer *
 AuthCountersInfoTlvEncoder::encode(const void *authData)
old mode 100644 (file)
new mode 100755 (executable)
index 8f990a2..49cf088
 #include "AsmHelper.h"
 #include "AuthnrTypes.h"
 
-BufferTlvEncoder::BufferTlvEncoder(void)
-{
-
-}
+BufferTlvEncoder::BufferTlvEncoder(void) {}
 
 Buffer *
 BufferTlvEncoder::encode(const void *strTlv)
old mode 100644 (file)
new mode 100755 (executable)
index d4ff376..e792dd1
 #include "AsmHelper.h"
 #include "AuthnrTypes.h"
 
-DeRegReqTlvEncoder::DeRegReqTlvEncoder(void)
-{
-
-}
+DeRegReqTlvEncoder::DeRegReqTlvEncoder(void) {}
 
 Buffer *
 DeRegReqTlvEncoder::encode(const void *authData)
@@ -97,9 +94,7 @@ DeRegReqTlvEncoder::decode(const unsigned char *rawData)
        bool foundMember = false;
 
        while(1) {
-
                switch(child->tag) {
-
                case TAG_AUTHENTICATOR_INDEX:
                        getDeRegReqInfo->authIdx = *(int*)__intTlvEncoder.decode(rawData + rawIter);
                        _INFO("authIdx [%d]", getDeRegReqInfo->authIdx);
@@ -130,7 +125,7 @@ DeRegReqTlvEncoder::decode(const unsigned char *rawData)
                }
 
                rawIter = rawIter + 2 + 2 + child->len;
-               if(rawIter >= endIter)
+               if (rawIter >= endIter)
                        break;
 
                SAFE_DELETE(child->val);
@@ -150,7 +145,7 @@ DeRegReqTlvEncoder::decode(const unsigned char *rawData)
        SAFE_DELETE(child->val);
        SAFE_DELETE(child);
 
-       if(foundMember == false) {
+       if (foundMember == false) {
                free(getDeRegReqInfo);
                return NULL;
        }
old mode 100644 (file)
new mode 100755 (executable)
index e6a8ac5..7dd28ae
 #include "AsmHelper.h"
 #include "AuthnrTypes.h"
 
-DeRegRespTlvEncoder::DeRegRespTlvEncoder(void)
-{
-
-}
+DeRegRespTlvEncoder::DeRegRespTlvEncoder(void) {}
 
 Buffer *
 DeRegRespTlvEncoder::encode(const void *authData)
@@ -80,7 +77,7 @@ DeRegRespTlvEncoder::decode(const unsigned char *rawData)
 
        bool foundMember = false;
 
-       if(child->tag == TAG_STATUS_CODE) {
+       if (child->tag == TAG_STATUS_CODE) {
                getDeRegRespInfo->statusCode = *(int*)__intTlvEncoder.decode(rawData + rawIter);
                _INFO("statusCode [%d]", getDeRegRespInfo->statusCode);
                foundMember = true;
@@ -91,7 +88,7 @@ DeRegRespTlvEncoder::decode(const unsigned char *rawData)
        SAFE_DELETE(child->val);
        SAFE_DELETE(child);
 
-       if(foundMember == false) {
+       if (foundMember == false) {
                free(getDeRegRespInfo);
                return NULL;
        }
old mode 100644 (file)
new mode 100755 (executable)
index 10d3983..5b72533
@@ -23,8 +23,7 @@
 #define GET_INT_FROM_BUFFER(val, ptr) do {\
        if ((ptr == NULL)) {\
                val = -1;\
-       }\
-       else {\
+       } else {\
                val = *((int *)(ptr));\
        }\
 } while (0)
@@ -32,8 +31,7 @@
 #define GET_STR_FROM_BUFFER(val, ptr) do {\
        if ((ptr == NULL)) {\
                val = NULL;\
-       }\
-       else {\
+       } else {\
                val = (char *)(ptr);\
        }\
 } while (0)
                }\
        } while (0)
 
-AuthMetaTlvEncoder::AuthMetaTlvEncoder(void)
-{
-
-}
+AuthMetaTlvEncoder::AuthMetaTlvEncoder(void) {}
 
 Buffer *
 AuthMetaTlvEncoder::encode(const void *authData)
@@ -204,10 +199,7 @@ CATCH:
        return meta;
 }
 
-TcDispPNGChTlvEncoder::TcDispPNGChTlvEncoder(void)
-{
-
-}
+TcDispPNGChTlvEncoder::TcDispPNGChTlvEncoder(void) {}
 
 Buffer *
 TcDispPNGChTlvEncoder::encode(const void *authData)
@@ -345,10 +337,7 @@ CATCH:
        return getTcDsipPngChInfo;
 }
 
-AuthInfoTlvEncoder::AuthInfoTlvEncoder(void)
-{
-
-}
+AuthInfoTlvEncoder::AuthInfoTlvEncoder(void) {}
 
 Buffer*
 AuthInfoTlvEncoder::encode(const void *authData)
@@ -384,12 +373,10 @@ AuthInfoTlvEncoder::decode(const unsigned char *rawData)
        bool foundMember = false;
 
        while (1) {
-
                int attType = -1;
                char *extId = NULL;
 
                switch (child->tag) {
-
                case TAG_AUTHENTICATOR_INDEX:
                        GET_INT_FROM_BUFFER(authInfo->__authenticatorIndex, (__intTlvEncoder.decode(rawData + rawIter)));
                        _INFO("__authenticatorIndex = [%d]", authInfo->__authenticatorIndex);
@@ -414,9 +401,8 @@ AuthInfoTlvEncoder::decode(const unsigned char *rawData)
                        break;
 
                case TAG_TC_DISPLAY_PNG_CHARACTERISTICS: {
-
                        DisplayTc *getTcDispPNGChInfo = (DisplayTc*)(__tcDispPNGChTlvEncoder.decode(rawData + rawIter));
-                       if(getTcDispPNGChInfo != NULL) {
+                       if (getTcDispPNGChInfo != NULL) {
                                authInfo->__tcDisplayPNGCharacteristics = g_list_append(authInfo->__tcDisplayPNGCharacteristics,
                                                                                                                                                getTcDispPNGChInfo);
                                getTcDispPNGChInfo = NULL;
@@ -451,7 +437,6 @@ AuthInfoTlvEncoder::decode(const unsigned char *rawData)
                default:
                        foundMember = false;
                        break;
-
                }
 
                rawIter = rawIter + 2 + 2 + child->len;
@@ -486,10 +471,7 @@ AuthInfoTlvEncoder::decode(const unsigned char *rawData)
        return authInfo;
 }
 
-GetInfoRespTlvEncoder::GetInfoRespTlvEncoder(void)
-{
-
-}
+GetInfoRespTlvEncoder::GetInfoRespTlvEncoder(void) {}
 
 Buffer *
 GetInfoRespTlvEncoder::encode(const void *authData)
@@ -520,7 +502,6 @@ GetInfoRespTlvEncoder::encode(const void *authData)
 
 
        if (getInfoResp->authList != NULL) {
-
                _INFO("GetInfoRespTlvEncoder::encode 6");
                GList *authIter = g_list_first(getInfoResp->authList);
                while (authIter != NULL) {
@@ -544,7 +525,6 @@ GetInfoRespTlvEncoder::encode(const void *authData)
 
                                Buffer *metaBuff = __authMetaTlvEncoder.encode(auth->__meta);
                                if (metaBuff != NULL) {
-
                                        _INFO("GetInfoRespTlvEncoder::encode 12");
                                        /*1.4.3 TAG_AUTHENTICATOR_METADATA*/
                                        tlv_builder_add_buffer(builder, TAG_AUTHENTICATOR_METADATA, metaBuff);
@@ -559,7 +539,7 @@ GetInfoRespTlvEncoder::encode(const void *authData)
                        _INFO("GetInfoRespTlvEncoder::encode 14");
                        /*1.4.5 TAG_TC_DISPLAY_PNG_CHARACTERSTICS*/
                        /* TODO __tcDispPNGChTlvEncoder causing crash
-                       if(auth->__tcDisplayPNGCharacteristics != NULL) {
+                       if (auth->__tcDisplayPNGCharacteristics != NULL) {
 
                                GList *iter = g_list_first(auth->__tcDisplayPNGCharacteristics);
                                while(iter != NULL) {
@@ -584,7 +564,6 @@ GetInfoRespTlvEncoder::encode(const void *authData)
 
                        _INFO("GetInfoRespTlvEncoder::encode 19");
                        if (auth->__attestationTypes != NULL) {
-
                                GList *attIter = g_list_first(auth->__attestationTypes);
                                while (attIter != NULL) {
                                        _INFO("GetInfoRespTlvEncoder::encode 20");
@@ -597,8 +576,7 @@ GetInfoRespTlvEncoder::encode(const void *authData)
                        }
 
                        _INFO("GetInfoRespTlvEncoder::encode 22");
-                       if(auth->__extList != NULL) {
-
+                       if (auth->__extList != NULL) {
                                GList *extIter = g_list_first(auth->__extList);
                                while(extIter != NULL) {
                                        _INFO("GetInfoRespTlvEncoder::encode 23");
@@ -665,9 +643,7 @@ GetInfoRespTlvEncoder::decode(const unsigned char *rawData)
        GetAuthInfoResp *getInfoResp = (GetAuthInfoResp*)calloc(1, sizeof(GetAuthInfoResp));
 
        while (1) {
-
                switch (child->tag) {
-
                case TAG_STATUS_CODE:
                        getInfoResp->statusCode = *((int *)(__intTlvEncoder.decode(rawData + rawIter)));
                        _INFO("statusCode = [%d]", getInfoResp->statusCode);
old mode 100644 (file)
new mode 100755 (executable)
index 9ee101e..753bae8
 #include "AsmHelper.h"
 #include "AuthnrTypes.h"
 
-IntTlvEncoder::IntTlvEncoder(void)
-{
-
-}
+IntTlvEncoder::IntTlvEncoder(void) {}
 
 Buffer *
 IntTlvEncoder::encode(const void *intTlv)
@@ -44,7 +41,6 @@ IntTlvEncoder::decode(const unsigned char *rawData)
        int val = 0;
        int i = 0;
        for (i = 0; i < (tlv->len); i++) {
-
                _INFO("tlv->val[i] = %d", tlv->val[i]);
 
                int b_val = tlv->val[i] << (i * 8);
old mode 100644 (file)
new mode 100755 (executable)
index 220d3b1..0bd4d26
 #include "AsmHelper.h"
 #include "AuthnrTypes.h"
 
-RegAssertionInfoTlvEncoder::RegAssertionInfoTlvEncoder(void)
-{
-
-}
+RegAssertionInfoTlvEncoder::RegAssertionInfoTlvEncoder(void) {}
 
 Buffer *
 RegAssertionInfoTlvEncoder::encode(const void *authData)
old mode 100644 (file)
new mode 100755 (executable)
index 49e1aa8..90cc8a9
 #include "AuthnrTypes.h"
 #include "stdio.h"
 
-RegAuthAssertionTlvEncoder::RegAuthAssertionTlvEncoder(void)
-{
-
-}
+RegAuthAssertionTlvEncoder::RegAuthAssertionTlvEncoder(void) {}
 
 Buffer *
 RegAuthAssertionTlvEncoder::encode(const void *authData)
@@ -39,7 +36,7 @@ RegAuthAssertionTlvEncoder::encode(const void *authData)
        /*1. TAG_UAFV1_REG_ASSERTION*/
        tlv_builder_start_composite(builder, TAG_UAFV1_REG_ASSERTION);
 
-       if(getRegAssertion->krd != NULL) {
+       if (getRegAssertion->krd != NULL) {
                _INFO("");
 
                Krd *getRegAssertionKrd = (Krd*)getRegAssertion->krd ;
@@ -55,8 +52,7 @@ RegAuthAssertionTlvEncoder::encode(const void *authData)
                SAFE_DELETE(getRegAssertionKrdTlv);
        }
 
-       if(getRegAssertion->attFull != NULL) {
-
+       if (getRegAssertion->attFull != NULL) {
                _INFO("");
                AttestationBasicFull *getAttBasicFullInfo = (AttestationBasicFull*)getRegAssertion->attFull;
                Buffer *getAttBasicFullBuffInfo = (Buffer*)__attBasicFullTlvEncoder.encode(getAttBasicFullInfo);
@@ -70,9 +66,7 @@ RegAuthAssertionTlvEncoder::encode(const void *authData)
                SAFE_DELETE(attBasicFullBuff);
                SAFE_DELETE(getAttBasicFullBuffInfo);
                SAFE_DELETE(getAttBasicFullInfoTlv);
-       }
-       else if(getRegAssertion->attSur != NULL) {
-
+       } else if (getRegAssertion->attSur != NULL) {
                _INFO("");
                AttestationBasicSurrogate *getAttSurrInfo = (AttestationBasicSurrogate*)getRegAssertion->attSur;
                Buffer *getAttBasicSurrInfoBuff = (Buffer*)__attBasicSurrTlvEncoder.encode(getAttSurrInfo);
@@ -86,9 +80,7 @@ RegAuthAssertionTlvEncoder::encode(const void *authData)
                SAFE_DELETE(attBasicSurrBuff);
                SAFE_DELETE(getAttBasicSurrInfoBuff);
                SAFE_DELETE(getAttBasicSurrInfoTlv);
-       }
-       else {
-
+       } else {
                _ERR("No option of AttestationBasic is set");
                SAFE_DELETE(builder);
                return NULL;
@@ -134,9 +126,7 @@ RegAuthAssertionTlvEncoder::decode(const unsigned char *rawData)
 
        RegAssertion *getRegAssertionInfo = ALLOC(RegAssertion);
        while(1) {
-
                switch(child->tag) {
-
                case TAG_UAFV1_KRD:
                        _INFO("");
                        getRegAssertionInfo->krd = (Krd*)__uafv1KrdTlvEncoder.decode(rawData + rawIter);
@@ -163,7 +153,7 @@ RegAuthAssertionTlvEncoder::decode(const unsigned char *rawData)
 
                _INFO("");
                rawIter = rawIter + 2 + 2 + child->len;
-               if(rawIter >= endIter)
+               if (rawIter >= endIter)
                        break;
 
                SAFE_DELETE(child->val);
@@ -185,7 +175,7 @@ RegAuthAssertionTlvEncoder::decode(const unsigned char *rawData)
        SAFE_DELETE(root);
 
        _INFO("");
-       if(foundMember == false) {
+       if (foundMember == false) {
                _INFO("");
                free(getRegAssertionInfo);
                return NULL;
old mode 100644 (file)
new mode 100755 (executable)
index 0888a98..3b8950a
 #include "AsmHelper.h"
 #include "AuthnrTypes.h"
 
-RegCountersInfoTlvEncoder::RegCountersInfoTlvEncoder(void)
-{
-
-}
+RegCountersInfoTlvEncoder::RegCountersInfoTlvEncoder(void) {}
 
 Buffer *
 RegCountersInfoTlvEncoder::encode(const void *authData)
old mode 100644 (file)
new mode 100755 (executable)
index 3226efd..d8c5a2d
 #include "AsmHelper.h"
 #include "AuthnrTypes.h"
 
-RegAssertionTlvEncoder::RegAssertionTlvEncoder(void)
-{
-
-}
+RegAssertionTlvEncoder::RegAssertionTlvEncoder(void) {}
 
 Buffer *
 RegAssertionTlvEncoder::encode(const void *authData)
 {
-
        _INFO("RegAssertionTlvEncoder::encode start");
 
        RET_IF_FAIL(authData != NULL, NULL);
@@ -48,7 +44,7 @@ RegAssertionTlvEncoder::encode(const void *authData)
        tlv_builder_add_int8(builder, TAG_AUTHENTICATOR_INDEX, getRegReq->authIdx);
        _INFO("RegAssertionTlvEncoder::encode 5");
 
-       if(getRegReq->appId != NULL) {
+       if (getRegReq->appId != NULL) {
                tlv_builder_add_string(builder, TAG_APPID, getRegReq->appId);
                _INFO("RegAssertionTlvEncoder::encode 6");
        }
@@ -65,7 +61,7 @@ RegAssertionTlvEncoder::encode(const void *authData)
        tlv_builder_add_buffer(builder, TAG_KEYHANDLE_ACCESS_TOKEN, getRegReq->khAccessToken);
        _INFO("RegAssertionTlvEncoder::encode 10");
 
-       if(getRegReq->userVToken != NULL) {
+       if (getRegReq->userVToken != NULL) {
                tlv_builder_add_string(builder, TAG_USERVERIFY_TOKEN, getRegReq->userVToken);
                _INFO("RegAssertionTlvEncoder::encode 11");
        }
@@ -109,7 +105,6 @@ RegAssertionTlvEncoder::decode(const unsigned char *rawData)
 
        while(1) {
                switch(child->tag) {
-
                case TAG_AUTHENTICATOR_INDEX:
                        _INFO("");
                        getRegReqInfo->authIdx = *(int*)__intTlvEncoder.decode(rawData + rawIter);
@@ -165,7 +160,7 @@ RegAssertionTlvEncoder::decode(const unsigned char *rawData)
                }
 
                rawIter = rawIter + 2 + 2 + child->len;
-               if(rawIter >= endIter)
+               if (rawIter >= endIter)
                        break;
 
                SAFE_DELETE(child->val);
@@ -185,7 +180,7 @@ RegAssertionTlvEncoder::decode(const unsigned char *rawData)
        SAFE_DELETE(root->val);
        SAFE_DELETE(root);
 
-       if(foundMember == false) {
+       if (foundMember == false) {
                free(getRegReqInfo);
                return NULL;
        }
old mode 100644 (file)
new mode 100755 (executable)
index ef1322e..2aa7b1e
 #include "AsmHelper.h"
 #include "AuthnrTypes.h"
 
-RegRespTlvEncoder::RegRespTlvEncoder(void)
-{
-
-}
+RegRespTlvEncoder::RegRespTlvEncoder(void) {}
 
 Buffer *
 RegRespTlvEncoder::encode(const void *authData)
@@ -53,7 +50,7 @@ RegRespTlvEncoder::encode(const void *authData)
        /*1.3 end*/
 
        /*1.4 TAG_KEYHANDLE*/
-       if(getRegResp->kh != NULL) {
+       if (getRegResp->kh != NULL) {
                tlv_builder_add_buffer(builder, TAG_KEYHANDLE, getRegResp->kh);
        }
 
@@ -94,9 +91,7 @@ RegRespTlvEncoder::decode(const unsigned char *rawData)
        RegisterResp *getRegRespInfo = ALLOC(RegisterResp);
 
        while(1) {
-
                switch(child->tag) {
-
                        case TAG_STATUS_CODE:
                                _INFO("");
                                getRegRespInfo->statusCode = *(int*)__intTlvEncoder.decode(rawData + rawIter);
@@ -124,7 +119,7 @@ RegRespTlvEncoder::decode(const unsigned char *rawData)
 
                _INFO("");
                rawIter = rawIter + 2 + 2 + child->len;
-               if(rawIter >= endIter) {
+               if (rawIter >= endIter) {
                        _INFO("");
                        break;
                }
@@ -148,7 +143,7 @@ RegRespTlvEncoder::decode(const unsigned char *rawData)
        SAFE_DELETE(root);
 
        _INFO("");
-       if(foundMember == false) {
+       if (foundMember == false) {
                _INFO("");
                free(getRegRespInfo);
                return NULL;
old mode 100644 (file)
new mode 100755 (executable)
index 1032219..292bb3d
 #include "AsmHelper.h"
 #include "AuthnrTypes.h"
 
-SignAuthAssertionTlvEncoder::SignAuthAssertionTlvEncoder(void)
-{
-
-}
+SignAuthAssertionTlvEncoder::SignAuthAssertionTlvEncoder(void) {}
 
 Buffer *
 SignAuthAssertionTlvEncoder::encode(const void *authData)
@@ -38,8 +35,7 @@ SignAuthAssertionTlvEncoder::encode(const void *authData)
        /*1. TAG_UAFV1_AUTH_ASSERTION*/
        tlv_builder_start_composite(builder, TAG_UAFV1_AUTH_ASSERTION);
 
-       if(getAuthAssertionInfo->sigData != NULL) {
-
+       if (getAuthAssertionInfo->sigData != NULL) {
                /*1.2 TAG_UAFV1_SIGNED_DATA*/
 
                SigData *getSigDataInfo = (SigData*)getAuthAssertionInfo->sigData;
@@ -104,9 +100,7 @@ SignAuthAssertionTlvEncoder::decode(const unsigned char *rawData)
        }
 
        while(1) {
-
                switch(child->tag) {
-
                case TAG_UAFV1_SIGNED_DATA:
                        getAuthAssInfo->sigData = (SigData*)__sigDataTlvEncoder.decode(rawData + rawIter);
                        foundMember = true;
@@ -122,7 +116,7 @@ SignAuthAssertionTlvEncoder::decode(const unsigned char *rawData)
                        break;
                }
                rawIter = rawIter + 2 + 2 + child->len;
-               if(rawIter >= endIter)
+               if (rawIter >= endIter)
                        break;
 
                SAFE_DELETE(child->val);
@@ -142,7 +136,7 @@ SignAuthAssertionTlvEncoder::decode(const unsigned char *rawData)
        SAFE_DELETE(root->val);
        SAFE_DELETE(root);
 
-       if(foundMember == false) {
+       if (foundMember == false) {
                free(getAuthAssInfo);
                return NULL;
        }
old mode 100644 (file)
new mode 100755 (executable)
index 65c82fe..d8233f2
 #include "AsmHelper.h"
 #include "AuthnrTypes.h"
 
-SignReqTlvEncoder::SignReqTlvEncoder(void)
-{
-
-}
+SignReqTlvEncoder::SignReqTlvEncoder(void) {}
 
 Buffer *
 SignReqTlvEncoder::encode(const void *authData)
@@ -45,8 +42,7 @@ SignReqTlvEncoder::encode(const void *authData)
        /*1.2 TAG_AUTHENTICATOR_INDEX*/
        tlv_builder_add_int8(builder, TAG_AUTHENTICATOR_INDEX, getAuthReqInfo->authIdx);
 
-       if(getAuthReqInfo->appId != NULL) {
-
+       if (getAuthReqInfo->appId != NULL) {
                /*1.3 TAG_APPID*/
                tlv_builder_add_string(builder, TAG_APPID, getAuthReqInfo->appId);
        }
@@ -54,8 +50,7 @@ SignReqTlvEncoder::encode(const void *authData)
        /*1.4 TAG_FINAL_CHALLENGE*/
        tlv_builder_add_buffer(builder, TAG_FINAL_CHALLENGE, getAuthReqInfo->fch);
 
-       if(getAuthReqInfo->tc != NULL) {
-
+       if (getAuthReqInfo->tc != NULL) {
                /*1.5 TAG_TRANSACTION_CONTENT*/
                tlv_builder_add_string(builder, TAG_TRANSACTION_CONTENT, getAuthReqInfo->tc);
        }
@@ -63,14 +58,12 @@ SignReqTlvEncoder::encode(const void *authData)
        /*1.6 TAG_KEYHANDLE_ACCESS_TOKEN*/
        tlv_builder_add_buffer(builder, TAG_KEYHANDLE_ACCESS_TOKEN, getAuthReqInfo->khATok);
 
-       if(getAuthReqInfo->userVToken != NULL) {
-
+       if (getAuthReqInfo->userVToken != NULL) {
                /*1.7 TAG_USERVERIFY_TOKEN*/
                tlv_builder_add_string(builder, TAG_USERVERIFY_TOKEN, getAuthReqInfo->userVToken);
        }
 
-       if(getAuthReqInfo->khHList != NULL) {
-
+       if (getAuthReqInfo->khHList != NULL) {
                GList *getKhInfoIter = g_list_first(getAuthReqInfo->khHList);
 
                while(getKhInfoIter != NULL) {
@@ -123,9 +116,7 @@ SignReqTlvEncoder::decode(const unsigned char *rawData)
        bool foundMember = false;
 
        while(1) {
-
                switch(child->tag) {
-
                        case TAG_AUTHENTICATOR_INDEX:
                                getAuthReqInfo->authIdx = *(int*)__intTlvEncoder.decode(rawData + rawIter);
                                foundMember = true;
@@ -158,7 +149,7 @@ SignReqTlvEncoder::decode(const unsigned char *rawData)
 
                        case TAG_KEYHANDLE: {
                                char *getKeyHandle = (char*)__strTlvEncoder.decode(rawData + rawIter);
-                               if(getKeyHandle != NULL) {
+                               if (getKeyHandle != NULL) {
                                                getAuthReqInfo->khHList = g_list_append(getAuthReqInfo->khHList, getKeyHandle);
                                                getKeyHandle = NULL;
                                        }
@@ -172,7 +163,7 @@ SignReqTlvEncoder::decode(const unsigned char *rawData)
                }
 
                rawIter = rawIter + 2 + 2 + child->len;
-               if(rawIter >= endIter)
+               if (rawIter >= endIter)
                        break;
 
                SAFE_DELETE(child->val);
@@ -192,7 +183,7 @@ SignReqTlvEncoder::decode(const unsigned char *rawData)
        SAFE_DELETE(root->val);
        SAFE_DELETE(root);
 
-       if(foundMember == false) {
+       if (foundMember == false) {
                free(getAuthReqInfo);
                return NULL;
        }
old mode 100644 (file)
new mode 100755 (executable)
index 100d4f3..f5c3c88
 #include "AsmHelper.h"
 #include "AuthnrTypes.h"
 
-UserNameKhTlvEncoder::UserNameKhTlvEncoder(void)
-{
-
-}
+UserNameKhTlvEncoder::UserNameKhTlvEncoder(void) {}
 
 Buffer *
 UserNameKhTlvEncoder::encode(const void *authData)
@@ -62,9 +59,7 @@ UserNameKhTlvEncoder::decode(const unsigned char *rawData)
        bool foundMember = false;
 
        while(1) {
-
                switch(child->tag) {
-
                        case TAG_USERNAME:
                                getUsnKhInfo->userName = (char*)__strTlvEncoder.decode(rawData + rawIter);
                                foundMember = true;
@@ -80,7 +75,7 @@ UserNameKhTlvEncoder::decode(const unsigned char *rawData)
                                break;
                }
                rawIter = rawIter + 2 + 2 + child->len;
-               if(rawIter >= endIter)
+               if (rawIter >= endIter)
                        break;
 
                SAFE_DELETE(child->val);
@@ -99,7 +94,7 @@ UserNameKhTlvEncoder::decode(const unsigned char *rawData)
        SAFE_DELETE(root->val);
        SAFE_DELETE(root);
 
-       if(foundMember == false) {
+       if (foundMember == false) {
                free(getUsnKhInfo);
                return NULL;
        }
@@ -108,10 +103,7 @@ UserNameKhTlvEncoder::decode(const unsigned char *rawData)
        return getUsnKhInfo;
 }
 
-SignRespTlvEncoder::SignRespTlvEncoder(void)
-{
-
-}
+SignRespTlvEncoder::SignRespTlvEncoder(void) {}
 
 Buffer *
 SignRespTlvEncoder::encode(const void *authData)
@@ -129,8 +121,7 @@ SignRespTlvEncoder::encode(const void *authData)
        /*1.1 TAG_STATUS_CODE*/
        tlv_builder_add_int16(builder, TAG_STATUS_CODE, getAuthRespInfo->statusCode);
 
-       if(getAuthRespInfo->uKhList != NULL) {
-
+       if (getAuthRespInfo->uKhList != NULL) {
                _INFO("SignRespTlvEncoder::uKhList");
                GList *iter = g_list_first(getAuthRespInfo->uKhList);
                while(iter != NULL) {
@@ -149,9 +140,7 @@ SignRespTlvEncoder::encode(const void *authData)
 
                        iter = iter->next;
                }
-       }
-       else if(getAuthRespInfo->authAssertion != NULL) {
-
+       } else if (getAuthRespInfo->authAssertion != NULL) {
                _INFO("SignRespTlvEncoder::authAssertion");
                /*1.3 TAG_AUTHENTICATOR_ASSERTION*/
 
@@ -161,9 +150,7 @@ SignRespTlvEncoder::encode(const void *authData)
                tlv_builder_add_buffer(builder, TAG_AUTHENTICATOR_ASSERTION, getAuthAssertionInfoBuff);
 
                /*1.3 end*/
-       }
-       else {
-
+       } else {
                _ERR("Neither UsernameKeyhandle List nor Authentication Assertion is set");
                SAFE_DELETE(builder);
                return NULL;
@@ -210,9 +197,7 @@ SignRespTlvEncoder::decode(const unsigned char *rawData)
        bool foundMember = false;
 
        while(1) {
-
                switch(child->tag) {
-
                case TAG_STATUS_CODE:
                        getAuthRespInfo->statusCode = *(int*)__intTlvEncoder.decode(rawData + rawIter);
                        foundMember = true;
@@ -221,7 +206,7 @@ SignRespTlvEncoder::decode(const unsigned char *rawData)
                case TAG_USERNAME_AND_KEYHANDLE: {
                        _INFO("SignRespTlvEncoder::decode TAG_USERNAME_AND_KEYHANDLE");
                        UserNameKeyHandle *uKhInfo = (UserNameKeyHandle*)__uKhTlvEncoder.decode(rawData + rawIter);
-                       if(uKhInfo != NULL) {
+                       if (uKhInfo != NULL) {
                                getAuthRespInfo->uKhList = g_list_append(getAuthRespInfo->uKhList, uKhInfo);
                                uKhInfo = NULL;
                        }
@@ -240,7 +225,7 @@ SignRespTlvEncoder::decode(const unsigned char *rawData)
                        break;
                }
                rawIter = rawIter + 2 + 2 + child->len;
-               if(rawIter >= endIter)
+               if (rawIter >= endIter)
                        break;
 
                SAFE_DELETE(child->val);
@@ -260,7 +245,7 @@ SignRespTlvEncoder::decode(const unsigned char *rawData)
        SAFE_DELETE(root->val);
        SAFE_DELETE(root);
 
-       if(foundMember == false) {
+       if (foundMember == false) {
                free(getAuthRespInfo);
                return NULL;
        }
old mode 100644 (file)
new mode 100755 (executable)
index 528cd27..bcf3a36
 #include "AsmHelper.h"
 #include "AuthnrTypes.h"
 
-SignedDataTlvEncoder::SignedDataTlvEncoder(void)
-{
-
-}
+SignedDataTlvEncoder::SignedDataTlvEncoder(void) {}
 
 Buffer *
 SignedDataTlvEncoder::encode(const void *authData)
@@ -41,11 +38,9 @@ SignedDataTlvEncoder::encode(const void *authData)
        /*1.2.2 TAG_AAID*/
        tlv_builder_add_string(builder, TAG_AAID, getSigDataInfo->aaid);
 
-       if(getSigDataInfo->assrtInfo != NULL) {
-
+       if (getSigDataInfo->assrtInfo != NULL) {
                Buffer *getAssertionInfoBuff = __assertionInfo.encode(getSigDataInfo->assrtInfo);
-               if(getAssertionInfoBuff != NULL) {
-
+               if (getAssertionInfoBuff != NULL) {
                        /*1.2.3 TAG_ASSERTION_INFO*/
                        tlv_builder_add_buffer(builder, TAG_ASSERTION_INFO, getAssertionInfoBuff);
                }
@@ -63,11 +58,9 @@ SignedDataTlvEncoder::encode(const void *authData)
        /*1.2.7 TAG_KEYID*/
        tlv_builder_add_buffer(builder, TAG_KEYID, getSigDataInfo->keyId);
 
-       if(getSigDataInfo->counter != NULL) {
-
+       if (getSigDataInfo->counter != NULL) {
                Buffer *getCounterInfoBuff = __counterInfo.encode(getSigDataInfo->counter);
-               if(getCounterInfoBuff != NULL) {
-
+               if (getCounterInfoBuff != NULL) {
                        /*1.2.8 TAG_COUNTERS*/
                        tlv_builder_add_buffer(builder, TAG_COUNTERS, getCounterInfoBuff);
                }
@@ -108,9 +101,7 @@ SignedDataTlvEncoder::decode(const unsigned char *rawData)
        bool foundMember = false;
 
        while(1) {
-
                switch(child->tag) {
-
                case TAG_AAID:
                        getSigDataInfo->aaid = (char*)__strTlvEncoder.decode(rawData + rawIter);
                        foundMember = true;
@@ -152,7 +143,7 @@ SignedDataTlvEncoder::decode(const unsigned char *rawData)
                }
 
                rawIter = rawIter + 2 + 2 + child->len;
-               if(rawIter >= endIter)
+               if (rawIter >= endIter)
                        break;
 
                SAFE_DELETE(child->val);
@@ -172,7 +163,7 @@ SignedDataTlvEncoder::decode(const unsigned char *rawData)
        SAFE_DELETE(root->val);
        SAFE_DELETE(root);
 
-       if(foundMember == false) {
+       if (foundMember == false) {
                free(getSigDataInfo);
                return NULL;
        }
old mode 100644 (file)
new mode 100755 (executable)
index 90cac50..a149bf4
 #include "AsmHelper.h"
 #include "AuthnrTypes.h"
 
-StringTlvEncoder::StringTlvEncoder(void)
-{
-
-}
+StringTlvEncoder::StringTlvEncoder(void) {}
 
 Buffer *
 StringTlvEncoder::encode(const void *strTlv)
old mode 100644 (file)
new mode 100755 (executable)
index 7ae50e8..6a13a03
@@ -81,7 +81,6 @@ tlv_decode(const uint8_t *tlv_buffer_in)
        if (tlv->len > 0) {
                tlv->val = (uint8_t *)calloc(1, tlv->len);
                memcpy(tlv->val, tlv_buffer_in + 2 + 2, tlv->len);
-
        }
        _INFO("[%0002x][%d]", tlv->tag, tlv->len);
 
old mode 100644 (file)
new mode 100755 (executable)
index 0f8640e..592d6f7
 #include "AuthnrTypes.h"
 #include "stdio.h"
 
-Uafv1KrdTlvEncoder::Uafv1KrdTlvEncoder(void)
-{
-
-}
+Uafv1KrdTlvEncoder::Uafv1KrdTlvEncoder(void) {}
 
 Buffer *
 Uafv1KrdTlvEncoder::encode(const void *authData)
@@ -42,11 +39,9 @@ Uafv1KrdTlvEncoder::encode(const void *authData)
        /*1.2.2 TAG_AAID*/
        tlv_builder_add_string(builder, TAG_AAID, getRegAssertionKrd->aaid);
 
-       if(getRegAssertionKrd->assrtInfo != NULL) {
-
+       if (getRegAssertionKrd->assrtInfo != NULL) {
                Buffer *assertionInfoBuff = __assertionInfo.encode(getRegAssertionKrd->assrtInfo);
-               if(assertionInfoBuff != NULL) {
-
+               if (assertionInfoBuff != NULL) {
                        /*1.2.3 TAG_ASSERTION_INFO*/
                        tlv_builder_add_buffer(builder, TAG_ASSERTION_INFO, assertionInfoBuff);
                }
@@ -58,11 +53,9 @@ Uafv1KrdTlvEncoder::encode(const void *authData)
        /*1.2.5 TAG_KEYID*/
        tlv_builder_add_buffer(builder, TAG_KEYID, getRegAssertionKrd->keyId);
 
-       if(getRegAssertionKrd->counter != NULL) {
-
+       if (getRegAssertionKrd->counter != NULL) {
                Buffer *countersInfoBuff = __countersInfo.encode(getRegAssertionKrd->counter);
-               if(countersInfoBuff != NULL) {
-
+               if (countersInfoBuff != NULL) {
                        /*1.2.6 TAG_COUNTERS*/
                        tlv_builder_add_buffer(builder, TAG_COUNTERS, countersInfoBuff);
                }
@@ -111,9 +104,7 @@ Uafv1KrdTlvEncoder::decode(const unsigned char *rawData)
        bool foundMember = false;
 
        while(1) {
-
                switch(child->tag) {
-
                        case TAG_AAID:
                                getKrdInfo->aaid = (char*)__strTlvEncoder.decode(rawData + rawIter);
                                _INFO("aaid [%s]", getKrdInfo->aaid);
@@ -152,7 +143,7 @@ Uafv1KrdTlvEncoder::decode(const unsigned char *rawData)
                }
 
                rawIter = rawIter + 2 + 2 + child->len;
-               if(rawIter >= endIter)
+               if (rawIter >= endIter)
                        break;
 
                SAFE_DELETE(child->val);
@@ -172,7 +163,7 @@ Uafv1KrdTlvEncoder::decode(const unsigned char *rawData)
        SAFE_DELETE(root->val);
        SAFE_DELETE(root);
 
-       if(foundMember == false) {
+       if (foundMember == false) {
                free(getKrdInfo);
                return NULL;
        }
old mode 100644 (file)
new mode 100755 (executable)
index e1284d7..8cabeae
@@ -181,7 +181,6 @@ AcUiAdaptor::OnAccountResponseFromUi(const char *sessionData, int result, const
                        AcUiAdaptor::getInstance()->__result = AC_UI_RESULT_USER_DENIED;
        }
 
-
        g_main_loop_quit(AcUiAdaptor::getInstance()->__mainLoop);
 
 }
old mode 100644 (file)
new mode 100755 (executable)
index 38f0d62..0589c98
@@ -89,9 +89,9 @@ PinAuthUiAdaptor::getTokenFromUi(pin_auth_mode_e type, const std::string& appId,
        __result = -1;
 
        bundle *b = bundle_create();
-       if (type == PIN_AUTH_MODE_ENROLL)
+       if (type == PIN_AUTH_MODE_ENROLL) {
                bundle_add_str(b, TC_UI_KEY_MODE, TC_UI_VAL_MODE_PIN_ENROLL);
-       else if (type == PIN_AUTH_MODE_VERIFY) {
+       else if (type == PIN_AUTH_MODE_VERIFY) {
                bundle_add_str(b, TC_UI_KEY_MODE, TC_UI_VAL_MODE_PIN_VERIFY);
                bundle_add_str(b, TC_UI_KEY_TOK, tok.c_str());
        }
@@ -188,7 +188,6 @@ PinAuthUiAdaptor::OnAuthResponseFromUi(const char *sessionData, const char *usrV
        PinAuthUiAdaptor::getInstance()->__result = result;
 
        g_main_loop_quit(PinAuthUiAdaptor::getInstance()->__mainLoop);
-
 }
 
 PinAuthUiAdaptor::PinAuthUiAdaptor(void)
old mode 100644 (file)
new mode 100755 (executable)
index 8f98a81..37fa538
@@ -139,7 +139,6 @@ TcUiAdaptor::OnTcResponseFromUi(const char *sessionData, int result)
        TcUiAdaptor::getInstance()->__result = result;
 
        g_main_loop_quit(TcUiAdaptor::getInstance()->__mainLoop);
-
 }
 
 TcUiAdaptor::TcUiAdaptor(void)
old mode 100644 (file)
new mode 100755 (executable)
index f106bf4..8635f05
@@ -5,7 +5,6 @@
 #include <string>
 
 class AuthIndexHandler {
-
 public:
        static AuthIndexHandler *getInstance(void);
 
old mode 100644 (file)
new mode 100755 (executable)
index bf8f59b..e530ce2
@@ -14,7 +14,7 @@ class AuthManager {
 public:
        static AuthManager* getInstance(void);
 
-       std::vector<IAuthStub*>getAuthStubList(auth_type_e type);
+       std::vector<IAuthStub*> *getAuthStubList(auth_type_e type);
        IAuthStub* getAuthStub(int mappedIndex);
        int setAuthStubCache(auth_type_e type, std::map<int, IAuthStub*> *stubCache);
 
old mode 100644 (file)
new mode 100755 (executable)
index 7ca3822..b80aaa9
@@ -20,8 +20,7 @@
 
 #include "IAuthStub.h"
 
-class BAuthStub : public IAuthStub {
-
+class BAuthStub:public IAuthStub {
        friend class BoundADProvider;
 
 public:
@@ -55,10 +54,7 @@ public:
 
        Buffer* encodeRegisterRespone(RegAssertion *regAssrt, char **assrt_scheme);
        Buffer* encodeSignRespone(AuthAssertion *authAssertion, char **assrt_scheme);
-       virtual void shutDown(void)
-       {
-
-       }
+       virtual void shutDown(void) {}
 
 private:
        BAuthStub(void);
old mode 100644 (file)
new mode 100755 (executable)
index c43e616..5e7f841
 #include <glib.h>
 #include <gmodule.h>
 
-class BoundADProvider : public IADProvider {
-
+class BoundADProvider:public IADProvider {
        friend class AuthManager;
 public:
        virtual int init(void);
        virtual auth_type_e getType(void);
        virtual std::vector<IAuthStub*> *getAuthStubList(void);
        virtual void setCache(std::map<int, IAuthStub*> *stubCache);
-       virtual IAuthStubgetStubFromCache(int mappedIdx);
+       virtual IAuthStub *getStubFromCache(int mappedIdx);
 
        virtual ~BoundADProvider(void);
 
@@ -51,7 +50,6 @@ private:
 private:
        std::map<int, IAuthStub*> *__stubCache;
        typedef std::map<int, IAuthStub*>::iterator AuthnrMapIter;
-
 };
 
 #endif /* _BADP_H_ */
old mode 100644 (file)
new mode 100755 (executable)
index bfce2d9..5db11d3
@@ -6,14 +6,14 @@
 #include "IADProvider.h"
 #include <bluetooth.h>
 
-class BtAdProvider : public IADProvider {
+class BtAdProvider:public IADProvider {
        friend class AuthManager;
 public:
        virtual int init(void);
        virtual auth_type_e getType(void);
        virtual std::vector<IAuthStub*> *getAuthStubList(void);
        virtual void setCache(std::map<int, IAuthStub*> *stubCache);
-       virtual IAuthStubgetStubFromCache(int mappedIdx);
+       virtual IAuthStub *getStubFromCache(int mappedIdx);
 
        virtual ~BtAdProvider(void);
 
old mode 100644 (file)
new mode 100755 (executable)
index d19c0d4..94f48bc
@@ -13,13 +13,13 @@ public:
        BtCon *__caller;
 };
 
-class BtCon : public IAuthConnection {
+class BtCon:public IAuthConnection {
 public:
        BtCon(void);
        ~BtCon(void);
 
        virtual int init(void *handle);
-       virtual StringMap* sendReqSync(StringMap *reqData);
+       virtual StringMap * sendReqSync(StringMap *reqData);
        virtual int shutdown(void);
        virtual char* getInfo(void);
 
old mode 100644 (file)
new mode 100755 (executable)
index 36b0069..f3402e8
@@ -30,9 +30,9 @@ public:
        virtual auth_type_e getType(void) = 0;
        virtual std::vector<IAuthStub*> *getAuthStubList(void) = 0;
        virtual void setCache(std::map<int, IAuthStub*> *stubCache) = 0;
-       virtual IAuthStubgetStubFromCache(int mappedIdx) = 0;
+       virtual IAuthStub *getStubFromCache(int mappedIdx) = 0;
 
-       virtual ~IADProvider(){}
+       virtual ~IADProvider() {}
 };
 
 #endif /* _IADP_H_ */
old mode 100644 (file)
new mode 100755 (executable)
index 773c23c..3534009
@@ -11,7 +11,7 @@ public:
        ~IAuthConnection(void){}
 
        virtual int init(void *handle) = 0;
-       virtual StringMap* sendReqSync(StringMap *reqData) = 0;
+       virtual StringMap * sendReqSync(StringMap *reqData) = 0;
        virtual char *getInfo(void) = 0;
        virtual int shutdown(void) = 0;
 };
old mode 100644 (file)
new mode 100755 (executable)
index 72c359e..cdad7ba
@@ -44,13 +44,13 @@ public:
        virtual int enroll(const char *opt) = 0;
        virtual bool isEnrolled(void) = 0;
        virtual int verify(const char *opt, const char *fch, char **vToken) = 0;
-       virtual RegisterResp* processRegister(const RegisterReq *regReq) = 0;
-       virtual AuthenticateResp* processAuthenticate(const AuthenticateReq *authnReq) = 0;
-       virtual DeregResp* processDeregister(const DeregReq *deregReq) = 0;
+       virtual RegisterResp * processRegister(const RegisterReq *regReq) = 0;
+       virtual AuthenticateResp * processAuthenticate(const AuthenticateReq *authnReq) = 0;
+       virtual DeregResp * processDeregister(const DeregReq *deregReq) = 0;
        virtual int openSettings(void) = 0;
-       virtual Buffer* hash(const std::string& message) = 0;
-       virtual BufferencodeRegisterRespone(RegAssertion *regAssrt, char **assrt_scheme) = 0;
-       virtual BufferencodeSignRespone(AuthAssertion *authAssertion, char **assrt_scheme) = 0;
+       virtual Buffer * hash(const std::string& message) = 0;
+       virtual Buffer *encodeRegisterRespone(RegAssertion *regAssrt, char **assrt_scheme) = 0;
+       virtual Buffer *encodeSignRespone(AuthAssertion *authAssertion, char **assrt_scheme) = 0;
        virtual void shutDown(void) = 0;
 
        virtual ~IAuthStub(void){}
old mode 100644 (file)
new mode 100755 (executable)
index 71a3b82..1254266
@@ -4,16 +4,16 @@
 #include "IAuthConnection.h"
 #include "BoundADProvider.h"
 
-class LocalCon : public IAuthConnection {
+class LocalCon:public IAuthConnection {
        //friend class BoundADProvider;
 public:
        LocalCon(void) {}
        ~LocalCon(void) {}
 
-       virtual int init(void *handle) {return -1;}
-       StringMap* sendReqSync(StringMap *reqData) {return NULL;}
-       virtual int shutdown(void) {return 0;}
-       virtual char* getInfo(void) {return NULL;}
+       virtual int init(void *handle) {return -1; }
+       StringMap* sendReqSync(StringMap *reqData) {return NULL; }
+       virtual int shutdown(void) {return 0; }
+       virtual char* getInfo(void) {return NULL; }
 private:
        auth_plugin_handle_s *__pluginHandle;
 };
old mode 100644 (file)
new mode 100755 (executable)
index d0d29db..b6b2be7
@@ -21,8 +21,7 @@
 #include "IAuthStub.h"
 #include "IAuthConnection.h"
 
-class RAuthStub : public  IAuthStub {
-
+class RAuthStub:public  IAuthStub {
        friend class IotADProvider;
        friend class BleAdProvider;
        friend class BtAdProvider;
old mode 100644 (file)
new mode 100755 (executable)
index 24e88aa..f789182
@@ -8,7 +8,6 @@
 class AsmRequest;
 
 class RoamingUtil {
-
 public:
        static AsmRequest *createAuthReq(const char *tlvB64);
 
old mode 100644 (file)
new mode 100755 (executable)
index c021068..8a892a2
@@ -16,7 +16,6 @@ AuthIndexHandler::getInstance(void)
        __this = tempThis;
 
        return __this;
-
 }
 
 /*Maps the Auth Index reported by the Authenticator to the index used in ASM*/
@@ -42,12 +41,10 @@ AuthIndexHandler::getMappedIndex(const std::string& devId, const std::string& aa
 
        std::vector<IStorageParcel*> *searchRes = AsmStorage::getInstance()->searchData(searchParcel);
        if (searchRes != NULL && searchRes->size() > 0) {
-
                _INFO("Previously mapped index");
 
                std::vector<IStorageParcel*>::iterator searchResiter = searchRes->begin();
                for (; searchResiter != searchRes->end(); ++searchResiter) {
-
                        IStorageParcel *resParcel = (IStorageParcel*)(*searchResiter);
 
                        int mappedIndex = authIndex;
@@ -58,7 +55,6 @@ AuthIndexHandler::getMappedIndex(const std::string& devId, const std::string& aa
                }
 
        } else {
-
                _INFO("New index");
 
                IStorageParcel *searchParcelInner = new AuthStorageParcel();
@@ -72,10 +68,8 @@ AuthIndexHandler::getMappedIndex(const std::string& devId, const std::string& aa
 
                std::vector<IStorageParcel*> *searchResInner = AsmStorage::getInstance()->searchData(searchParcelInner);
                if (searchResInner != NULL) {
-
                        std::vector<IStorageParcel*>::iterator searchResiter = searchResInner->begin();
                        for (; searchResiter != searchResInner->end(); ++searchResiter) {
-
                                IStorageParcel *resParcel = (IStorageParcel*)(*searchResiter);
 
                                int mappedIndex = authIndex;
@@ -84,9 +78,7 @@ AuthIndexHandler::getMappedIndex(const std::string& devId, const std::string& aa
                                _INFO("Mapped Index=[%d]", mappedIndex);
                                return mappedIndex;
                        }
-
                }
-
        }
 
        _INFO("Mapped Index with error=[%d]", authIndex);
@@ -107,10 +99,8 @@ AuthIndexHandler::getAuthIndex(int mappedIndex)
 
        std::vector<IStorageParcel*> *searchRes = AsmStorage::getInstance()->searchData(searchParcel);
        if (searchRes != NULL) {
-
                std::vector<IStorageParcel*>::iterator searchResiter = searchRes->begin();
                for (; searchResiter != searchRes->end(); ++searchResiter) {
-
                        IStorageParcel *resParcel = (IStorageParcel*)(*searchResiter);
 
                        int authIndex = mappedIndex;
@@ -119,19 +109,12 @@ AuthIndexHandler::getAuthIndex(int mappedIndex)
                        _INFO("Real Index=[%d]", authIndex);
                        return authIndex;
                }
-
        }
 
        _INFO("Real Index with error=[%d]", mappedIndex);
        return mappedIndex;
 }
 
-AuthIndexHandler::AuthIndexHandler(void)
-{
-
-}
-
-AuthIndexHandler::~AuthIndexHandler(void)
-{
+AuthIndexHandler::AuthIndexHandler(void) {}
 
-}
+AuthIndexHandler::~AuthIndexHandler(void) {}
old mode 100644 (file)
new mode 100755 (executable)
index 65bc999..fcd9c99
@@ -122,7 +122,6 @@ AuthManager::getAuthStub(int mappedIndex)
 {
        std::vector<IADProvider*>::iterator adIter = __providerList.begin();
        for (; adIter != __providerList.end(); ++adIter) {
-
                IADProvider *pro = (IADProvider*)(*adIter);
                IAuthStub *stub = pro->getStubFromCache(mappedIndex);
                if (stub != NULL) {
@@ -148,7 +147,6 @@ AuthManager::setAuthStubCache(auth_type_e type, std::map<int, IAuthStub*> *stubC
        _INFO("");
        std::vector<IADProvider*>::iterator adIter = __providerList.begin();
        for (; adIter != __providerList.end(); ++adIter) {
-
                IADProvider *pro = (IADProvider*)(*adIter);
 
                _INFO("");
@@ -159,6 +157,5 @@ AuthManager::setAuthStubCache(auth_type_e type, std::map<int, IAuthStub*> *stubC
                        return 0;
                }
        }
-
        return -1;
 }
old mode 100644 (file)
new mode 100755 (executable)
index 88bc19d..386ff28
@@ -50,11 +50,9 @@ BAuthStub::getInfo(void)
 
                _INFO("");
                if (__cachedData->authList != NULL) {
-
                        _INFO("");
                        GList *authListIter = g_list_first(__cachedData->authList);
                        while (authListIter != NULL) {
-
                                _INFO("");
                                AuthenticatorInfo *authInfo = (AuthenticatorInfo*)(authListIter->data);
                                /*TODO: Find Device ID logic used by IoTCon*/
@@ -71,7 +69,6 @@ BAuthStub::getInfo(void)
                                _INFO("");
                                authListIter = authListIter->next;
                        }
-
                }
 
 
@@ -81,10 +78,7 @@ BAuthStub::getInfo(void)
                /*__cachedData->attach_hint = __pluginHandle->conn->attach_hint();*/
                __cachedData->title = __pluginHandle->conn->title();
                __cachedData->description = __pluginHandle->conn->description();
-       }
-
-       /*Resetting fields altered during last RA operation*/
-       else if (__cachedData->authList != NULL) {
+       } else if (__cachedData->authList != NULL) {  /*Resetting fields altered during last RA operation*/
                _INFO("");
                GList *authListIter = g_list_first(__cachedData->authList);
                while (authListIter != NULL) {
@@ -157,7 +151,7 @@ _parse_enroll_request(char *enrollJson, char **appId, char **aaid)
 bool
 BAuthStub::isUserVerificationNeeded(void)
 {
-       if(__pluginHandle->user == NULL || __pluginHandle->user->is_uv_reqd == NULL) {
+       if (__pluginHandle->user == NULL || __pluginHandle->user->is_uv_reqd == NULL) {
                return true;
        }
 
@@ -167,7 +161,7 @@ BAuthStub::isUserVerificationNeeded(void)
 bool
 BAuthStub::hasAuthUi(void)
 {
-       if((__pluginHandle->user == NULL) ||
+       if ((__pluginHandle->user == NULL) ||
                        (__pluginHandle->user->enroll == NULL) ||
                        (__pluginHandle->user->verify == NULL)) {
                _INFO("Auth does not have inbuilt UI");
@@ -183,12 +177,10 @@ BAuthStub::enroll(const char *opt)
        _BEGIN;
        RET_IF_FAIL(__pluginHandle != NULL, -1);
 
-       if(__pluginHandle->user == NULL || __pluginHandle->user->enroll == NULL) {
-
+       if (__pluginHandle->user == NULL || __pluginHandle->user->enroll == NULL) {
                _INFO("BAuthStub::enroll::__pluginHandle->user->enroll NULL");
 
                RET_IF_FAIL(opt != NULL, -1);
-
                char *appId = NULL;
                char *aaid = NULL;
                int res = _parse_enroll_request((char*)opt, &appId, &aaid);
@@ -208,7 +200,7 @@ BAuthStub::enroll(const char *opt)
                int ret = -1;
                std::string appIdStr(appId);
                std::string tok = uiAd->enrollUser(appIdStr, &ret);
-               if(tok.c_str() == NULL) {
+               if (tok.c_str() == NULL) {
                        _INFO("BAuthStub::enroll::token NULL");
                        SAFE_DELETE(appId);
                        SAFE_DELETE(aaid);
@@ -293,8 +285,7 @@ BAuthStub::verify(const char *opt, const char *fch, char **vToken)
 {
        _BEGIN;
 
-       if(__pluginHandle->user == NULL || __pluginHandle->user->verify == NULL) {
-
+       if (__pluginHandle->user == NULL || __pluginHandle->user->verify == NULL) {
                _INFO("BAuthStub::verify::__pluginHandle->user->verify NULL");
 
                _INFO("VERIFY TOKEN = [%s]", *vToken);
@@ -343,9 +334,7 @@ BAuthStub::processRegister(const RegisterReq *regReq)
                __pluginHandle->process->process(authReq->data, &authRespRaw);
 
                return encodableResp.decode(authRespRaw);
-
-       }
-       else {
+       } else {
                authReq = __pluginHandle->assrt->encode(TAG_UAFV1_REGISTER_CMD, regReq);
 
                __pluginHandle->process->process(authReq->data, &authRespRaw);
@@ -383,9 +372,7 @@ BAuthStub::processAuthenticate(const AuthenticateReq *authnReq)
                __pluginHandle->process->process(authReq->data, &authRespRaw);
 
                return encodableResp.decode(authRespRaw);
-
-       }
-       else {
+       } else {
                authReq = __pluginHandle->assrt->encode(TAG_UAFV1_SIGN_CMD, authnReq);
 
                __pluginHandle->process->process(authReq->data, &authRespRaw);
@@ -424,9 +411,7 @@ BAuthStub::processDeregister(const DeregReq *deregReq)
                __pluginHandle->process->process(authReq->data, &authRespRaw);
 
                return encodableResp.decode(authRespRaw);
-
-       }
-       else {
+       } else {
                authReq = __pluginHandle->assrt->encode(TAG_UAFV1_DEREGISTER_CMD, deregReq);
 
                __pluginHandle->process->process(authReq->data, &authRespRaw);
@@ -459,7 +444,6 @@ BAuthStub::hash(const std::string& message)
 
        /*Defult handlers*/
        if (__pluginHandle->hash == NULL) {
-
                unsigned char digest[5000];
                AsmCrypto::genHash256(message.c_str(), strlen(message.c_str()), digest);
                _INFO("AuthenrStub::hash::digest generated is [%s]", digest);
@@ -487,7 +471,6 @@ BAuthStub::hash(const std::string& message)
 
        _END;
        return hashInfo;
-
 }
 
 Buffer*
@@ -500,7 +483,6 @@ BAuthStub::encodeRegisterRespone(RegAssertion *regAssrt, char **assrt_scheme)
 
        /*Default handlers*/
        if (__pluginHandle->assrt == NULL) {
-
                TlvEncodable<RegAssertion> encodableRegAssrtn(regAssrt);
                encodableRegAssrtn.setEncoder(EID_UAFV1_REG_ASSERTION_RESP);
 
@@ -509,9 +491,7 @@ BAuthStub::encodeRegisterRespone(RegAssertion *regAssrt, char **assrt_scheme)
 
                _END;
                return encodableRegAssrtn.encode();
-
-       }
-       else {
+       } else {
                _END;
                return __pluginHandle->assrt->encode(TAG_UAFV1_REG_ASSERTION, regAssrt);
        }
@@ -531,7 +511,6 @@ BAuthStub::encodeSignRespone(AuthAssertion *authAssertion, char **assrt_scheme)
 
        /*Default handlers*/
        if (__pluginHandle->assrt == NULL) {
-
                _INFO("");
                TlvEncodable<AuthAssertion> encodableSignAssrtn(authAssertion);
                encodableSignAssrtn.setEncoder(EID_UAFV1_SIGN_ASSERTION_RESP);
@@ -543,9 +522,7 @@ BAuthStub::encodeSignRespone(AuthAssertion *authAssertion, char **assrt_scheme)
                _INFO("");
                _END;
                return encodableSignAssrtn.encode();
-
-       }
-       else {
+       } else {
                _END;
                return __pluginHandle->assrt->encode(TAG_UAFV1_AUTH_ASSERTION, authAssertion);
        }
index f2a26b8..ab9ffdb 100755 (executable)
@@ -1,4 +1,3 @@
-
 #include "BoundADProvider.h"
 #include "AsmHelper.h"
 #include "AuthnrTypes.h"
@@ -132,7 +131,6 @@ BoundADProvider::createConnectionHandle(void *mod)
 CATCH:
         free(handle);
         return NULL;
-
 }
 
 plugin_assrt_handle_s*
@@ -241,7 +239,6 @@ BoundADProvider::createUiOpHandle(void *mod)
  CATCH:
          free(handle);
          return NULL;
-
 }
 
 int
@@ -264,7 +261,6 @@ BoundADProvider::loadPlugins(const std::string& dirName)
        _INFO("Before g_dir_read_name loop");
        while ((filename = g_dir_read_name(dir))) {
                if (g_pattern_match_string(plugin_name_pattern, filename)) {
-
                        std::string fullPathName;
                        fullPathName += dirName.c_str();
                        fullPathName += filename;
@@ -296,7 +292,6 @@ BoundADProvider::loadPlugins(const std::string& dirName)
 
                                /*Later, during setCache its overwritten by mappedIndex*/
                                __stubCache->insert(std::make_pair(auth_plugin->id, stub));
-
                        }
 
 
index 9d096ac..8eb2b0c 100755 (executable)
@@ -1,4 +1,3 @@
-
 #include "BtAdProvider.h"
 #include "IAuthConnection.h"
 #include "BtCon.h"
@@ -195,7 +194,6 @@ BtAdProvider::getAuthStubList(void)
        }
        _INFO("bluetooth ");
        return stubList;
-
 }
 
 void
@@ -230,7 +228,6 @@ BtAdProvider::~BtAdProvider(void)
 BtAdProvider::BtAdProvider(void)
 {
        __stubCache = NULL;
-
        __waitLoop = NULL;
        __isValidInst = false;
        __isDiscovering = false;
old mode 100644 (file)
new mode 100755 (executable)
index 3987316..cc9940f
@@ -1,4 +1,3 @@
-
 #include "BtCon.h"
 #include "BTRoamingKeys.h"
 #include "AsmHelper.h"
@@ -216,7 +215,6 @@ BtCon::onBtSockDataReceived(bt_socket_received_data_s *data, void *user_data)
                int i = 0;
 
                while (1) {
-
                        if (data->data[i] == RA_LEN_DELIM)
                                break;
                        if ((i == data->data_size) || (data->data[i] == '\0')) {
@@ -262,7 +260,6 @@ BtCon::onBtSockDataReceived(bt_socket_received_data_s *data, void *user_data)
 
                SAFE_DELETE(d_len_str);
        } else {
-
                pack = (char*)calloc(data->data_size, sizeof(char));
                memcpy(pack, data->data, data->data_size);
 
old mode 100644 (file)
new mode 100755 (executable)
index a2319b4..f3f1e5c
@@ -1,4 +1,3 @@
-
 #include "RAuthStub.h"
 #include "AsmHelper.h"
 #include "RoamingUtil.h"
@@ -93,7 +92,6 @@ RAuthStub::getInfo(void)
 
        /*Map AuthIndex to MappedIndex*/
        if (getInfoResp->authList != NULL) {
-
                GList *authListIter = g_list_first(getInfoResp->authList);
                while (authListIter != NULL) {
                        AuthenticatorInfo *authInfo = (AuthenticatorInfo*)(authListIter->data);
@@ -115,7 +113,6 @@ RAuthStub::getInfo(void)
                        authInfo->__isRoamingAuthenticator = TRUE;
                        authListIter = authListIter->next;
                }
-
        }
 
        getInfoResp->attach_hint = ATTACHMENT_HINT_EXTERNAL;
@@ -264,7 +261,6 @@ RAuthStub::hash(const std::string& message)
        _END;
 
        return hashInfo;
-
 }
 
 Buffer*
index dd48827..f463db9 100755 (executable)
@@ -104,7 +104,6 @@ RoamingUtil::b64Encode(unsigned char *input, int ip_len)
 AsmRequest*
 RoamingUtil::createAuthReq(const char *tlvB64)
 {
-
        RET_IF_FAIL(tlvB64 != NULL, NULL);
 
        unsigned char *tlvRaw = NULL;
@@ -123,7 +122,6 @@ RoamingUtil::createAuthReq(const char *tlvB64)
        AsmRequest *asmReq = new AsmRequest();
 
        switch (tlv->tag) {
-
        case TAG_UAFV1_GETINFO_CMD: {
                _INFO("");
                TlvEncodable<GetInfoReq> encodableReq;
@@ -173,7 +171,6 @@ RoamingUtil::createAuthReq(const char *tlvB64)
                SAFE_DELETE(tlv);
 
                return NULL;
-
        }
 
        _INFO("");
@@ -244,12 +241,9 @@ RoamingUtil::composeAuthGetInfoResponce(std::vector<GetAuthInfoResp*> *infoList)
 
                _INFO("RoamingUtil compose 2");
                if (resp->authList != NULL) {
-
                        _INFO("RoamingUtil compose 3");
                        GList *respAuthListIter = g_list_first(resp->authList);
-
                        while (respAuthListIter != NULL) {
-
                                _INFO("RoamingUtil compose 4");
                                AuthenticatorInfo *authInfo = (AuthenticatorInfo*)(respAuthListIter->data);
                                if (authInfo != NULL) {
@@ -283,7 +277,6 @@ RoamingUtil::composeAuthGetInfoResponce(std::vector<GetAuthInfoResp*> *infoList)
 
        /*B64 encode*/
        return b64Encode(getinfoRespBuff->data, getinfoRespBuff->len);
-
 }
 
 char *
old mode 100644 (file)
new mode 100755 (executable)
index 2eeefb9..590c96b
@@ -44,8 +44,7 @@ typedef enum {
 } StringProperty;
 
 class IStorageParcel {
-
-public:
+public :
 
        IStorageParcel(void){}
        virtual ~IStorageParcel(void){}
@@ -59,8 +58,7 @@ public:
        virtual std::string getDBName(void) = 0;
 };
 
-class AsmStorageParcel : public IStorageParcel {
-
+class AsmStorageParcel:public IStorageParcel {
 public:
 
        AsmStorageParcel(void);
@@ -86,8 +84,7 @@ private:
        std::string __dbName;
 };
 
-class AuthStorageParcel : public IStorageParcel {
-
+class AuthStorageParcel:public IStorageParcel {
 public:
 
        AuthStorageParcel(void);
@@ -111,8 +108,7 @@ private:
        std::string __dbName;
 };
 
-class SecretStorageParcel : public IStorageParcel {
-
+class SecretStorageParcel:public IStorageParcel {
 public :
 
        SecretStorageParcel(void);
old mode 100644 (file)
new mode 100755 (executable)
index 64fd052..1bb29a2
@@ -25,7 +25,6 @@
 #include "fido-client-ipc-stub.h"
 
 class ClientListner {
-
 public:
        static ClientListner* getInstance(void);
        int start(void);
old mode 100644 (file)
new mode 100755 (executable)
index 83f9bc2..3ecc236
@@ -28,7 +28,6 @@ class AsmRequest;
 class AsmResponse;
 
 class AsmOp {
-
 public:
        virtual ~AsmOp(void);
        virtual char* execute(void);
old mode 100644 (file)
new mode 100755 (executable)
index 5528b87..74fb403
@@ -21,7 +21,7 @@
 #include "AsmOp.h"
 #include "AsmOpFactory.h"
 
-class AuthenticateOp : public AsmOp {
+class AuthenticateOp:public AsmOp {
 public:
        virtual char* execute(void);
        ~AuthenticateOp(void);
old mode 100644 (file)
new mode 100755 (executable)
index ef97567..b1f37a4
@@ -21,8 +21,7 @@
 #include "AsmOp.h"
 #include "AsmOpFactory.h"
 
-class DeregOp : public AsmOp {
-
+class DeregOp:public AsmOp {
 public:
        ~DeregOp(void);
        virtual char* execute(void);
old mode 100644 (file)
new mode 100755 (executable)
index 60eaef9..fdc62d4
@@ -21,8 +21,7 @@
 #include "AsmOp.h"
 #include "AsmOpFactory.h"
 
-class GetInfoOp : public AsmOp {
-
+class GetInfoOp:public AsmOp {
 public:
        ~GetInfoOp(void);
 
old mode 100644 (file)
new mode 100755 (executable)
index fb48bdc..c5c8433
@@ -22,8 +22,7 @@
 #include "AsmOp.h"
 #include "AsmOpFactory.h"
 
-class GetRegsOp : public AsmOp {
-
+class GetRegsOp:public AsmOp {
 public:
        ~GetRegsOp(void);
        virtual char* execute(void);
old mode 100644 (file)
new mode 100755 (executable)
index 73029df..65669a1
@@ -21,8 +21,7 @@
 #include "AsmOp.h"
 #include "AsmOpFactory.h"
 
-class OpenSettingOp : public AsmOp {
-
+class OpenSettingOp:public AsmOp {
 public:
        ~OpenSettingOp(void);
        virtual char* execute(void);
old mode 100644 (file)
new mode 100755 (executable)
index 1028c59..0486c1c
@@ -22,7 +22,7 @@
 #include "AsmOpFactory.h"
 #include <vector>
 
-class RegisterOp : public AsmOp {
+class RegisterOp:public AsmOp {
 
 public:
        ~RegisterOp(void);
@@ -33,8 +33,6 @@ private:
 
        int initStates(void);
        friend class AsmOpFactory;
-
-
 };
 
 
old mode 100644 (file)
new mode 100755 (executable)
index 9dddba6..b1f5f0b
@@ -30,10 +30,4 @@ AsmOp::AsmOp(void)
        __authStub = NULL;
 }
 
-AsmOp::~AsmOp(void)
-{
-
-}
-
-
-
+AsmOp::~AsmOp(void) {}
old mode 100644 (file)
new mode 100755 (executable)
index ac2a13f..8964421
@@ -64,12 +64,11 @@ AsmOpFactory::createOperation(AsmRequest *req)
        else
                return NULL;
 
-       if(op != NULL)
+       if (op != NULL)
                _INFO("op successfully created");
 
        /*GetInfo does not need stub, because it needs to communicate with all*/
        if (strcmp(req->getRequesttype().c_str(), STRING_OP_TYPE_GET_INFO) != 0) {
-
                op->__authStub = NULL;
                int mappedIndex = -1;
                if (req->getCustomRequest() == NULL) {
old mode 100644 (file)
new mode 100755 (executable)
index 30e095f..bf176c6
@@ -73,9 +73,7 @@ GetInfoOp::execute(void)
                                if (getInfo != NULL) {
                                        GList *aListOfStub = getInfo->authList;
                                        if (aListOfStub != NULL) {
-
                                                while (aListOfStub != NULL) {
-
                                                        AuthenticatorInfo *authInfo = (AuthenticatorInfo*)(aListOfStub->data);
 
                                                        //std::string devIdStr(authInfo->__devId);
@@ -107,7 +105,6 @@ GetInfoOp::execute(void)
                        if ((stubMapR != NULL) && (stubMapR->size() > 0)) {
                                AuthManager::getInstance()->setAuthStubCache(AUTH_TYPE_ROAMING, stubMapR);
                        }
-
                }
 
                _INFO("Cache done");
@@ -136,9 +133,7 @@ GetInfoOp::execute(void)
                        }
                        GList *aListOfStub = getInfo->authList;
                        if (aListOfStub != NULL) {
-
                                while (aListOfStub != NULL) {
-
                                        AuthenticatorInfo *authInfo = (AuthenticatorInfo*)(aListOfStub->data);
 
 //                                     std::string devIdStr(authInfo->__devId);
index 604402d..a079bf4 100755 (executable)
@@ -94,11 +94,11 @@ SecretStorageParcel::SecretStorageParcel(void)
 int
 AsmStorageParcel::getInt(IntProperty prop, int *val)
 {
-       if(prop == INT_PROP_ID) {
+       if (prop == INT_PROP_ID) {
                *val = __id;
                return SQLITE_OK;
        }
-       if(prop == INT_PROP_AUTH_IDX) {
+       if (prop == INT_PROP_AUTH_IDX) {
                *val =  __authIdx;
                return SQLITE_OK;
        }
@@ -109,11 +109,11 @@ AsmStorageParcel::getInt(IntProperty prop, int *val)
 int
 AsmStorageParcel::setInt(IntProperty prop, int val)
 {
-       if(prop == INT_PROP_ID) {
+       if (prop == INT_PROP_ID) {
                __id = val;
                return SQLITE_OK;
        }
-       if(prop == INT_PROP_AUTH_IDX) {
+       if (prop == INT_PROP_AUTH_IDX) {
                __authIdx = val;
                return SQLITE_OK;
        }
@@ -124,23 +124,23 @@ AsmStorageParcel::setInt(IntProperty prop, int val)
 int
 AsmStorageParcel::getString(StringProperty prop, char **val)
 {
-       if(prop == STR_PROP_CALLER_ID) {
+       if (prop == STR_PROP_CALLER_ID) {
           *val =  strdup(__callerId.c_str());
           return SQLITE_OK;
        }
-       if(prop == STR_PROP_APP_ID) {
+       if (prop == STR_PROP_APP_ID) {
                *val = strdup(__appId.c_str());
                return SQLITE_OK;
        }
-       if(prop == STR_PROP_KEY_HANDLE) {
+       if (prop == STR_PROP_KEY_HANDLE) {
                *val = strdup(__keyHandle.c_str());
                return SQLITE_OK;
        }
-       if(prop == STR_PROP_KEY_ID) {
+       if (prop == STR_PROP_KEY_ID) {
                *val = strdup(__keyId.c_str());
                return SQLITE_OK;
        }
-       if(prop == STR_PROP_TIME) {
+       if (prop == STR_PROP_TIME) {
                *val = strdup(__ts.c_str());
                return SQLITE_OK;
        }
@@ -151,23 +151,23 @@ AsmStorageParcel::getString(StringProperty prop, char **val)
 int
 AsmStorageParcel::setString(StringProperty prop, const  std::string& val)
 {
-       if(prop == STR_PROP_CALLER_ID) {
+       if (prop == STR_PROP_CALLER_ID) {
                __callerId = val;
                return SQLITE_OK;
        }
-       if(prop == STR_PROP_APP_ID) {
+       if (prop == STR_PROP_APP_ID) {
                __appId = val;
                return SQLITE_OK;
        }
-       if(prop == STR_PROP_KEY_HANDLE) {
+       if (prop == STR_PROP_KEY_HANDLE) {
                __keyHandle = val;
                return SQLITE_OK;
        }
-       if(prop == STR_PROP_KEY_ID) {
+       if (prop == STR_PROP_KEY_ID) {
                __keyId = val;
                return SQLITE_OK;
        }
-       if(prop == STR_PROP_TIME) {
+       if (prop == STR_PROP_TIME) {
                __ts = val;
                return SQLITE_OK;
        }
@@ -184,12 +184,12 @@ AsmStorageParcel::getDBName(void)
 int
 AuthStorageParcel::getInt(IntProperty prop, int *val)
 {
-       if(prop == INT_PROP_AUTH_ID) {
+       if (prop == INT_PROP_AUTH_ID) {
                *val = __authIndex;
                return SQLITE_OK;
        }
 
-       if(prop == INT_PROP_MAPPED_AUTH_ID) {
+       if (prop == INT_PROP_MAPPED_AUTH_ID) {
                *val = __mappedIndex;
                return SQLITE_OK;
        }
@@ -200,12 +200,12 @@ AuthStorageParcel::getInt(IntProperty prop, int *val)
 int
 AuthStorageParcel::setInt(IntProperty prop, int val)
 {
-       if(prop == INT_PROP_AUTH_ID) {
+       if (prop == INT_PROP_AUTH_ID) {
                __authIndex = val;
                return SQLITE_OK;
        }
 
-       if(prop == INT_PROP_MAPPED_AUTH_ID) {
+       if (prop == INT_PROP_MAPPED_AUTH_ID) {
                __mappedIndex = val;
                return SQLITE_OK;
        }
@@ -216,7 +216,7 @@ AuthStorageParcel::setInt(IntProperty prop, int val)
 int
 AuthStorageParcel::getString(StringProperty prop, char **val)
 {
-       if(prop == STR_PROP_DEV_ID) {
+       if (prop == STR_PROP_DEV_ID) {
                if (__devId == "" || __devId.empty() == true)
                        return SQLITE_ERROR;
 
@@ -224,7 +224,7 @@ AuthStorageParcel::getString(StringProperty prop, char **val)
                return SQLITE_OK;
        }
 
-       if(prop == STR_PROP_AAID) {
+       if (prop == STR_PROP_AAID) {
                if (__aaid == "" || __aaid.empty() == true)
                        return SQLITE_ERROR;
 
@@ -238,12 +238,12 @@ AuthStorageParcel::getString(StringProperty prop, char **val)
 int
 AuthStorageParcel::setString(StringProperty prop, const std::string& val)
 {
-       if(prop == STR_PROP_DEV_ID) {
+       if (prop == STR_PROP_DEV_ID) {
                __devId = val;
                return SQLITE_OK;
        }
 
-       if(prop == STR_PROP_AAID) {
+       if (prop == STR_PROP_AAID) {
                __aaid = val;
                return SQLITE_OK;
        }
@@ -260,7 +260,7 @@ AuthStorageParcel::getDBName(void)
 int
 SecretStorageParcel::setInt(IntProperty prop, int val)
 {
-       if(prop == INT_PROP_UID) {
+       if (prop == INT_PROP_UID) {
                __uid = val;
                return SQLITE_OK;
        }
@@ -271,7 +271,7 @@ SecretStorageParcel::setInt(IntProperty prop, int val)
 int
 SecretStorageParcel::getInt(IntProperty prop, int *val)
 {
-       if(prop == INT_PROP_UID) {
+       if (prop == INT_PROP_UID) {
                *val = __uid;
                return SQLITE_OK;
        }
@@ -282,22 +282,22 @@ SecretStorageParcel::getInt(IntProperty prop, int *val)
 int
 SecretStorageParcel::setString(StringProperty prop, const std::string &val)
 {
-       if(prop == STR_PROP_AAID) {
+       if (prop == STR_PROP_AAID) {
                __aaid = val;
                return SQLITE_OK;
        }
 
-       if(prop == STR_PROP_DEV_ID) {
+       if (prop == STR_PROP_DEV_ID) {
                __devId = val;
                return SQLITE_OK;
        }
 
-       if(prop == STR_PROP_SECRET1) {
+       if (prop == STR_PROP_SECRET1) {
                __secret1 = val;
                return SQLITE_OK;
        }
 
-       if(prop == STR_PROP_SECRET2) {
+       if (prop == STR_PROP_SECRET2) {
                __secret2 = val;
                return SQLITE_OK;
        }
@@ -308,32 +308,32 @@ SecretStorageParcel::setString(StringProperty prop, const std::string &val)
 int
 SecretStorageParcel::getString(StringProperty prop, char **val)
 {
-       if(prop == STR_PROP_AAID) {
-               if(__aaid == "" || __aaid.empty() == true)
+       if (prop == STR_PROP_AAID) {
+               if (__aaid == "" || __aaid.empty() == true)
                        return SQLITE_ERROR;
 
                *val = strdup(__aaid.c_str());
                return SQLITE_OK;
        }
 
-       if(prop == STR_PROP_DEV_ID) {
-               if(__devId == "" || __devId.empty() == true)
+       if (prop == STR_PROP_DEV_ID) {
+               if (__devId == "" || __devId.empty() == true)
                        return SQLITE_ERROR;
 
                *val = strdup(__devId.c_str());
                return SQLITE_OK;
        }
 
-       if(prop == STR_PROP_SECRET1) {
-               if(__secret1 == "" || __secret1.empty() == true)
+       if (prop == STR_PROP_SECRET1) {
+               if (__secret1 == "" || __secret1.empty() == true)
                        return SQLITE_ERROR;
 
                *val = strdup(__secret1.c_str());
                return SQLITE_OK;
        }
 
-       if(prop == STR_PROP_SECRET2) {
-               if(__secret2 == "" || __secret2.empty() == true)
+       if (prop == STR_PROP_SECRET2) {
+               if (__secret2 == "" || __secret2.empty() == true)
                        return SQLITE_ERROR;
 
                *val = strdup(__secret2.c_str());
@@ -357,19 +357,16 @@ AsmStorage::createIfNotExists(const std::string& dbName)
        const char *query = NULL;
        char *dbPath = NALLOC(512, char);
 
-       if(dbName == FIDO_ASM) {
+       if (dbName == FIDO_ASM) {
                query = DB_QUERY_CREATE_TABLE_ASM;
                snprintf(dbPath, 512 - 1, "%s", ASM_DB_PATH);
-       }
-       else if(dbName == FIDO_AUTH) {
+       } else if (dbName == FIDO_AUTH) {
                query = DB_QUERY_CREATE_TABLE_AUTH;
                snprintf(dbPath, 512 - 1, "%s", AUTH_DB_PATH);
-       }
-       else if(dbName == FIDO_SECRET) {
+       } else if (dbName == FIDO_SECRET) {
                query = DB_QUERY_CREATE_TABLE_SECRET;
                snprintf(dbPath, 512 - 1, "%s", SECRET_DB_PATH);
-       }
-       else {
+       } else {
                SAFE_DELETE(dbPath);
                return NULL;
        }
@@ -417,16 +414,13 @@ AsmStorage::openDBHandle(const std::string& dbName)
 {
        _INFO("%s", dbName.c_str());
        char *dbPath = NALLOC(512, char);
-       if(dbName == FIDO_ASM) {
+       if (dbName == FIDO_ASM) {
                snprintf(dbPath, 512 - 1, "%s", ASM_DB_PATH);
-       }
-       else if(dbName == FIDO_AUTH) {
+       } else if (dbName == FIDO_AUTH) {
                snprintf(dbPath, 512 - 1, "%s", AUTH_DB_PATH);
-       }
-       else if(dbName == FIDO_SECRET) {
+       } else if (dbName == FIDO_SECRET) {
                snprintf(dbPath, 512 - 1, "%s", SECRET_DB_PATH);
-       }
-       else {
+       } else {
                SAFE_DELETE(dbPath);
                return NULL;
        }
@@ -504,25 +498,22 @@ AsmStorage::insertData(IStorageParcel *parcel)
 
                const std::string& ts = currentTime;
 
-               if(authIdx == -1 || callerId == "" || appId == "" ||keyId == "" ||ts == "") {
+               if (authIdx == -1 || callerId == "" || appId == "" ||keyId == "" ||ts == "") {
                        _ERR("One or more fields of the Asm parcel are not set properly");
                        closeDBHandle(dbHandle);
                        return SQLITE_ERROR;
                }
 
-               if(keyHandle.empty() == true) {
+               if (keyHandle.empty() == true) {
                        snprintf(query, BUFFLEN, "INSERT INTO ASMKEYS(auth_idx, caller_id, app_id, key_id, time_stamp) "
                                "VALUES (%d, \'%s\', \'%s\', \'%s\', \'%s\');",
                                authIdx, callerId.c_str(), appId.c_str(), keyId.c_str(), ts.c_str());
-               }
-               else {
+               } else {
                        snprintf(query, BUFFLEN, "INSERT INTO ASMKEYS(auth_idx, caller_id, app_id, key_handle, key_id, time_stamp) "
                                "VALUES (%d, \'%s\', \'%s\', \'%s\', \'%s\', \'%s\');",
                                authIdx, callerId.c_str(), appId.c_str(), keyHandle.c_str(), keyId.c_str(), ts.c_str());
                }
-       }
-
-       else if(dbName == FIDO_AUTH) {
+       } else if (dbName == FIDO_AUTH) {
                /*Device Id, AAID, AuthIndex taken from input*/
                /*MappedIndex is auto-incremented*/
 
@@ -549,7 +540,7 @@ AsmStorage::insertData(IStorageParcel *parcel)
                parcel->getString(STR_PROP_DEV_ID, &devId);
                parcel->getString(STR_PROP_AAID, &aaid);
 
-               if((devId == NULL) || (aaid == NULL) || (authIndex < 0)) {
+               if ((devId == NULL) || (aaid == NULL) || (authIndex < 0)) {
                        _ERR("One or more fields of the Auth parcel are not set properly");
                        _INFO("[%s][%s][%d]", devId, aaid, authIndex);
                        closeDBHandle(dbHandle);
@@ -563,9 +554,7 @@ AsmStorage::insertData(IStorageParcel *parcel)
                                 "INSERT INTO AUTHLIST(auth_index, device_id, aaid, mapped_index) VALUES (%d, \'%s\', \'%s\', %d);",
                                 authIndex, devId, aaid, mappedIndex);
                _INFO("%s", query);
-       }
-
-       else if(dbName == FIDO_SECRET) {
+       } else if (dbName == FIDO_SECRET) {
                int uid = -1;
                char *aaid = NULL;
                char *devId = NULL;
@@ -578,18 +567,17 @@ AsmStorage::insertData(IStorageParcel *parcel)
                parcel->getString(STR_PROP_SECRET1, &secret1);
                parcel->getString(STR_PROP_SECRET2, &secret2);
 
-               if(uid == -1 || aaid == NULL || devId == NULL || secret1 == NULL) {
+               if (uid == -1 || aaid == NULL || devId == NULL || secret1 == NULL) {
                        _ERR("One or more fields of the Secret parcel are not set properly");
                        closeDBHandle(dbHandle);
                        return SQLITE_ERROR;
                }
 
-               if(secret2 == NULL) {
+               if (secret2 == NULL) {
                        snprintf(query, BUFFLEN,
                                         "INSERT INTO SECRET(aaid, device_id, uid, secret_1) VALUES (\'%s\', \'%s\', %d, \'%s\');",
                                         aaid, devId, uid, secret1);
-               }
-               else {
+               } else {
                        snprintf(query, BUFFLEN,
                                         "INSERT INTO SECRET(aaid, device_id, uid, secret_1, secret_2) VALUES (\'%s\', \'%s\', %d, \'%s\', \'%s\');",
                                         aaid, devId, uid, secret1, secret2);
@@ -621,10 +609,9 @@ AsmStorage::insertBulkData(std::vector<IStorageParcel *> *parcel)
 
        for(std::vector<IStorageParcel*>::iterator it = parcel->begin(); it != parcel->end(); it++) {
                ret = insertData(*it);
-               if(ret != SQLITE_OK) {
+               if (ret != SQLITE_OK) {
                        _INFO("%d th Record not inserted/already exists", i+1);
-               }
-               else {
+               } else {
                        _INFO("%d th Record inserted successfully", i+1);
                }
                i++;
@@ -662,58 +649,55 @@ AsmStorage::searchItemCb(void *data, int argc, char **argv, char **azCollName)
        int itr = 0;
        const char *empty = "";
 
-       if(dbName == FIDO_ASM) {
+       if (dbName == FIDO_ASM) {
                IStorageParcel *parcel = new AsmStorageParcel();
 
-               if(itr < argc) {
-                       if(argv[itr] == NULL)
+               if (itr < argc) {
+                       if (argv[itr] == NULL)
                                argv[itr] = (char*)empty;
                        parcel->setInt(INT_PROP_ID, atoi(argv[0]));
                }
                itr++;
-               if(itr < argc) {
-                       if(argv[itr] == NULL)
+               if (itr < argc) {
+                       if (argv[itr] == NULL)
                                argv[itr] = (char*)empty;
                        parcel->setInt(INT_PROP_AUTH_IDX, atoi(argv[1]));
                }
                itr++;
-               if(itr < argc) {
-                       if(argv[itr] == NULL)
+               if (itr < argc) {
+                       if (argv[itr] == NULL)
                                argv[itr] = (char*)empty;
                        parcel->setString(STR_PROP_CALLER_ID, argv[2]);
                }
                itr++;
-               if(itr < argc) {
-                       if(argv[itr] == NULL)
+               if (itr < argc) {
+                       if (argv[itr] == NULL)
                                argv[itr] = (char*)empty;
                        parcel->setString(STR_PROP_APP_ID, argv[3]);
                }
                itr++;
-               if(itr < argc) {
-                       if(argv[itr] == NULL)
+               if (itr < argc) {
+                       if (argv[itr] == NULL)
                                argv[itr] = (char*)empty;
                        parcel->setString(STR_PROP_KEY_HANDLE, argv[4]);
                }
                itr++;
-               if(itr < argc) {
-                       if(argv[itr] == NULL)
+               if (itr < argc) {
+                       if (argv[itr] == NULL)
                                argv[itr] = (char*)empty;
                        parcel->setString(STR_PROP_KEY_ID, argv[5]);
                        _INFO("AsmStorage::searchItemCb:: key_id = [%s]", argv[5]);
                }
                itr++;
-               if(itr < argc) {
-                       if(argv[itr] == NULL)
+               if (itr < argc) {
+                       if (argv[itr] == NULL)
                                argv[itr] = (char*)empty;
                        parcel->setString(STR_PROP_TIME, argv[6]);
                }
 
                cbData->resList->push_back(parcel);
                return SQLITE_OK;
-
-       }
-
-       else if(dbName == FIDO_AUTH) {
+       } else if (dbName == FIDO_AUTH) {
                IStorageParcel *parcel = new AuthStorageParcel();
 
                if ((argc >= 1) && (argv[1] != NULL))
@@ -730,48 +714,46 @@ AsmStorage::searchItemCb(void *data, int argc, char **argv, char **azCollName)
 
                cbData->resList->push_back(parcel);
                return SQLITE_OK;
-       }
-
-       else if(dbName == FIDO_SECRET) {
+       } else if (dbName == FIDO_SECRET) {
                IStorageParcel *parcel = new SecretStorageParcel();
 
-               if(itr < argc) {
-                       if(argv[itr] == NULL)
+               if (itr < argc) {
+                       if (argv[itr] == NULL)
                                argv[itr] = (char*)empty;
                        parcel->setInt(INT_PROP_ID, atoi(argv[0]));
                }
                itr++;
 
-               if(itr < argc) {
-                       if(argv[itr] == NULL)
+               if (itr < argc) {
+                       if (argv[itr] == NULL)
                                argv[itr] = (char*)empty;
                        parcel->setString(STR_PROP_AAID, argv[1]);
                }
                itr++;
 
-               if(itr < argc) {
-                       if(argv[itr] == NULL)
+               if (itr < argc) {
+                       if (argv[itr] == NULL)
                                argv[itr] = (char*)empty;
                        parcel->setString(STR_PROP_DEV_ID, argv[2]);
                }
                itr++;
 
-               if(itr < argc) {
-                       if(argv[itr] == NULL)
+               if (itr < argc) {
+                       if (argv[itr] == NULL)
                                argv[itr] = (char*)empty;
                        parcel->setInt(INT_PROP_UID, atoi(argv[3]));
                }
                itr++;
 
-               if(itr < argc) {
-                       if(argv[itr] == NULL)
+               if (itr < argc) {
+                       if (argv[itr] == NULL)
                                argv[itr] = (char*)empty;
                        parcel->setString(STR_PROP_SECRET1, argv[4]);
                }
                itr++;
 
-               if(itr < argc) {
-                       if(argv[itr] == NULL)
+               if (itr < argc) {
+                       if (argv[itr] == NULL)
                                argv[itr] = (char*)empty;
                        parcel->setString(STR_PROP_SECRET2, argv[5]);
                }
@@ -804,7 +786,7 @@ AsmStorage::searchData(IStorageParcel *parcel)
 
        SearchCbData cbData;
 
-       if(dbName == FIDO_ASM) {
+       if (dbName == FIDO_ASM) {
                int id = -1;
                int authIdx = -1;
 
@@ -824,61 +806,56 @@ AsmStorage::searchData(IStorageParcel *parcel)
                snprintf(query, BUFFLEN, "SELECT * FROM ASMKEYS WHERE ");
                bool isAnd = false;
 
-               if(id != -1) {
+               if (id != -1) {
                                snprintf(q, BUFFLEN, "id=%d", id);
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
                }
-               if(authIdx != -1) {
-                       if(isAnd == true) {
+               if (authIdx != -1) {
+                       if (isAnd == true) {
                                snprintf(q, BUFFLEN, " AND auth_idx=%d", authIdx);
                                strncat(query, q, sizeof(query)-strlen(query)-1);
-                       }
-                       else {
+                       } else {
                                snprintf(q, BUFFLEN, "auth_idx=%d", authIdx);
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
                        }
                }
-               if(callerId != "") {
-                       if(isAnd == true) {
+               if (callerId != "") {
+                       if (isAnd == true) {
                                snprintf(q, BUFFLEN, " AND caller_id=\'%s\'", callerId.c_str());
                                strncat(query, q, sizeof(query)-strlen(query)-1);
-                       }
-                       else {
+                       } else {
                                snprintf(q, BUFFLEN, "caller_id=\'%s\'", callerId.c_str());
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
                        }
                }
-               if(appId != "") {
-                       if(isAnd == true) {
+               if (appId != "") {
+                       if (isAnd == true) {
                                snprintf(q, BUFFLEN, " AND app_id=\'%s\'", appId.c_str());
                                strncat(query, q, sizeof(query)-strlen(query)-1);
-                       }
-                       else {
+                       } else {
                                snprintf(q, BUFFLEN, "app_id=\'%s\'", appId.c_str());
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
                        }
                }
-               if(keyHandle != "") {
-                       if(isAnd == true) {
+               if (keyHandle != "") {
+                       if (isAnd == true) {
                                snprintf(q, BUFFLEN, " AND key_handle=\'%s\'", keyHandle.c_str());
                                strncat(query, q, sizeof(query)-strlen(query)-1);
-                       }
-                       else {
+                       } else {
                                snprintf(q, BUFFLEN, "key_handle=\'%s\'", keyHandle.c_str());
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
                        }
                }
-               if(keyId != "") {
-                       if(isAnd == true) {
+               if (keyId != "") {
+                       if (isAnd == true) {
                                snprintf(q, BUFFLEN, " AND key_id=\'%s\'", keyId.c_str());
                                strncat(query, q, sizeof(query)-strlen(query)-1);
-                       }
-                       else {
+                       } else {
                                snprintf(q, BUFFLEN, "key_id=\'%s\'", keyId.c_str());
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
@@ -887,9 +864,7 @@ AsmStorage::searchData(IStorageParcel *parcel)
 
                snprintf(q, BUFFLEN, ";");
                strncat(query, q, sizeof(query)-strlen(query)-1);
-       }
-
-       else if(dbName == FIDO_AUTH) {
+       } else if (dbName == FIDO_AUTH) {
                int authIndex = -1;
                int mappedIndex = -1;
                char *devId = NULL;
@@ -905,41 +880,38 @@ AsmStorage::searchData(IStorageParcel *parcel)
                snprintf(query, BUFFLEN, "SELECT * FROM AUTHLIST WHERE ");
                bool isAnd = false;
 
-               if(authIndex != -1) {
+               if (authIndex != -1) {
                        snprintf(q, BUFFLEN, "auth_index=%d", authIndex);
                        strncat(query, q, sizeof(query) - strlen(query)-1);
                        isAnd = true;
                }
-               if(mappedIndex != -1) {
-                       if(isAnd == true) {
+               if (mappedIndex != -1) {
+                       if (isAnd == true) {
                                snprintf(q, BUFFLEN, " AND mapped_index=%d", mappedIndex);
                                strncat(query, q, sizeof(query) - strlen(query)-1);
-                       }
-                       else {
+                       } else {
                                snprintf(q, BUFFLEN, "mapped_index=%d", mappedIndex);
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
                        }
                }
 
-               if(devId != NULL) {
-                       if(isAnd == true) {
+               if (devId != NULL) {
+                       if (isAnd == true) {
                                snprintf(q, BUFFLEN, " AND device_id=\'%s\'", devId);
                                strncat(query, q, sizeof(query) - strlen(query)-1);
-                       }
-                       else {
+                       } else {
                                snprintf(q, BUFFLEN, "device_id=\'%s\'", devId);
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
                        }
                }
 
-               if(aaid != NULL) {
-                       if(isAnd == true) {
+               if (aaid != NULL) {
+                       if (isAnd == true) {
                                snprintf(q, BUFFLEN, " AND aaid=\'%s\'", aaid);
                                strncat(query, q, sizeof(query) - strlen(query)-1);
-                       }
-                       else {
+                       } else {
                                snprintf(q, BUFFLEN, "aaid=\'%s\'", aaid);
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
@@ -948,9 +920,7 @@ AsmStorage::searchData(IStorageParcel *parcel)
 
                snprintf(q, BUFFLEN, ";");
                strncat(query, q, sizeof(query) - strlen(query) - 1);
-       }
-
-       else if(dbName == FIDO_SECRET) {
+       } else if (dbName == FIDO_SECRET) {
                int uid = -1;
                char *aaid = NULL;
                char *devId = NULL;
@@ -963,59 +933,55 @@ AsmStorage::searchData(IStorageParcel *parcel)
                parcel->getString(STR_PROP_SECRET1, &secret1);
                parcel->getString(STR_PROP_SECRET2, &secret2);
 
-               _INFO("[%d][%s][%s][%s][%s]", uid, aaid, devId, secret1,secret2);
+               _INFO("[%d][%s][%s][%s][%s]", uid, aaid, devId, secret1, secret2);
 
                snprintf(query, BUFFLEN, "SELECT * FROM SECRET WHERE ");
                bool isAnd = false;
 
-               if(uid != -1) {
+               if (uid != -1) {
                        snprintf(q, BUFFLEN, "uid=%d", uid);
                        strncat(query, q, sizeof(query)-strlen(query)-1);
                        isAnd = true;
                }
 
-               if(aaid != NULL) {
-                       if(isAnd == true) {
+               if (aaid != NULL) {
+                       if (isAnd == true) {
                                snprintf(q, BUFFLEN, " AND aaid=\'%s\'", aaid);
                                strncat(query, q, sizeof(query)-strlen(query)-1);
-                       }
-                       else {
+                       } else {
                                snprintf(q, BUFFLEN, "aaid=\'%s\'", aaid);
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
                        }
                }
 
-               if(devId != NULL) {
-                       if(isAnd == true) {
+               if (devId != NULL) {
+                       if (isAnd == true) {
                                snprintf(q, BUFFLEN, " AND device_id=\'%s\'", devId);
                                strncat(query, q, sizeof(query)-strlen(query)-1);
-                       }
-                       else {
+                       } else {
                                snprintf(q, BUFFLEN, "device_id=\'%s\'", devId);
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
                        }
                }
 
-               if(secret1 != NULL) {
-                       if(isAnd == true) {
+               if (secret1 != NULL) {
+                       if (isAnd == true) {
                                snprintf(q, BUFFLEN, " AND secret_1=\'%s\'", secret1);
                                strncat(query, q, sizeof(query)-strlen(query)-1);
-                       }
-                       else {
+                       } else {
                                snprintf(q, BUFFLEN, "secret_1=\'%s\'", secret1);
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
                        }
                }
 
-               if(secret2 != NULL) {
-                       if(isAnd == true) {
+               if (secret2 != NULL) {
+                       if (isAnd == true) {
                                snprintf(q, BUFFLEN, " AND secret_2=\'%s\'", secret2);
                                strncat(query, q, sizeof(query)-strlen(query)-1);
-                       }
-                       else {
+                       } else {
                                snprintf(q, BUFFLEN, "secret_2=\'%s\'", secret2);
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
@@ -1068,7 +1034,7 @@ AsmStorage::deleteData(IStorageParcel *parcel)
        sqlite3* dbHandle = openDBHandle(dbName);
        RET_IF_FAIL(dbHandle != NULL, SQLITE_ERROR);
 
-       if(dbName == FIDO_ASM) {
+       if (dbName == FIDO_ASM) {
                int id = -1;
                int authIdx = -1;
 
@@ -1088,61 +1054,56 @@ AsmStorage::deleteData(IStorageParcel *parcel)
                snprintf(query, BUFFLEN, "DELETE FROM ASMKEYS WHERE ");
                bool isAnd = false;
 
-               if(id != -1) {
+               if (id != -1) {
                                snprintf(q, BUFFLEN, "id=%d", id);
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
                }
-               if(authIdx != -1) {
-                       if(isAnd == true) {
+               if (authIdx != -1) {
+                       if (isAnd == true) {
                                snprintf(q, BUFFLEN, " AND auth_idx=%d", authIdx);
                                strncat(query, q, sizeof(query)-strlen(query)-1);
-                       }
-                       else {
+                       } else {
                                snprintf(q, BUFFLEN, "auth_idx=%d", authIdx);
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
                        }
                }
-               if(callerId != "") {
-                       if(isAnd == true) {
+               if (callerId != "") {
+                       if (isAnd == true) {
                                snprintf(q, BUFFLEN, " AND caller_id=\'%s\'", callerId.c_str());
                                strncat(query, q, sizeof(query)-strlen(query)-1);
-                       }
-                       else {
+                       } else {
                                snprintf(q, BUFFLEN, "caller_id=\'%s\'", callerId.c_str());
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
                        }
                }
-               if(appId != "") {
-                       if(isAnd == true) {
+               if (appId != "") {
+                       if (isAnd == true) {
                                snprintf(q, BUFFLEN, " AND app_id=\'%s\'", appId.c_str());
                                strncat(query, q, sizeof(query)-strlen(query)-1);
-                       }
-                       else {
+                       } else {
                                snprintf(q, BUFFLEN, "app_id=\'%s\'", appId.c_str());
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
                        }
                }
-               if(keyHandle != "") {
-                       if(isAnd == true) {
+               if (keyHandle != "") {
+                       if (isAnd == true) {
                                snprintf(q, BUFFLEN, " AND key_handle=\'%s\'", keyHandle.c_str());
                                strncat(query, q, sizeof(query)-strlen(query)-1);
-                       }
-                       else {
+                       } else {
                                snprintf(q, BUFFLEN, "key_handle=\'%s\'", keyHandle.c_str());
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
                        }
                }
-               if(keyId != "") {
-                       if(isAnd == true) {
+               if (keyId != "") {
+                       if (isAnd == true) {
                                snprintf(q, BUFFLEN, " AND key_id=\'%s\'", keyId.c_str());
                                strncat(query, q, sizeof(query)-strlen(query)-1);
-                       }
-                       else {
+                       } else {
                                snprintf(q, BUFFLEN, "key_id=\'%s\'", keyId.c_str());
                                strncat(query, q, sizeof(query)-strlen(query)-1);
                                isAnd = true;
@@ -1151,9 +1112,7 @@ AsmStorage::deleteData(IStorageParcel *parcel)
 
                snprintf(q, BUFFLEN, ";");
                strncat(query, q, sizeof(query)-strlen(query)-1);
-       }
-
-       else if(dbName == FIDO_AUTH) {
+       } else if (dbName == FIDO_AUTH) {
                _ERR("AUTHLIST does not allow deletion of entries");
                goto CATCH;
        }
@@ -1184,11 +1143,9 @@ AsmStorage::deleteAllData(const std::string& dbName)
        sqlite3* dbHandle = openDBHandle(dbName);
        RET_IF_FAIL(dbHandle != NULL, SQLITE_ERROR);
 
-       if(dbName == FIDO_ASM) {
+       if (dbName == FIDO_ASM) {
                snprintf(query, BUFFLEN, "DELETE FROM ASMKEYS;");
-       }
-
-       else if(dbName == FIDO_AUTH) {
+       } else if (dbName == FIDO_AUTH) {
                snprintf(query, BUFFLEN, "DELETE FROM AUTHLIST;");
        }
 
@@ -1217,30 +1174,14 @@ AsmStorage::AsmStorage(void)
 AsmStorage*
 AsmStorage::getInstance(void)
 {
-       if(__this != NULL) {
+       if (__this != NULL) {
                return __this;
        }
 
        AsmStorage* thisInstance = new AsmStorage();
-       if(thisInstance == NULL) {
+       if (thisInstance == NULL) {
                return NULL;
        }
-
        __this = thisInstance;
-
-       /*int ret = __this->initDb(FIDO_ASM);
-       if(ret == SQLITE_OK) {
-               _INFO("Asm database created Successfully / already exists");
-       }
-
-       ret = __this->initDb(FIDO_AUTH);
-       if(ret == SQLITE_OK) {
-               _INFO("Auth database created Successfully / already exists");
-       }
-
-       ret = __this->initDb(FIDO_SECRET);
-       if(ret == SQLITE_OK) {
-               _INFO("Pin enroll database created Successfully / already exists");
-       }*/
        return __this;
 }
old mode 100644 (file)
new mode 100755 (executable)
index 0b4b564..f20fb25
@@ -56,14 +56,9 @@ ClientListner* ClientListner::__this = NULL;
 
 #define RESP_NEG "{\"statusCode\":1}"
 
-ClientListner::ClientListner(void)
-{
-}
-
-ClientListner::~ClientListner(void)
-{
+ClientListner::ClientListner(void) {}
 
-}
+ClientListner::~ClientListner(void) {}
 
 ClientListner*
 ClientListner::getInstance(void)
@@ -103,8 +98,9 @@ ClientListner::readProc(const char *path, char *buf, int size)
                _ERR("fd read error(%d)\n", fd);
                close(fd);
                return -1;
-       } else
+       } else {
                buf[ret] = 0;
+       }
 
        close(fd);
 
@@ -121,7 +117,7 @@ ClientListner::getCallerId(GDBusMethodInvocation *invocation)
        guint32 upid;
        const gchar *sender = NULL;
 
-       sender = g_dbus_method_invocation_get_sender (invocation);
+       sender = g_dbus_method_invocation_get_sender(invocation);
        if (!sender) {
                _ERR("Failed to get sender");
                return "";
@@ -134,24 +130,24 @@ ClientListner::getCallerId(GDBusMethodInvocation *invocation)
        }
 
        error = NULL;
-       response = g_dbus_connection_call_sync (connection,
+       response = g_dbus_connection_call_sync(connection,
                        _FREEDESKTOP_SERVICE, _FREEDESKTOP_PATH,
                        _FREEDESKTOP_INTERFACE, "GetConnectionUnixProcessID",
-                       g_variant_new ("(s)", sender), ((const GVariantType *) "(u)"),
+                       g_variant_new("(s)", sender), ((const GVariantType *) "(u)"),
                        G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
 
 
        if (response == NULL) {
                _ERR("Failed to get caller id [%s]", error->message);
-               g_error_free (error);
+               g_error_free(error);
                return "";
        }
 
-       g_variant_get (response, "(u)", &upid);
+       g_variant_get(response, "(u)", &upid);
        _INFO("Remote msg-bus peer service=%s pid=%u", sender, upid);
        remote_pid = (pid_t) upid;
 
-       g_variant_unref (response);
+       g_variant_unref(response);
 
        char *app_id = NULL;
        int ret = app_manager_get_app_id(remote_pid, &app_id);
@@ -328,7 +324,6 @@ ClientListner::onAuthUiResponse(Fidoasm *object, GDBusMethodInvocation *invocati
 void
 ClientListner::onBusAcquired(GDBusConnection *connection, const gchar *name, gpointer user_data)
 {
-
        _BEGIN;
 
        GDBusInterfaceSkeleton* interface = NULL;
@@ -358,7 +353,6 @@ ClientListner::onBusAcquired(GDBusConnection *connection, const gchar *name, gpo
                                        G_CALLBACK(ClientListner::onAuthUiResponse), NULL);
 
        _END;
-
 }
 
 void
@@ -366,8 +360,6 @@ ClientListner::onNameAcquired(GDBusConnection *connection,
                                                const gchar *name,
                                                gpointer user_data)
 {
-
-
 }
 
 void
@@ -375,16 +367,15 @@ ClientListner::onNameLost(GDBusConnection *connection,
                                                const gchar *name,
                                                gpointer user_data)
 {
-               exit (1);
+               exit(1);
 }
 
 bool
 ClientListner::initDbus(void)
 {
-
        _BEGIN;
 
-       __ownerId = g_bus_own_name (G_BUS_TYPE_SYSTEM,
+       __ownerId = g_bus_own_name(G_BUS_TYPE_SYSTEM,
                                                         ASM_DBUS_NAME,
                                                         G_BUS_NAME_OWNER_FLAGS_NONE,
                                                         ClientListner::onBusAcquired,
@@ -394,7 +385,7 @@ ClientListner::initDbus(void)
                                                         NULL);
 
 
-       if(__ownerId == 0) {
+       if (__ownerId == 0) {
                        return false;
        }
 
@@ -406,7 +397,7 @@ ClientListner::initDbus(void)
 void
 ClientListner::initialize(void)
 {
-#if !GLIB_CHECK_VERSION(2,35,0)
+#if !GLIB_CHECK_VERSION(2, 35, 0)
        g_type_init();
 #endif
 
old mode 100644 (file)
new mode 100755 (executable)
index f896856..916b4d2
@@ -23,7 +23,7 @@
 #include "AsmAuthRequest.h"
 #include "AuthnrTypes.h"
 
-class AuthenticateState : public IAsmOpState {
+class AuthenticateState:public IAsmOpState {
 public:
        AuthenticateState(void);
        virtual ~AuthenticateState(void);
old mode 100644 (file)
new mode 100755 (executable)
index 0d63527..15fc5c9
@@ -22,7 +22,7 @@
 #include "AsmRegRequest.h"
 #include "AuthnrTypes.h"
 
-class DeregState : public IAsmOpState {
+class DeregState:public IAsmOpState {
 public:
        DeregState(void);
        virtual ~DeregState(void);
old mode 100644 (file)
new mode 100755 (executable)
index 25d5a9e..c978158
@@ -21,7 +21,7 @@
 #include "IAsmOpState.h"
 #include "AsmRegRequest.h"
 
-class EnrollState : public IAsmOpState {
+class EnrollState:public IAsmOpState {
 public:
        EnrollState(void);
        virtual ~EnrollState(void);
old mode 100644 (file)
new mode 100755 (executable)
index f6747f1..ef92a75
@@ -5,7 +5,7 @@
 #include "AsmDeregRequest.h"
 #include "AuthnrTypes.h"
 
-class GetRegsState : public IAsmOpState {
+class GetRegsState:public IAsmOpState {
 public:
        GetRegsState(void);
        virtual ~GetRegsState(void);
old mode 100644 (file)
new mode 100755 (executable)
index 7c9c5c2..45c315f
@@ -21,7 +21,7 @@
 #include "IAsmOpState.h"
 #include "AsmRegRequest.h"
 
-class InitState : public IAsmOpState {
+class InitState:public IAsmOpState {
 public:
        InitState(void);
        virtual ~InitState(void);
old mode 100644 (file)
new mode 100755 (executable)
index 1d57533..18f8513
@@ -23,7 +23,7 @@
 
 class AsmRequest;
 
-class RegisterState : public IAsmOpState {
+class RegisterState:public IAsmOpState {
 public:
        RegisterState(void);
        virtual ~RegisterState();
old mode 100644 (file)
new mode 100755 (executable)
index 1b3b003..73c42b2
@@ -23,7 +23,7 @@
 
 class AsmRequest;
 
-class TCState : public IAsmOpState {
+class TCState:public IAsmOpState {
 public:
        TCState(void);
        virtual ~TCState();
old mode 100644 (file)
new mode 100755 (executable)
index 1f167e9..b7854e4
@@ -21,7 +21,7 @@
 #include "IAsmOpState.h"
 #include "AsmRegRequest.h"
 
-class VerifyState : public IAsmOpState {
+class VerifyState:public IAsmOpState {
 public:
        VerifyState(void);
        virtual ~VerifyState(void);
old mode 100644 (file)
new mode 100755 (executable)
index 22d0176..e164207
 #include "TCUiAdaptor.h"
 #include "AcUiAdaptor.h"
 
-AuthenticateState::AuthenticateState(void)
-{
+AuthenticateState::AuthenticateState(void) {}
 
-}
-
-AuthenticateState::~AuthenticateState()
-{
-
-}
+AuthenticateState::~AuthenticateState() {}
 
 int
 AuthenticateState::selectUsernameKeyHandle(AuthenticateReq *signAuthReq, AuthenticateResp *stubResp)
@@ -66,17 +60,16 @@ AuthenticateState::selectUsernameKeyHandle(AuthenticateReq *signAuthReq, Authent
                bool isFound = false;
                std::vector<std::string>::iterator it = accList.begin();
 
-               for(; it != accList.end(); it++) {
-                       if(strcmp(uKh->userName, (*it).c_str()) == 0) {
+               for (; it != accList.end(); it++) {
+                       if (strcmp(uKh->userName, (*it).c_str()) == 0) {
                                isFound = true;
                                break;
                        }
                }
 
-               if(isFound == true) {
+               if (isFound == true) {
                        ukHmap[uKh->userName] = uKh->kh;
-               }
-               else {
+               } else {
                        std::string usrStr(uKh->userName);
                        accList.push_back(usrStr);
                        char *userName = uKh->userName;
@@ -105,7 +98,7 @@ AuthenticateState::selectUsernameKeyHandle(AuthenticateReq *signAuthReq, Authent
        int uiErr = -1;
        //TODO If accList length is 1, then no need of UI, just select the one based on timestamp.
        std::string acc = uiAd->confirmAccount(appNameStr, accList, &uiErr);
-       if(acc.empty() == true)
+       if (acc.empty() == true)
                return -1;
        */
 
@@ -114,8 +107,8 @@ AuthenticateState::selectUsernameKeyHandle(AuthenticateReq *signAuthReq, Authent
 
        std::map<char*, Buffer*>::iterator it = ukHmap.begin();
        keyHandle = NULL;
-       for(; it != ukHmap.end(); it++) {
-               if(strcmp(it->first, acc.c_str()) == 0)
+       for (; it != ukHmap.end(); it++) {
+               if (strcmp(it->first, acc.c_str()) == 0)
                        keyHandle = it->second;
        }
        signAuthReq->khHList = NULL;
@@ -171,7 +164,6 @@ AuthenticateState::createStubRequestSign(AsmRequest *asmReq, const char *vTok)
        }
 
        if (isBound == false) {
-
                _INFO("To Roaming Authenticator");
                if (asmSignReq->getKeyIds().size() > 0) {
                        std::vector<std::string> kIdList = asmSignReq->getKeyIds();
@@ -181,18 +173,14 @@ AuthenticateState::createStubRequestSign(AsmRequest *asmReq, const char *vTok)
                                signAuthReq->khHList = g_list_append(signAuthReq->khHList, strdup(kIdStr.c_str()));
                        }
                }
-       }
-       else {
-
+       } else {
                _INFO("To Bound Authenticator");
                std::vector<std::string> kIdList = asmSignReq->getKeyIds();
 
-               if(!kIdList.empty()) {
-
+               if (!kIdList.empty()) {
                        std::vector<std::string>::iterator kIdIter = kIdList.begin();
 
                        for (; kIdIter != kIdList.end(); ++kIdIter) {
-
                                std::string kIdStr = *kIdIter;
                                _INFO("AuthenticateState::createStubRequestSign:: key id = [%s]", kIdStr.c_str());
 
@@ -203,30 +191,26 @@ AuthenticateState::createStubRequestSign(AsmRequest *asmReq, const char *vTok)
                                std::vector<IStorageParcel*> *searchRes = AsmStorage::getInstance()->searchData(searchParcel);
 
                                if (searchRes != NULL) {
-
                                        _INFO("AuthenticateState::createStubRequestSign:: Records found in database corresponding to keyId = [%d]", searchRes->size());
                                        std::vector<IStorageParcel*>::iterator searchResIter = searchRes->begin();
 
                                        for (; searchResIter != searchRes->end(); ++searchResIter) {
-
                                                _INFO("AuthenticateState::createStubRequestSign:: inside searchRes loop");
                                                IStorageParcel *parcel = *searchResIter;
                                                char *kh = NULL;
                                                int res = parcel->getString(STR_PROP_KEY_HANDLE, &kh);
 
-                                               if (res == 0)
-                                               {
+                                               if (res == 0) {
                                                        _INFO("AuthenticateState::createStubRequestSign:: Length of b64 encoded keyHandle : [%d]", strlen(kh));
                                                        signAuthReq->khHList = g_list_append(signAuthReq->khHList, kh);
-                                               }
-                                               else
+                                               } else {
                                                        _INFO("AuthenticateState::createStubRequestSign:: AsmStorageParcel::getString FAIL");
+                                               }
                                        }
                                        signAuthReq->khHList = g_list_first(signAuthReq->khHList);
                                }
                        }
-               }
-               else {
+               } else {
                        _INFO("AuthenticateState::createStubRequestSign:: KeyId empty");
                        IStorageParcel *searchParcel = new AsmStorageParcel();
 
@@ -234,12 +218,10 @@ AuthenticateState::createStubRequestSign(AsmRequest *asmReq, const char *vTok)
                        std::vector<IStorageParcel*> *searchRes = AsmStorage::getInstance()->searchData(searchParcel);
 
                        if (searchRes != NULL) {
-
                                _INFO("AuthenticateState::createStubRequestSign::Records found in database corresponding to appId = [%d]", searchRes->size());
                                std::vector<IStorageParcel*>::iterator searchResIter = searchRes->begin();
 
                                for (; searchResIter != searchRes->end(); ++searchResIter) {
-
                                        IStorageParcel *parcel = *searchResIter;
                                        char *kh = NULL;
                                        int res = parcel->getString(STR_PROP_KEY_HANDLE, &kh);
@@ -272,7 +254,7 @@ AuthenticateState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str,
 
        /*Coming from Roaming Agent Service*/
        /*Only Bound Auth allowed*/
-       if(asmReq->getCustomRequest() != NULL) {
+       if (asmReq->getCustomRequest() != NULL) {
                AuthenticateReq *signAuthReq = (AuthenticateReq*)asmReq->getCustomRequest();
                RET_IF_FAIL(signAuthReq != NULL, -1);
 
@@ -287,7 +269,6 @@ AuthenticateState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str,
                        std::vector<IStorageParcel*> *searchRes = AsmStorage::getInstance()->searchData(searchParcel);
 
                        if (searchRes != NULL) {
-
                                int recFound = searchRes->size();
                                _INFO("Records found in database corresponding to appId = [%d]", recFound);
                                if (recFound <= 0) {
@@ -298,7 +279,6 @@ AuthenticateState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str,
                                std::vector<IStorageParcel*>::iterator searchResIter = searchRes->begin();
 
                                for (; searchResIter != searchRes->end(); ++searchResIter) {
-
                                        IStorageParcel *parcel = *searchResIter;
                                        char *kh = NULL;
                                        int res = parcel->getString(STR_PROP_KEY_HANDLE, &kh);
@@ -324,11 +304,9 @@ AuthenticateState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str,
                        GList *recvdKhListIter = g_list_first(signAuthReq->khHList);
 
                        while (recvdKhListIter != NULL) {
-
                                        char *recvKh = (char*)(recvdKhListIter->data);
                                        unsigned char *recvKhDec = AsmCrypto::ToBase64Url((unsigned char*)recvKh, strlen(recvKh));
                                        if (recvKhDec != NULL) {
-
                                                std::string kIdStr((char*)recvKhDec);
                                                SAFE_DELETE(recvKhDec);
                                                searchParcel->setString(STR_PROP_KEY_ID, kIdStr);
@@ -336,7 +314,6 @@ AuthenticateState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str,
 
                                                std::vector<IStorageParcel*> *searchRes = AsmStorage::getInstance()->searchData(searchParcel);
                                                if (searchRes != NULL) {
-
                                                        int recFound = searchRes->size();
                                                        _INFO("Records found in database corresponding to appId = [%d]", recFound);
                                                        if (recFound <= 0) {
@@ -346,7 +323,6 @@ AuthenticateState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str,
                                                        std::vector<IStorageParcel*>::iterator searchResIter = searchRes->begin();
 
                                                        for (; searchResIter != searchRes->end(); ++searchResIter) {
-
                                                                IStorageParcel *parcel = *searchResIter;
                                                                char *kh = NULL;
                                                                int res = parcel->getString(STR_PROP_KEY_HANDLE, &kh);
@@ -379,18 +355,15 @@ AuthenticateState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str,
                                GList *recvdKhListIter = g_list_first(signAuthReq->khHList);
 
                                while (recvdKhListIter != NULL) {
-
                                                char *recvKh = (char*)(recvdKhListIter->data);
                                                /*unsigned char *recvKhDec = AsmCrypto::ToBase64Url((unsigned char*)recvKh, strlen(recvKh));*/
                                                if (recvKh != NULL) {
-
                                                        std::string kIdStr((char*)recvKh);
                                                        searchParcel->setString(STR_PROP_KEY_ID, kIdStr);
                                                        _INFO("search=[%s][%s]", appIdStr.c_str(), kIdStr.c_str());
 
                                                        std::vector<IStorageParcel*> *searchRes = AsmStorage::getInstance()->searchData(searchParcel);
                                                        if (searchRes != NULL) {
-
                                                                int recFound = searchRes->size();
                                                                _INFO("Records found in database corresponding to appId = [%d]", recFound);
                                                                if (recFound <= 0) {
@@ -400,7 +373,6 @@ AuthenticateState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str,
                                                                std::vector<IStorageParcel*>::iterator searchResIter = searchRes->begin();
 
                                                                for (; searchResIter != searchRes->end(); ++searchResIter) {
-
                                                                        IStorageParcel *parcel = *searchResIter;
                                                                        char *kh = NULL;
                                                                        int res = parcel->getString(STR_PROP_KEY_HANDLE, &kh);
@@ -424,14 +396,13 @@ AuthenticateState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str,
                                storedKhList = g_list_first(storedKhList);
                                signAuthReq->khHList = storedKhList;
                                _INFO("Matched khlist count =[%d]", g_list_length(signAuthReq->khHList));
-
                        }
                }
 
                AuthenticateResp *stubResp = stub->processAuthenticate(signAuthReq);
                RET_IF_FAIL(stubResp != NULL, -1);
 
-               if(stubResp->uKhList != NULL) {
+               if (stubResp->uKhList != NULL) {
                        int ret = selectUsernameKeyHandle(signAuthReq, stubResp);
                        RET_IF_FAIL(ret == 0, -1);
 
@@ -444,9 +415,7 @@ AuthenticateState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str,
                if (tlvRespB64 != NULL) {
                        *out = tlvRespB64;
                }
-       }
-       else
-       {
+       } else {
                /*Coming from FIDO Client Service*/
 
                AuthenticateReq *signAuthReq = createStubRequestSign(asmReq, str);
@@ -454,7 +423,6 @@ AuthenticateState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str,
 
                if ((signAuthReq->khHList == NULL) ||
                                (g_list_length(signAuthReq->khHList) <= 0)) {
-
                        if (stub->getType() != AUTH_TYPE_ROAMING) {
                                _ERR("No keys registered");
 
@@ -468,8 +436,8 @@ AuthenticateState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str,
                RET_IF_FAIL(stubResp != NULL, -1);
 
                /* ASM UI call when username-keyHandle list is not NULL*/
-               if(stub->getType() == AUTH_TYPE_BOUND) {
-                       if(stubResp->uKhList != NULL) {
+               if (stub->getType() == AUTH_TYPE_BOUND) {
+                       if (stubResp->uKhList != NULL) {
                                int ret = selectUsernameKeyHandle(signAuthReq, stubResp);
                                RET_IF_FAIL(ret == 0, -1);
                        }
old mode 100644 (file)
new mode 100755 (executable)
index 88ffdd6..674f0c8
 
 #include <stdlib.h>
 
-DeregState::DeregState(void)
-{
-
-}
-
-DeregState::~DeregState(void)
-{
+DeregState::DeregState(void) {}
 
-}
+DeregState::~DeregState(void) {}
 
 int
 DeregState::deleteAsmRecord(char *appId, char *keyId)
@@ -49,10 +43,10 @@ DeregState::deleteAsmRecord(char *appId, char *keyId)
        int setAppId = parcel->setString(STR_PROP_APP_ID, appId);
        int setKeyId = parcel->setString(STR_PROP_KEY_ID, keyId);
 
-       if(setAppId == 0 && setKeyId == 0) {
+       if (setAppId == 0 && setKeyId == 0) {
                int ret = AsmStorage::getInstance()->deleteData(parcel);
 
-               if(ret == SQLITE_ERROR) {
+               if (ret == SQLITE_ERROR) {
                        _INFO("Record Deleted :: FAIL");
                        return -1;
                }
@@ -84,7 +78,7 @@ DeregState::createStubRequestDereg(AsmRequest *asmReq, bool isBound)
        deRegAuthReq->keyId = _SAFE_DUP(asmDeRegReq->getKeyId().c_str());
 
        /*KHAccessToken = Hash(AppId, FIDO Client ID, PersonaId, AsmToken)*/
-       deRegAuthReq->khATok = authStub->hash(AsmCrypto::getKHAccessToken(asmDeRegReq->getAppId(),isBound));
+       deRegAuthReq->khATok = authStub->hash(AsmCrypto::getKHAccessToken(asmDeRegReq->getAppId(), isBound));
 
        return deRegAuthReq;
 }
@@ -97,8 +91,7 @@ DeregState::handle(IAuthStub *authStub, AsmRequest *asmReq, const char *str, cha
 
        /*Coming from Roaming Agent Service*/
        /*Only Bound Auth allowed*/
-       if(asmReq->getCustomRequest() != NULL) {
-
+       if (asmReq->getCustomRequest() != NULL) {
                _INFO("");
                DeregReq *deRegAuthReq = (DeregReq*)asmReq->getCustomRequest();
                if (deRegAuthReq->keyId == NULL) {
@@ -115,7 +108,7 @@ DeregState::handle(IAuthStub *authStub, AsmRequest *asmReq, const char *str, cha
 
                _INFO("About to delete=[%s][%s]", deRegAuthReq->appId, (char*)keyIdEnc);
                int deleteRecord = deleteAsmRecord(deRegAuthReq->appId, (char*)keyIdEnc);
-               if(deleteRecord == -1)
+               if (deleteRecord == -1)
                        return -1;
 
                /*Temp fix: try to delete b64enc keyid too*/
@@ -129,9 +122,7 @@ DeregState::handle(IAuthStub *authStub, AsmRequest *asmReq, const char *str, cha
                if (tlvRespB64 != NULL) {
                        *out = tlvRespB64;
                }
-       }
-       else {
-
+       } else {
                _INFO("");
                /*Coming from FIDO Client Service*/
 
@@ -149,9 +140,8 @@ DeregState::handle(IAuthStub *authStub, AsmRequest *asmReq, const char *str, cha
                        }
                }
 
-               if(authStub->getType() == AUTH_TYPE_BOUND) {
-                       if(isBound == true) {
-
+               if (authStub->getType() == AUTH_TYPE_BOUND) {
+                       if (isBound == true) {
                                _INFO("");
                                std::string appIdStr = asmDeRegReq->getAppId();
                                std::string keyIdStr = asmDeRegReq->getKeyId();
@@ -159,7 +149,7 @@ DeregState::handle(IAuthStub *authStub, AsmRequest *asmReq, const char *str, cha
                                char *appId = strdup(appIdStr.c_str());
                                char *keyId = strdup(keyIdStr.c_str());
                                int deleteRecord = deleteAsmRecord(appId, keyId);
-                               if(deleteRecord == -1)
+                               if (deleteRecord == -1)
                                        return -1;
                        }
                }
old mode 100644 (file)
new mode 100755 (executable)
index 67cad53..faee035
 
 #define uid 5001
 
-EnrollState::EnrollState(void)
-{
+EnrollState::EnrollState(void) {}
 
-}
-
-EnrollState::~EnrollState()
-{
-
-}
+EnrollState::~EnrollState() {}
 
 char *
 EnrollState::composeEnrollRequest(const char *appId, const char *aaid)
@@ -123,7 +117,7 @@ EnrollState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str, char *
                        AsmRegRequest *asmRegReq = (AsmRegRequest*)asmReq->getArgs();
                        appId = asmRegReq->getAppId();
                }
-       } else if(strcmp(reqType.c_str(), STRING_OP_TYPE_AUTH) == 0) {
+       } else if (strcmp(reqType.c_str(), STRING_OP_TYPE_AUTH) == 0) {
                if (asmReq->getCustomRequest() != NULL) {
                        _INFO("Custom req auth");
                        AuthenticateReq *authAuthReq = (AuthenticateReq*)(asmReq->getCustomRequest());
@@ -148,7 +142,6 @@ EnrollState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str, char *
 
        _INFO("Custom req after getInfo");
        if (getAuthInfoResp->authList != NULL) {
-
                _INFO("Iter authlist");
                GList *authListIter = g_list_first(getAuthInfoResp->authList);
                while(authListIter != NULL) {
@@ -188,8 +181,7 @@ EnrollState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str, char *
 
                _INFO("enroll json composed success");
                return stub->enroll(enrollJson);
-       }
-       else {
+       } else {
                _INFO("EnrollState::handle:: User already enrolled");
                if(resultList->size() > 1) {
                        _INFO("EnrollState::handle:: More than one records obtained from Secret Database");
old mode 100644 (file)
new mode 100755 (executable)
index 97b710d..f6f9a96
 
 #include <stdlib.h>
 
-GetRegsState::GetRegsState(void)
-{
-
-}
-
-GetRegsState::~GetRegsState(void)
-{
+GetRegsState::GetRegsState(void) {}
 
-}
+GetRegsState::~GetRegsState(void) {}
 
 
 int
@@ -86,9 +80,7 @@ GetRegsState::handle(IAuthStub *authStub, AsmRequest *asmReq, const char *str, c
                int res = parcel->getString(STR_PROP_APP_ID, &appId);
                int res1 = parcel->getString(STR_PROP_KEY_ID, &kId);
 
-               if ((res == 0) &&
-                               (res1 == 0)) {
-
+               if ((res == 0) && (res1 == 0)) {
                        std::string appIdStr((const char *)appId, strlen(appId));
                        std::string kIdStr((const char *)kId, strlen(kId));
 
@@ -99,8 +91,7 @@ GetRegsState::handle(IAuthStub *authStub, AsmRequest *asmReq, const char *str, c
                                keyIdList = it->second;
                                keyIdList.push_back(kIdStr);
                                it->second = keyIdList;
-                       }
-                       else {
+                       } else {
                                keyIdList.push_back(kIdStr);
                                regMap.insert(std::pair<std::string, std::vector<std::string> >(appIdStr, keyIdList));
                        }
old mode 100644 (file)
new mode 100755 (executable)
index a88af9e..ea65ebb
 
 #include <stdlib.h>
 
-RegisterState::RegisterState(void)
-{
-
-}
-
-RegisterState::~RegisterState()
-{
+RegisterState::RegisterState(void) {}
 
-}
+RegisterState::~RegisterState() {}
 
 RegisterReq*
 RegisterState::createStubRequestRegister(AsmRequest *asmReq, const char *vTok)
@@ -94,7 +88,6 @@ RegisterState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str, char
        /*Coming from Roaming Agent Service*/
        /*Only Bound Auth allowed*/
        if (asmReq->getCustomRequest() != NULL) {
-
                /*Since this is TLV request, so this is expected to have proper AuthIndex*/
                RegisterReq *regAuthReq = (RegisterReq*)(asmReq->getCustomRequest());
                RegisterResp *stubResp = stub->processRegister(regAuthReq);
@@ -168,7 +161,6 @@ RegisterState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str, char
                                _INFO("");
                                AuthenticatorInfo *authInfo = (AuthenticatorInfo*)(authListIter->data);
                                if (authInfo->__isRoamingAuthenticator == false) {
-
                                        IStorageParcel *regParcel = new AsmStorageParcel();
                                        regParcel->setInt(INT_PROP_AUTH_IDX, authInfo->__authenticatorIndex);
 
old mode 100644 (file)
new mode 100755 (executable)
index 008d33e..c076d04
 #include "AsmAuthRequest.h"
 #include "AuthnrTypes.h"
 
-TCState::TCState(void)
-{
-
-}
-
-TCState::~TCState()
-{
+TCState::TCState(void) {}
 
-}
+TCState::~TCState() {}
 
 #define ASM_UI_SUPPORTED_TYPE "text/plain"
 
@@ -72,11 +66,9 @@ TCState::getInfoForUi(AsmRequest *asmReq, std::vector<std::string> **tcList,
 
                *appId = appIdReal;
                return 0;
-
        }
 
        if (asmReq->getCustomRequest() != NULL) {
-
                AuthenticateReq *authAuthReq = (AuthenticateReq*)(asmReq->getCustomRequest());
                RET_IF_FAIL(authAuthReq != NULL, -1);
 
old mode 100644 (file)
new mode 100755 (executable)
index f3a6cbe..8320b85
 /*TODO get Uid of owner*/
 #define uid 5001
 
-VerifyState::VerifyState(void)
-{
-
-}
+VerifyState::VerifyState(void) {}
 
-VerifyState::~VerifyState()
-{
-
-}
+VerifyState::~VerifyState() {}
 
 int
 VerifyState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str, char **out)
@@ -68,7 +62,7 @@ VerifyState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str, char *
                char *fch = NULL;
 
                if (asmReq->getCustomRequest() == NULL) {
-                       if(strcmp(reqType.c_str(), STRING_OP_TYPE_REG) == 0) {
+                       if (strcmp(reqType.c_str(), STRING_OP_TYPE_REG) == 0) {
                                AsmRegRequest *asmRegReq = (AsmRegRequest*)asmReq->getArgs();
                                if (asmRegReq == NULL) {
                                        _ERR("");
@@ -86,8 +80,7 @@ VerifyState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str, char *
                                snprintf(cmd, 128 - 1, "%s", "registration");
 
 
-                       } else if(strcmp(reqType.c_str(), STRING_OP_TYPE_AUTH) == 0) {
-
+                       } else if (strcmp(reqType.c_str(), STRING_OP_TYPE_AUTH) == 0) {
                                AsmAuthRequest *asmAuthReq = (AsmAuthRequest*)asmReq->getArgs();
                                if (asmAuthReq == NULL) {
                                        _ERR("");
@@ -108,7 +101,7 @@ VerifyState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str, char *
 
                } else {
                        _INFO("");
-                       if(strcmp(reqType.c_str(), STRING_OP_TYPE_REG) == 0) {
+                       if (strcmp(reqType.c_str(), STRING_OP_TYPE_REG) == 0) {
                                RegisterReq *regAuthReq = (RegisterReq*)(asmReq->getCustomRequest());
                                if (regAuthReq == NULL) {
                                        _ERR("");
@@ -126,8 +119,7 @@ VerifyState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str, char *
                                cmd = (char*)calloc(128, sizeof(char));
                                snprintf(cmd, 128 - 1, "%s", "registration");
 
-                       } else if(strcmp(reqType.c_str(), STRING_OP_TYPE_AUTH) == 0) {
-
+                       } else if (strcmp(reqType.c_str(), STRING_OP_TYPE_AUTH) == 0) {
                                AuthenticateReq *signAuthReq = (AuthenticateReq*)(asmReq->getCustomRequest());
                                if (signAuthReq == NULL) {
                                        _ERR("");
@@ -145,7 +137,6 @@ VerifyState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str, char *
                                cmd = (char*)calloc(128, sizeof(char));
                                snprintf(cmd, 128 - 1, "%s", "authentication");
                        }
-
                }
                _INFO("");
                return stub->verify(cmd, fch, out);
@@ -165,7 +156,7 @@ VerifyState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str, char *
 
        int mappedIndex = asmReq->getAuthIndex();
 
-       if(strcmp(reqType.c_str(), STRING_OP_TYPE_REG) == 0) {
+       if (strcmp(reqType.c_str(), STRING_OP_TYPE_REG) == 0) {
                if (asmReq->getCustomRequest() != NULL) {
                        _INFO("Custom req reg");
                        RegisterReq *regAuthReq = (RegisterReq*)(asmReq->getCustomRequest());
@@ -179,7 +170,7 @@ VerifyState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str, char *
                        AsmRegRequest *asmRegReq = (AsmRegRequest*)asmReq->getArgs();
                        appId = asmRegReq->getAppId();
                }
-       } else if(strcmp(reqType.c_str(), STRING_OP_TYPE_AUTH) == 0) {
+       } else if (strcmp(reqType.c_str(), STRING_OP_TYPE_AUTH) == 0) {
                _INFO("Request Type is Authenticate");
                if (asmReq->getCustomRequest() != NULL) {
                        _INFO("Custom auth reg");
@@ -198,11 +189,10 @@ VerifyState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str, char *
                GetAuthInfoResp *getAuthInfoResp = stub->getInfo();
 
                if (getAuthInfoResp->authList != NULL) {
-
                        GList *authListIter = g_list_first(getAuthInfoResp->authList);
                        while(authListIter != NULL) {
                                AuthenticatorInfo *authInfo = (AuthenticatorInfo*)(authListIter->data);
-                               if(authInfo->__authenticatorIndex == mappedIndex) {
+                               if (authInfo->__authenticatorIndex == mappedIndex) {
                                        aaid = authInfo->__aaid;
                                        break;
                                }
@@ -217,23 +207,22 @@ VerifyState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str, char *
                /*TODO: Verif token searching on DB must be done via Auth plugin*/
                IStorageParcel *parcel = new SecretStorageParcel();
                int res = parcel->setString(STR_PROP_AAID, aaid);
-               if(res != 0)
+               if (res != 0)
                        return -1;
                res = parcel->setString(STR_PROP_DEV_ID, AsmCrypto::getDeviceId());
-               if(res != 0)
+               if (res != 0)
                        return -1;
                res = parcel->setInt(INT_PROP_UID, uid);
-               if(res != 0)
+               if (res != 0)
                        return -1;
 
                std::vector<IStorageParcel*> *resultList = AsmStorage::getInstance()->searchData(parcel);
                if ((resultList == NULL) || (resultList->size() == 0)) {
                        _ERR("VerifyState::handle:: User not registerd");
                        return -1;
-               }
-               else {
+               } else {
                        _INFO("VerifyState::handle:: User is registerd");
-                       if(resultList->size() > 1) {
+                       if (resultList->size() > 1) {
                                _INFO("VerifyState::handle:: More than one records obtained from Secret Database");
                                return -1;
                        }
@@ -245,8 +234,7 @@ VerifyState::handle(IAuthStub *stub, AsmRequest *asmReq, const char *str, char *
 
                        *out = vToken;
                }
-       }
-       else {
+       } else {
                return -1;
        }
 
index b454eb2..9336f4e 100755 (executable)
@@ -114,7 +114,7 @@ __init_json_object(JsonGenerator **generator, JsonObject **root_obj)
        JsonNode *root_node = NULL;
 
        *generator = json_generator_new();
-       if(*generator == NULL) {
+       if (*generator == NULL) {
                _INFO("json_generator_new is NULL");
                goto CATCH;
        }
@@ -126,7 +126,7 @@ __init_json_object(JsonGenerator **generator, JsonObject **root_obj)
        }
 
        *root_obj = json_object_new();
-       if(*root_obj == NULL) {
+       if (*root_obj == NULL) {
                _INFO("json_object_new is NULL");
                goto CATCH;
        }
@@ -170,7 +170,6 @@ __print_big_string(const char *str)
                strncpy(sub_str, str + i, chunk_size);
                _INFO("log : [%s]", sub_str);
        }
-
 }
 
 static char *
@@ -240,7 +239,6 @@ __create_raw_key_handle_string(char *khAccToken, const char *pri_key, char *user
        json = json_generator_to_data(generator, &len);
        if (json != NULL) {
                _INFO("%s", json);
-
        }
        return json;
 
@@ -314,8 +312,7 @@ processDeRegister(unsigned char *assert_req)
        int ret = encodableDeReg.setEncoder(EID_UAFV1_DEREG_RESP);
        if (ret == 0) {
                _INFO("setEncoder EID_UAFV1_DEREG_RESP PASS \n");
-       }
-       else {
+       } else {
                _INFO("setEncoder EID_UAFV1_DEREG_RESP FAIL \n");
                return NULL;
        }
@@ -323,8 +320,7 @@ processDeRegister(unsigned char *assert_req)
        getDeRegRespInfoBuff = encodableDeReg.encode();
        if (getDeRegRespInfoBuff != NULL) {
                _INFO("encode EID_UAFV1_DEREG_RESP PASS \n");
-       }
-       else {
+       } else {
                _INFO("encode EID_UAFV1_DEREG_RESP FAIL \n");
                return NULL;
        }
@@ -352,8 +348,7 @@ processAuthenticate(unsigned char *assert_req)
        int ret = encodableAuthReq.setEncoder(EID_UAFV1_SIGN_REQ);
        if (ret == 0) {
                _INFO("setEncoder EID_UAFV1_SIGN_REQ PASS \n");
-       }
-       else {
+       } else {
                _INFO("setEncoder EID_UAFV1_SIGN_REQ FAIL \n");
                SAFE_DELETE(getAuthRespInfo);
                return NULL;
@@ -362,8 +357,7 @@ processAuthenticate(unsigned char *assert_req)
        getAuthReqInfo = encodableAuthReq.decode(assert_req);
        if (getAuthReqInfo != NULL) {
                _INFO("decode EID_UAFV1_SIGN_REQ PASS \n");
-       }
-       else {
+       } else {
                _INFO("decode EID_UAFV1_SIGN_REQ FAIL \n");
                SAFE_DELETE(getAuthRespInfo);
                return NULL;
@@ -378,8 +372,7 @@ processAuthenticate(unsigned char *assert_req)
 
        int khHListSize = g_list_length(getAuthReqInfo->khHList);
 
-       if(khHListSize > 1)     {
-
+       if (khHListSize > 1)    {
                _INFO("Keyhandle size > 1 = [%d]", khHListSize);
 
                /*Copy {Command.KeyHandle, RawKeyHandle.username}*/
@@ -456,7 +449,6 @@ processAuthenticate(unsigned char *assert_req)
                }
 
        } else {
-
                _INFO("processAuthenticate:: Keyhandle size = 1.");
                /*Set Authentication Mode*/
                int authMode = 0x01;
@@ -524,12 +516,12 @@ processAuthenticate(unsigned char *assert_req)
                getAuthRespInfo->authAssertion->sigData->tcHash = ALLOC(Buffer);
 
                /*tcHash when authMode = 0x02 i.e transaction content is not empty*/
-               if(getAuthReqInfo->tc != NULL) {
+               if (getAuthReqInfo->tc != NULL) {
 
                        unsigned char tcHash[32];
                        getAuthRespInfo->authAssertion->sigData->assrtInfo->authMode = 0x02;
                        int ret = AsmCrypto::genHash256(getAuthReqInfo->tc, strlen(getAuthReqInfo->tc), tcHash);
-                       if(ret == false) {
+                       if (ret == false) {
                                _ERR("processAuthenticate:: Failed to create Transaction content hash.");
                                SAFE_DELETE(getAuthRespInfo);
                                SAFE_DELETE(keyId_b64_enc);
@@ -539,9 +531,7 @@ processAuthenticate(unsigned char *assert_req)
                        getAuthRespInfo->authAssertion->sigData->tcHash->len = DIGEST_LEN;
                        getAuthRespInfo->authAssertion->sigData->tcHash->data = NALLOC(DIGEST_LEN, uint8_t);
                        memcpy(getAuthRespInfo->authAssertion->sigData->tcHash->data, tcHash, DIGEST_LEN);
-               }
-               /*authMode = 0x01*/
-               else {
+               } else { /*authMode = 0x01*/
                        getAuthRespInfo->authAssertion->sigData->tcHash->len = 0;
                }
 
@@ -621,8 +611,7 @@ processAuthenticate(unsigned char *assert_req)
                int ret = encodableSigData.setEncoder(EID_UAFV1_SIGN_DATA_RESP);
                if (ret == 0) {
                        _INFO("setEncoder EID_UAFV1_SIGN_DATA_RESP PASS");
-               }
-               else {
+               } else {
                        _INFO("setEncoder EID_UAFV1_SIGN_DATA_RESP FAIL");
                        SAFE_DELETE(getAuthRespInfo);
                        return NULL;
@@ -631,8 +620,7 @@ processAuthenticate(unsigned char *assert_req)
                getSigDataInfoBuff = encodableSigData.encode();
                if (getSigDataInfoBuff != NULL) {
                        _INFO("encode EID_UAFV1_SIGN_DATA_RESP PASS");
-               }
-               else {
+               } else {
                        _INFO("encode EID_UAFV1_SIGN_DATA_RESP FAIL");
                        SAFE_DELETE(getAuthRespInfo);
                        return NULL;
@@ -668,7 +656,6 @@ processAuthenticate(unsigned char *assert_req)
                _ERR("processAuthenticate:: Failed to Get Sign Response");
                SAFE_DELETE(getAuthRespInfo);
                return NULL;
-
        }
 
        if (getAuthReqInfo->khHList != NULL)
@@ -688,8 +675,7 @@ processAuthenticate(unsigned char *assert_req)
        ret = encodableAuthResp.setEncoder(EID_UAFV1_SIGN_RESP);
        if (ret == 0) {
                _INFO("setEncoder EID_UAFV1_SIGN_RESP PASS \n");
-       }
-       else {
+       } else {
                _INFO("setEncoder EID_UAFV1_SIGN_RESP FAIL \n");
                SAFE_DELETE(getAuthRespInfo);
                return NULL;
@@ -698,8 +684,7 @@ processAuthenticate(unsigned char *assert_req)
        getAuthRespInfoBuff = encodableAuthResp.encode();
        if (getAuthRespInfoBuff != NULL) {
                _INFO("encode EID_UAFV1_SIGN_RESP PASS \n");
-       }
-       else {
+       } else {
                _INFO("encode EID_UAFV1_SIGN_RESP FAIL \n");
                SAFE_DELETE(getAuthRespInfo);
                return NULL;
@@ -714,7 +699,6 @@ processAuthenticate(unsigned char *assert_req)
 void *
 processRegister(unsigned char *assert_req)
 {
-
        _INFO("========ProcessRegister start=========");
        OpenSSL_add_all_algorithms();
 
@@ -727,8 +711,7 @@ processRegister(unsigned char *assert_req)
        int ret = encodableRegReq.setEncoder(EID_UAFV1_REGISTER_REQ);
        if (ret == 0) {
                _INFO("setEncoder EID_UAFV1_REGISTER_REQ PASS \n");
-       }
-       else {
+       } else {
                _INFO("setEncoder EID_UAFV1_REGISTER_REQ FAIL \n");
                SAFE_DELETE(getRegRespInfo);
                return NULL;
@@ -737,8 +720,7 @@ processRegister(unsigned char *assert_req)
        getRegReqInfo = encodableRegReq.decode(assert_req);
        if (getRegReqInfo != NULL) {
                _INFO("decode EID_UAFV1_REGISTER_REQ PASS \n");
-       }
-       else {
+       } else {
                _INFO("decode EID_UAFV1_REGISTER_REQ FAIL \n");
                SAFE_DELETE(getRegRespInfo);
                return NULL;
@@ -853,16 +835,14 @@ processRegister(unsigned char *assert_req)
        ret = encodableKrd.setEncoder(EID_UAFV1_REG_ASSERTION_KRD_RESP);
        if (ret == 0) {
                _INFO("setEncoder EID_UAFV1_REG_ASSERTION_KRD_RESP PASS");
-       }
-       else {
+       } else {
                _INFO("setEncoder EID_UAFV1_REG_ASSERTION_KRD_RESP FAIL");
        }
 
        uafv1KrdBuff = encodableKrd.encode();
        if (uafv1KrdBuff != NULL) {
                _INFO("encode EID_UAFV1_REG_ASSERTION_KRD_RESP PASS, length of encoded UAFV1KRD is = [%d]", uafv1KrdBuff->len);
-       }
-       else {
+       } else {
                _ERR("encode EID_UAFV1_REG_ASSERTION_KRD_RESP FAIL");
                SAFE_DELETE(getRegRespInfo);
                return NULL;
@@ -914,8 +894,7 @@ processRegister(unsigned char *assert_req)
        ret = encodableRegResp.setEncoder(EID_UAFV1_REGISTER_RESP);
        if (ret == 0) {
                _INFO("setEncoder EID_UAFV1_REGISTER_RESP PASS \n");
-       }
-       else {
+       } else {
                _INFO("setEncoder EID_UAFV1_REGISTER_RESP FAIL \n");
                SAFE_DELETE(krdStr);
                SAFE_DELETE(getRegRespInfo->kh);
@@ -926,8 +905,7 @@ processRegister(unsigned char *assert_req)
        getRegRespInfoBuff = encodableRegResp.encode();
        if (getRegRespInfoBuff != NULL) {
                _INFO("decode EID_UAFV1_REGISTER_RESP PASS \n");
-       }
-       else {
+       } else {
                _INFO("decode EID_UAFV1_REGISTER_RESP FAIL \n");
                SAFE_DELETE(krdStr);
                SAFE_DELETE(getRegRespInfo);
@@ -1004,8 +982,7 @@ processGetInfo()
        int ret = encodableResp.setEncoder(EID_UAFV1_GETINFO_RESP);
        if (ret == 0) {
                _INFO("setEncoder EID_UAFV1_GETINFO_RESP PASS \n");
-       }
-       else {
+       } else {
                _INFO("setEncoder EID_UAFV1_GETINFO_RESP FAIL \n");
                SAFE_DELETE(authInfo->__aaid);
                SAFE_DELETE(authInfo->__meta);
@@ -1018,8 +995,7 @@ processGetInfo()
        getInfoRespBuff = encodableResp.encode();
        if (getInfoRespBuff != 0) {
                _INFO("encode EID_UAFV1_GETINFO_RESP PASS \n");
-       }
-       else {
+       } else {
                _INFO("encode EID_UAFV1_GETINFO_RESP FAIL \n");
                SAFE_DELETE(authInfo->__aaid);
                SAFE_DELETE(authInfo->__meta);
@@ -1050,31 +1026,30 @@ fido_auth_plugin_fido_command_process_internal(unsigned char *assert_req,
        bool foundMember = false;
 
        switch(root->tag) {
-
        case TAG_UAFV1_GETINFO_CMD:
                getRespBuff = (Buffer*)processGetInfo();
-               if(getRespBuff != NULL)
+               if (getRespBuff != NULL)
                        *assrt_resp = getRespBuff->data;
                foundMember = true;
                break;
 
        case TAG_UAFV1_REGISTER_CMD:
                getRespBuff = (Buffer*)processRegister(assert_req);
-               if(getRespBuff != NULL)
+               if (getRespBuff != NULL)
                        *assrt_resp = getRespBuff->data;
                foundMember = true;
                break;
 
        case TAG_UAFV1_SIGN_CMD:
                getRespBuff = (Buffer*)processAuthenticate(assert_req);
-               if(getRespBuff != NULL)
+               if (getRespBuff != NULL)
                        *assrt_resp = getRespBuff->data;
                foundMember = true;
                break;
 
        case TAG_UAFV1_DEREGISTER_CMD:
                getRespBuff = (Buffer*)processDeRegister(assert_req);
-               if(getRespBuff != NULL)
+               if (getRespBuff != NULL)
                        *assrt_resp = getRespBuff->data;
                foundMember = true;
                break;
@@ -1087,7 +1062,7 @@ fido_auth_plugin_fido_command_process_internal(unsigned char *assert_req,
        SAFE_DELETE(root->val);
        SAFE_DELETE(root);
 
-       if(foundMember == false)
+       if (foundMember == false)
                return -1;
 
        _INFO("fido_auth_plugin_fido_command_process:: end");
@@ -1249,10 +1224,6 @@ fido_auth_plugin_verify(const char *cmd, const char *fch, char **verif_token)
                        char *val_ts_str = NULL;
                        buxton_value_get_string(val_ts, (const char **)&val_ts_str);
                        if (val_ts_str != NULL) {
-                               /*poll_count++;*/
-                               /*if ((poll_count % 50) == 0)
-                                       _INFO("[%s][%s]", val_ts_str, ts_str);*/
-
                                if (strcmp(val_ts_str, ts_str) == 0) {
                                        _INFO("Received matching ts");
                                        buxton_value *val_bool = NULL;
@@ -1265,8 +1236,7 @@ fido_auth_plugin_verify(const char *cmd, const char *fch, char **verif_token)
                                                if (val_verifiy != 0) {
                                                        buxton_free_layer(layer);
                                                        return 0;
-                                               }
-                                               else {
+                                               } else {
                                                        buxton_free_layer(layer);
                                                        return -1;
                                                }
@@ -1289,9 +1259,4 @@ fido_auth_plugin_get_attachment_hint(void)
 {
        return ATTACHMENT_HINT_INTERNAL;
 }
-
 }
-
-/*int fido_auth_plugin_hash(const char *ip, char **op);
-int fido_auth_plugin_confirm_account(GList *acc_list, char **selected_acc);
-int fido_auth_plugin_confirm_tc(const transaction_s *tr);*/
old mode 100644 (file)
new mode 100755 (executable)
index de6e1fc..8915a38
@@ -9,42 +9,42 @@
 #define UTIL_H_
 
 #define RET_IF_FAIL_VOID(cond) do {\
-               if (!(cond)){\
+               if (!(cond)) {\
                        return;\
-               }\
-} while(0)
+               } \
+} while (0)
 
 #define RET_IF_FAIL(cond, err) do {\
-               if (!(cond)){\
+               if (!(cond)) {\
                        return err;\
-               }\
-} while(0)
+               } \
+} while (0)
 
 #define CATCH_IF_FAIL(cond) do {\
-               if (!(cond)){\
+               if (!(cond)) {\
                        goto CATCH;\
-               }\
-} while(0)
+               } \
+} while (0)
 
 #define CATCH_IF_FAIL_X(cond, expr) do {\
-               if (!(cond)){\
+               if (!(cond)) {\
                        expr;\
                        goto CATCH;\
-               }\
-} while(0)
+               } \
+} while (0)
 
 #define GOTO_IF_FAIL(cond, catch_block) do {\
-               if (!(cond)){\
+               if (!(cond)) {\
                        goto catch_block;\
-               }\
-} while(0)
+               } \
+} while (0)
 
 #define SAFE_DELETE(x) do {\
        if (x != NULL) {\
                free(x);    \
                x = NULL;\
-       }\
-} while(0)
+       } \
+} while (0)
 
 #define _SAFE_DUP(x) ((x) ? strdup(x) : NULL)
 
index 5f5ab13..3a2bcb4 100755 (executable)
@@ -261,10 +261,9 @@ __b64url_decode(const unsigned char* in, int inlen,
        memcpy(base64, in, inlen);
 
        int i;
-       for (i = 0; i < inlen; i++)     {
+       for (i = 0; i < inlen; i++) {
                if (base64[i] == '-')
                        base64[i] = '+';
-
                else if (base64[i] == '_')
                        base64[i] = '/';
 
index 3902b26..80f6948 100755 (executable)
@@ -1,6 +1,4 @@
-
 #include "fido_asm_shell_tc_util.h"
-
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -21,7 +19,6 @@
 #include "JsonUtil.h"
 #include "AsmOp.h"
 #include "AsmOpFactory.h"
-
 #include <openssl/bio.h>
 #include <openssl/evp.h>
 #include <openssl/buffer.h>
@@ -32,7 +29,7 @@
                free(x);    \
                x = NULL;\
        }\
-} while(0)
+} while (0)
 
 /* A 256 bit key */
 const unsigned char *key_test = (unsigned char *)"01234567890123456789012345678901";
@@ -46,53 +43,48 @@ int
 b64UrlDecode(const unsigned char *in,  int inlen,
                                                unsigned char *out, int *outlen)
 {
-
        int npadChars = (inlen %4) == 0 ? 0 : (4 - (inlen%4));
        unsigned char *base64 = (unsigned char *) malloc(inlen + npadChars);
-       if(base64 == NULL) {
+       if (base64 == NULL) {
                return -1;
        }
 
        memcpy(base64, in, inlen);
 
        int i;
-       for(i =0; i < inlen ; i++) {
-               if(base64[i] == '-')
+       for (i =0; i < inlen ; i++) {
+               if (base64[i] == '-')
                        base64[i] = '+';
 
-               else if(base64[i] == '_')
+               else if (base64[i] == '_')
                        base64[i] = '/';
-
        }
 
-       if(npadChars != 0)
+       if (npadChars != 0)
                memset(base64 + inlen, '=', npadChars);
 
        BIO * b64 = NULL;
        BIO * bmem = NULL;
        b64 = BIO_new(BIO_f_base64());
-       if(b64 == NULL) {
-
+       if (b64 == NULL) {
                SAFE_DELETE(base64);
                return -1;
        }
        BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
        bmem = BIO_new_mem_buf(base64, inlen);
-       if(bmem == NULL) {
-
+       if (bmem == NULL) {
                SAFE_DELETE(base64);
                return -1;
        }
 
        bmem = BIO_push(b64, bmem);
        *outlen = BIO_read(bmem, out, inlen);
-       if(*outlen <= 0) {
-
+       if (*outlen <= 0) {
                SAFE_DELETE(base64);
                return -1;
        }
 
-       if(bmem)
+       if (bmem)
                BIO_free_all(bmem);
 
        return 0;
@@ -115,7 +107,6 @@ print_hex(Buffer *buffer)
 void
 testTLV_getInfo(void)
 {
-
        //int i = 0;
        printf("==============testTLV GETINFO start============== \n");
 
@@ -139,7 +130,7 @@ testTLV_getInfo(void)
                                auth->__meta->transactionConfirmationDisplay = 0x0000;
                                auth->__meta->authenticationAlg = 0x0001;
 
-                               auth->__tcDispConType = (char*)calloc(1,128);
+                               auth->__tcDispConType = (char*)calloc(1, 128);
                                snprintf(auth->__tcDispConType, 127, "%s", "text/plain");
 
 
@@ -158,7 +149,7 @@ testTLV_getInfo(void)
                                auth->__tcDisplayPNGCharacteristics = g_list_first(tcDispList);
 
 
-                               auth->__assertionScheme = (char*)calloc(1,128);
+                               auth->__assertionScheme = (char*)calloc(1, 128);
                                snprintf(auth->__assertionScheme, 127, "%s", "UAFVITLV");
 
                                GList *attTypes = NULL;
@@ -182,8 +173,7 @@ testTLV_getInfo(void)
        int ret = encodableResp.setEncoder(EID_UAFV1_GETINFO_RESP);
        if (ret == 0) {
                printf("setEncoder EID_UAFV1_GETINFO_RESP PASS \n");
-       }
-       else {
+       } else {
                printf("setEncoder EID_UAFV1_GETINFO_RESP FAIL \n");
                goto ERR;
        }
@@ -193,8 +183,7 @@ testTLV_getInfo(void)
        if (getInfoRespBuff != 0) {
                printf("encode EID_UAFV1_GETINFO_RESP PASS \n");
                print_hex(getInfoRespBuff);
-       }
-       else {
+       } else {
                printf("encode EID_UAFV1_GETINFO_RESP FAIL \n");
                goto ERR;
        }
@@ -204,8 +193,7 @@ testTLV_getInfo(void)
        getInfoResp = encodableResp.decode(getInfoRespBuff->data);
        if (getInfoResp != NULL) {
                printf("decode GetAuthInfoResp value PASS \n");
-       }
-       else {
+       } else {
                printf("decode GetAuthInfoResp value FAIL \n");
                goto ERR;
        }
@@ -224,32 +212,28 @@ testTLV_getInfo(void)
        authinfoList = getInfoResp->authList;
        if (authinfoList != NULL) {
                printf("Non NULL authinfoList value PASS \n");
-       }
-       else {
+       } else {
                printf("Non NULL authinfoList value FAIL \n");
                goto ERR;
        }
        authInfo = (AuthenticatorInfo*)(g_list_first(authinfoList)->data);
        if (authInfo != NULL) {
                printf("Non NULL authInfo value PASS \n");
-       }
-       else {
+       } else {
                printf("Non NULL authInfo value FAIL \n");
                goto ERR;
        }
 
        if (strcmp(authInfo->__aaid, auth->__aaid) == 0) {
                printf("AAID PASS \n");
-       }
-       else {
+       } else {
                printf("AAID FAIL \n");
                goto ERR;
        }
 
        if (authInfo->__authenticatorIndex == auth->__authenticatorIndex) {
                printf("Authenticator Index PASS \n");
-       }
-       else {
+       } else {
                printf("Authenticator Index FAIL \n");
                goto ERR;
        }
@@ -257,64 +241,56 @@ testTLV_getInfo(void)
        //=========================================Meta Data========================================//
        if (authInfo->__meta != NULL) {
                printf("Authenticator Metadata NOT NULL PASS \n");
-       }
-       else {
+       } else {
                printf("Authenticator Metadata NOT NULL FAIL \n");
                goto ERR;
        }
 
        if (authInfo->__meta->authenticatorType == auth->__meta->authenticatorType) {
                printf("Authenticator Metadata authenticatorType PASS \n");
-       }
-       else {
+       } else {
                printf("Authenticator Metadata authenticatorType FAIL \n");
                //goto ERR;
        }
 
        if (authInfo->__meta->authenticationAlg == auth->__meta->authenticationAlg) {
                printf("Authenticator Metadata authenticationAlg PASS \n");
-       }
-       else {
+       } else {
                printf("Authenticator Metadata authenticationAlg FAIL \n");
                //goto ERR;
        }
 
        if (authInfo->__meta->keyProtection == auth->__meta->keyProtection) {
                printf("Authenticator Metadata keyProtection PASS \n");
-       }
-       else {
+       } else {
                printf("Authenticator Metadata keyProtection FAIL \n");
                //goto ERR;
        }
 
        if (authInfo->__meta->matcherProtection == auth->__meta->matcherProtection) {
                printf("Authenticator Metadata matcherProtection PASS \n");
-       }
-       else {
+       } else {
                printf("Authenticator Metadata matcherProtection FAIL \n");
                //goto ERR;
        }
 
        if (authInfo->__meta->maxKeyHandles == auth->__meta->maxKeyHandles) {
                printf("Authenticator Metadata maxKeyHandles PASS \n");
-       }
-       else {
+       } else {
                printf("Authenticator Metadata maxKeyHandles FAIL \n");
                //goto ERR;
        }
 
        if (authInfo->__meta->transactionConfirmationDisplay == auth->__meta->transactionConfirmationDisplay) {
                printf("Authenticator Metadata transactionConfirmationDisplay PASS \n");
-       }
-       else {
+       } else {
                printf("Authenticator Metadata transactionConfirmationDisplay FAIL \n");
                //goto ERR;
        }
 
        if (authInfo->__meta->userVerification == auth->__meta->userVerification) {
                printf("Authenticator Metadata userVerification PASS \n");
-       }
-       else {
+       } else {
                printf("Authenticator Metadata userVerification FAIL \n");
                //goto ERR;
        }
@@ -322,8 +298,7 @@ testTLV_getInfo(void)
 
        if (authInfo->__tcDisplayPNGCharacteristics != NULL) {
                printf("Non NULL tcDisplayPNGCharacteristics value PASS \n");
-       }
-       else {
+       } else {
                printf("Non NULL tcDisplayPNGCharacteristics value FAIL \n");
                goto ERR;
        }
@@ -331,61 +306,53 @@ testTLV_getInfo(void)
 
                tcDisp = (DisplayTc*)(g_list_first(authInfo->__tcDisplayPNGCharacteristics)->data);
 
-               if(tcDisp->width == disp->width) {
+               if (tcDisp->width == disp->width) {
                        printf("Authenticator tcDisplayPNGCharacteristics width PASS \n");
-               }
-               else {
+               } else {
                        printf("Authenticator tcDisplayPNGCharacteristics width FAIL \n");
                }
 
 
-               if(tcDisp->height == disp->height) {
+               if (tcDisp->height == disp->height) {
                        printf("Authenticator tcDisplayPNGCharacteristics height PASS \n");
-               }
-               else {
+               } else {
                        printf("Authenticator tcDisplayPNGCharacteristics height FAIL \n");
                }
 
 
-               if(tcDisp->bitDepth == disp->bitDepth) {
+               if (tcDisp->bitDepth == disp->bitDepth) {
                        printf("Authenticator tcDisplayPNGCharacteristics bitDepth PASS \n");
-               }
-               else {
+               } else {
                        printf("Authenticator tcDisplayPNGCharacteristics bitDepth FAIL \n");
                }
 
-               if(tcDisp->colorType == disp->colorType) {
+               if (tcDisp->colorType == disp->colorType) {
                        printf("Authenticator tcDisplayPNGCharacteristics colorType PASS \n");
-               }
-               else {
+               } else {
                        printf("Authenticator tcDisplayPNGCharacteristics colorType FAIL \n");
                }
 
-               if(tcDisp->compression == disp->compression) {
+               if (tcDisp->compression == disp->compression) {
                        printf("Authenticator tcDisplayPNGCharacteristics compression PASS \n");
-               }
-               else {
+               } else {
                        printf("Authenticator tcDisplayPNGCharacteristics compression FAIL \n");
                }
 
-               if(tcDisp->filter == disp->filter) {
+               if (tcDisp->filter == disp->filter) {
                        printf("Authenticator tcDisplayPNGCharacteristics filter PASS \n");
-               }
-               else {
+               } else {
                        printf("Authenticator tcDisplayPNGCharacteristics filter FAIL \n");
                }
 
-               if(tcDisp->interlace == disp->interlace) {
+               if (tcDisp->interlace == disp->interlace) {
                        printf("Authenticator tcDisplayPNGCharacteristics interlace PASS \n");
-               }
-               else {
+               } else {
                        printf("Authenticator tcDisplayPNGCharacteristics interlace FAIL \n");
                }
 
                if (strcmp(tcDisp->plte, disp->plte) == 0) {
                        printf("plte PASS \n");
-               }
-               else {
+               } else {
                        printf("plte FAIL \n");
                }
 
@@ -436,8 +403,7 @@ testTLV_RegisterReq(void)
        int ret = encodableReq.setEncoder(EID_UAFV1_REGISTER_REQ);
        if (ret == 0) {
                printf("setEncoder EID_UAFV1_REGISTER_REQ PASS \n");
-       }
-       else {
+       } else {
                printf("setEncoder EID_UAFV1_REGISTER_REQ FAIL \n");
                goto ERR;
        }
@@ -447,8 +413,7 @@ testTLV_RegisterReq(void)
        if (getRegReqBuff != 0) {
                printf("encode EID_UAFV1_REGISTER_REQ PASS \n");
                print_hex(getRegReqBuff);
-       }
-       else {
+       } else {
                printf("encode EID_UAFV1_REGISTER_REQ FAIL \n");
                goto ERR;
        }
@@ -458,8 +423,7 @@ testTLV_RegisterReq(void)
        getRegReqInfo = encodableReq.decode(getRegReqBuff->data);
        if (getRegReqInfo != NULL) {
                printf("decode EID_UAFV1_REGISTER_REQ PASS \n");
-       }
-       else {
+       } else {
                printf("decode EID_UAFV1_REGISTER_REQ FAIL \n");
                goto ERR;
        }
@@ -468,18 +432,16 @@ testTLV_RegisterReq(void)
 
        //===================================COMPARE==============================//
 
-       if(getRegReqInfo->authIdx == getRegReq->authIdx) {
+       if (getRegReqInfo->authIdx == getRegReq->authIdx) {
                printf("AUTHENTICATOR INDEX PASS \n");
-       }
-       else {
+       } else {
                printf("AUTHENTICATOR INDEX FAIL \n");
                goto ERR;
        }
 
        if (strcmp(getRegReqInfo->appId, getRegReq->appId) == 0) {
                printf("APPID PASS \n");
-       }
-       else {
+       } else {
                printf("APPID FAIL \n");
                goto ERR;
        }
@@ -487,40 +449,35 @@ testTLV_RegisterReq(void)
 
        if (memcmp(getRegReqInfo->fch->data, getRegReq->fch->data, getRegReq->fch->len) == 0) {
                printf("FINAL CHALLENGE PASS \n");
-       }
-       else {
+       } else {
                printf("FINAL CHALLENGE FAIL \n");
                goto ERR;
        }
 
        if (strcmp(getRegReqInfo->userName, getRegReq->userName) == 0) {
                printf("USERNAME PASS \n");
-       }
-       else {
+       } else {
                printf("USERNAME FAIL \n");
                goto ERR;
        }
 
-       if(getRegReqInfo->attType == getRegReq->attType) {
+       if (getRegReqInfo->attType == getRegReq->attType) {
                printf("ATTESTATION TYPE PASS \n");
-       }
-       else {
+       } else {
                printf("ATTESTATION TYPE FAIL \n");
                goto ERR;
        }
 
        if (memcmp(getRegReqInfo->khAccessToken->data, getRegReq->khAccessToken->data, getRegReq->khAccessToken->len) == 0) {
                printf("KEY HANDLE ACCESS TOKEN PASS \n");
-       }
-       else {
+       } else {
                printf("KEY HANDLE ACCESS TOKEN FAIL \n");
                goto ERR;
        }
 
        if (strcmp(getRegReqInfo->userVToken, getRegReq->userVToken) == 0) {
                printf("USER VERIFICATION TOKEN PASS \n");
-       }
-       else {
+       } else {
                printf("USER VERIFICATION TOKEN FAIL \n");
                goto ERR;
        }
@@ -603,8 +560,7 @@ testTLV_RegisterResp(void)
        int ret = encodableRegResp.setEncoder(EID_UAFV1_REGISTER_RESP);
        if (ret == 0) {
                printf("setEncoder EID_UAFV1_REGISTER_RESP PASS \n");
-       }
-       else {
+       } else {
                printf("setEncoder EID_UAFV1_REGISTER_RESP FAIL \n");
                goto ERR;
        }
@@ -614,8 +570,7 @@ testTLV_RegisterResp(void)
        if (getRegRespBuff != NULL) {
                printf("encode EID_UAFV1_REGISTER_RESP PASS \n");
                print_hex(getRegRespBuff);
-       }
-       else {
+       } else {
                printf("encode EID_UAFV1_REGISTER_RESP FAIL \n");
                goto ERR;
        }
@@ -625,8 +580,7 @@ testTLV_RegisterResp(void)
        getRegRespInfo = encodableRegResp.decode(getRegRespBuff->data);
        if (getRegRespInfo != NULL) {
                printf("decode EID_UAFV1_REGISTER_RESP PASS \n");
-       }
-       else {
+       } else {
                printf("decode EID_UAFV1_REGISTER_RESP FAIL \n");
                goto ERR;
        }
@@ -639,48 +593,42 @@ testTLV_RegisterResp(void)
 
        if (getRegRespInfo->statusCode == getRegResp->statusCode) {
                printf("statusCode EID_UAFV1_REGISTER_RESP PASS \n");
-       }
-       else {
+       } else {
                printf("statusCode EID_UAFV1_REGISTER_RESP FAIL \n");
                goto ERR;
        }
 
                if (strcmp(getRegRespInfo->regAssertion->krd->aaid, getRegResp->regAssertion->krd->aaid) == 0) {
                        printf("AAID EID_UAFV1_REGISTER_RESP PASS \n");
-               }
-               else {
+               } else {
                        printf("AAID EID_UAFV1_REGISTER_RESP FAIL \n");
                        goto ERR;
                }
 
                        if (getRegRespInfo->regAssertion->krd->assrtInfo->authVersion == getRegResp->regAssertion->krd->assrtInfo->authVersion) {
                                printf("AuthVersion EID_UAFV1_REGISTER_RESP PASS \n");
-                       }
-                       else {
+                       } else {
                                printf("AuthVersion EID_UAFV1_REGISTER_RESP FAIL \n");
                                goto ERR;
                        }
 
                        if (getRegRespInfo->regAssertion->krd->assrtInfo->authMode == getRegResp->regAssertion->krd->assrtInfo->authMode) {
                                printf("AuthMode EID_UAFV1_REGISTER_RESP PASS \n");
-                       }
-                       else {
+                       } else {
                                printf("AuthMode EID_UAFV1_REGISTER_RESP FAIL \n");
                                goto ERR;
                        }
 
                        if (getRegRespInfo->regAssertion->krd->assrtInfo->signatureAlgAndEncoding == getRegResp->regAssertion->krd->assrtInfo->signatureAlgAndEncoding) {
                                printf("signatureAlgAndEncoding EID_UAFV1_REGISTER_RESP PASS \n");
-                       }
-                       else {
+                       } else {
                                printf("signatureAlgAndEncoding EID_UAFV1_REGISTER_RESP FAIL \n");
                                goto ERR;
                        }
 
                        if (getRegRespInfo->regAssertion->krd->assrtInfo->publicKeyAlgAndEncoding == getRegResp->regAssertion->krd->assrtInfo->publicKeyAlgAndEncoding) {
                                printf("publicKeyAlgAndEncoding EID_UAFV1_REGISTER_RESP PASS \n");
-                       }
-                       else {
+                       } else {
                                printf("publicKeyAlgAndEncoding EID_UAFV1_REGISTER_RESP FAIL \n");
                                goto ERR;
                        }
@@ -688,8 +636,7 @@ testTLV_RegisterResp(void)
                if (memcmp(getRegRespInfo->regAssertion->krd->fch->data , getRegResp->regAssertion->krd->fch->data,
                                   getRegResp->regAssertion->krd->fch->len) == 0) {
                        printf("fch EID_UAFV1_REGISTER_RESP PASS \n");
-               }
-               else {
+               } else {
                        printf("fch EID_UAFV1_REGISTER_RESP FAIL \n");
                        goto ERR;
                }
@@ -697,24 +644,21 @@ testTLV_RegisterResp(void)
                if (memcmp(getRegRespInfo->regAssertion->krd->keyId->data ,
                                   getRegResp->regAssertion->krd->keyId->data, getRegResp->regAssertion->krd->keyId->len) == 0) {
                        printf("keyId EID_UAFV1_REGISTER_RESP PASS \n");
-               }
-               else {
+               } else {
                        printf("keyId EID_UAFV1_REGISTER_RESP FAIL \n");
                        goto ERR;
                }
 
                        if (getRegRespInfo->regAssertion->krd->counter->regCounter == getRegResp->regAssertion->krd->counter->regCounter) {
                                printf("regCounter EID_UAFV1_REGISTER_RESP PASS \n");
-                       }
-                       else {
+                       } else {
                                printf("regCounter EID_UAFV1_REGISTER_RESP FAIL \n");
                                goto ERR;
                        }
 
                        if (getRegRespInfo->regAssertion->krd->counter->signCounter == getRegResp->regAssertion->krd->counter->signCounter) {
                                printf("signCounter EID_UAFV1_REGISTER_RESP PASS \n");
-                       }
-                       else {
+                       } else {
                                printf("signCounter EID_UAFV1_REGISTER_RESP FAIL \n");
                                goto ERR;
                        }
@@ -722,8 +666,7 @@ testTLV_RegisterResp(void)
                if (memcmp(getRegRespInfo->regAssertion->krd->pubKey->data ,
                                   getRegResp->regAssertion->krd->pubKey->data, getRegResp->regAssertion->krd->pubKey->len) == 0) {
                        printf("pubKey EID_UAFV1_REGISTER_RESP PASS \n");
-               }
-               else {
+               } else {
                        printf("pubKey EID_UAFV1_REGISTER_RESP FAIL \n");
                        goto ERR;
                }
@@ -731,8 +674,7 @@ testTLV_RegisterResp(void)
                        if (memcmp(getRegRespInfo->regAssertion->attFull->sig->data ,
                                           getRegResp->regAssertion->attFull->sig->data, getRegResp->regAssertion->attFull->sig->len) == 0) {
                                printf("attFull->sig EID_UAFV1_REGISTER_RESP PASS \n");
-                       }
-                       else {
+                       } else {
                                printf("attFull->sig EID_UAFV1_REGISTER_RESP FAIL \n");
                                goto ERR;
                        }
@@ -740,8 +682,7 @@ testTLV_RegisterResp(void)
                        if (memcmp(getRegRespInfo->regAssertion->attFull->cert->data ,
                                           getRegResp->regAssertion->attFull->cert->data, getRegResp->regAssertion->attFull->cert->len) == 0) {
                                printf("attFull->cert EID_UAFV1_REGISTER_RESP PASS \n");
-                       }
-                       else {
+                       } else {
                                printf("attFull->cert EID_UAFV1_REGISTER_RESP FAIL \n");
                                goto ERR;
                        }
@@ -749,8 +690,7 @@ testTLV_RegisterResp(void)
        if (memcmp(getRegRespInfo->kh->data ,
                           getRegResp->kh->data, getRegResp->kh->len) == 0) {
                printf("keyHandle EID_UAFV1_REGISTER_RESP PASS \n");
-       }
-       else {
+       } else {
                printf("keyHandle EID_UAFV1_REGISTER_RESP FAIL \n");
                goto ERR;
        }
@@ -802,8 +742,7 @@ testTLV_SignReq(void)
        int ret = encodableSignReq.setEncoder(EID_UAFV1_SIGN_REQ);
        if (ret == 0) {
                printf("setEncoder EID_UAFV1_SIGN_REQ PASS \n");
-       }
-       else {
+       } else {
                printf("setEncoder EID_UAFV1_SIGN_REQ FAIL \n");
                goto ERR;
        }
@@ -813,8 +752,7 @@ testTLV_SignReq(void)
        if (getAuthReqInfoBuff != NULL) {
                printf("encode EID_UAFV1_SIGN_REQ PASS \n");
                print_hex(getAuthReqInfoBuff);
-       }
-       else {
+       } else {
                printf("encode EID_UAFV1_SIGN_REQ FAIL \n");
                goto ERR;
        }
@@ -824,8 +762,7 @@ testTLV_SignReq(void)
        getAuthReqInfo = encodableSignReq.decode(getAuthReqInfoBuff->data);
        if (getAuthReqInfo != NULL) {
                printf("decode EID_UAFV1_SIGN_REQ PASS \n");
-       }
-       else {
+       } else {
                printf("decode EID_UAFV1_SIGN_REQ FAIL \n");
                goto ERR;
        }
@@ -836,24 +773,21 @@ testTLV_SignReq(void)
 
        if (getAuthReqInfo->authIdx == getAuthReq->authIdx) {
                printf("authIdx EID_UAFV1_SIGN_REQ PASS \n");
-       }
-       else {
+       } else {
                printf("authIdx EID_UAFV1_SIGN_REQ FAIL \n");
                goto ERR;
        }
 
        if (strcmp(getAuthReqInfo->appId, getAuthReq->appId) == 0) {
                printf("appId EID_UAFV1_SIGN_REQ PASS \n");
-       }
-       else {
+       } else {
                printf("appId EID_UAFV1_SIGN_REQ FAIL \n");
                goto ERR;
        }
 
        if (memcmp(getAuthReqInfo->fch->data, getAuthReq->fch->data, getAuthReq->fch->len) == 0) {
                printf("fch EID_UAFV1_SIGN_REQ PASS \n");
-       }
-       else {
+       } else {
                printf("appId EID_UAFV1_SIGN_REQ FAIL \n");
                goto ERR;
        }
@@ -861,8 +795,7 @@ testTLV_SignReq(void)
 
        if (strcmp(getAuthReqInfo->tc, getAuthReq->tc) == 0) {
                printf("tc EID_UAFV1_SIGN_REQ PASS \n");
-       }
-       else {
+       } else {
                printf("tc EID_UAFV1_SIGN_REQ FAIL \n");
                goto ERR;
        }
@@ -870,8 +803,7 @@ testTLV_SignReq(void)
 
        if (memcmp(getAuthReqInfo->khATok->data, getAuthReq->khATok->data, getAuthReq->khATok->len) == 0) {
                printf("khATok EID_UAFV1_SIGN_REQ PASS \n");
-       }
-       else {
+       } else {
                printf("khATok EID_UAFV1_SIGN_REQ FAIL \n");
                goto ERR;
        }
@@ -879,8 +811,7 @@ testTLV_SignReq(void)
 
        if (strcmp(getAuthReqInfo->userVToken, getAuthReq->userVToken) == 0) {
                printf("userVToken EID_UAFV1_SIGN_REQ PASS \n");
-       }
-       else {
+       } else {
                printf("userVToken EID_UAFV1_SIGN_REQ FAIL \n");
                goto ERR;
        }
@@ -956,8 +887,7 @@ testTLV_SignResp(void)
        int ret = encodableSignResp.setEncoder(EID_UAFV1_SIGN_RESP);
        if (ret == 0) {
                printf("setEncoder EID_UAFV1_SIGN_RESP PASS \n");
-       }
-       else {
+       } else {
                printf("setEncoder EID_UAFV1_SIGN_RESP FAIL \n");
                goto ERR;
        }
@@ -967,8 +897,7 @@ testTLV_SignResp(void)
        if (getAuthRespInfoBuff != NULL) {
                printf("encode EID_UAFV1_SIGN_RESP PASS \n");
                print_hex(getAuthRespInfoBuff);
-       }
-       else {
+       } else {
                printf("encode EID_UAFV1_SIGN_RESP FAIL \n");
                goto ERR;
        }
@@ -978,8 +907,7 @@ testTLV_SignResp(void)
        getAuthRespInfo = encodableSignResp.decode(getAuthRespInfoBuff->data);
        if (getAuthRespInfo != NULL) {
                printf("decode EID_UAFV1_SIGN_RESP PASS \n");
-       }
-       else {
+       } else {
                printf("decode EID_UAFV1_SIGN_RESP FAIL \n");
                goto ERR;
        }
@@ -989,40 +917,35 @@ testTLV_SignResp(void)
 
        if (getAuthRespInfo->statusCode == getAuthResp->statusCode) {
                printf("statusCode EID_UAFV1_SIGN_RESP PASS \n");
-       }
-       else {
+       } else {
                printf("statusCode EID_UAFV1_SIGN_RESP FAIL \n");
                goto ERR;
        }
 
                if (strcmp(getAuthRespInfo->authAssertion->sigData->aaid, getAuthResp->authAssertion->sigData->aaid) == 0) {
                        printf("aaid EID_UAFV1_SIGN_RESP PASS \n");
-               }
-               else {
+               } else {
                        printf("aaid EID_UAFV1_SIGN_RESP FAIL \n");
                        goto ERR;
                }
 
                        if (getAuthRespInfo->authAssertion->sigData->assrtInfo->authVersion == getAuthResp->authAssertion->sigData->assrtInfo->authVersion) {
                                printf("authVersion EID_UAFV1_SIGN_RESP PASS \n");
-                       }
-                       else {
+                       } else {
                                printf("authVersion EID_UAFV1_SIGN_RESP FAIL \n");
                                goto ERR;
                        }
 
                        if (getAuthRespInfo->authAssertion->sigData->assrtInfo->authMode == getAuthResp->authAssertion->sigData->assrtInfo->authMode) {
                                printf("authMode EID_UAFV1_SIGN_RESP PASS \n");
-                       }
-                       else {
+                       } else {
                                printf("authMode EID_UAFV1_SIGN_RESP FAIL \n");
                                goto ERR;
                        }
 
                        if (getAuthRespInfo->authAssertion->sigData->assrtInfo->signatureAlgAndEncoding == getAuthResp->authAssertion->sigData->assrtInfo->signatureAlgAndEncoding) {
                                printf("signatureAlgAndEncoding EID_UAFV1_SIGN_RESP PASS \n");
-                       }
-                       else {
+                       } else {
                                printf("signatureAlgAndEncoding EID_UAFV1_SIGN_RESP FAIL \n");
                                goto ERR;
                        }
@@ -1030,8 +953,7 @@ testTLV_SignResp(void)
                if (memcmp(getAuthRespInfo->authAssertion->sigData->authNonce->data,
                                   getAuthResp->authAssertion->sigData->authNonce->data, getAuthResp->authAssertion->sigData->authNonce->len) == 0) {
                        printf("authNonce EID_UAFV1_SIGN_RESP PASS \n");
-               }
-               else {
+               } else {
                        printf("authNonce EID_UAFV1_SIGN_RESP FAIL \n");
                        goto ERR;
                }
@@ -1039,8 +961,7 @@ testTLV_SignResp(void)
                if (memcmp(getAuthRespInfo->authAssertion->sigData->fch->data, getAuthResp->authAssertion->sigData->fch->data,
                                getAuthResp->authAssertion->sigData->fch->len) == 0) {
                        printf("fch EID_UAFV1_SIGN_RESP PASS \n");
-               }
-               else {
+               } else {
                        printf("fch EID_UAFV1_SIGN_RESP FAIL \n");
                        goto ERR;
                }
@@ -1048,8 +969,7 @@ testTLV_SignResp(void)
                if (memcmp(getAuthRespInfo->authAssertion->sigData->tcHash->data,
                                   getAuthResp->authAssertion->sigData->tcHash->data, getAuthResp->authAssertion->sigData->tcHash->len) == 0) {
                        printf("tcHash EID_UAFV1_SIGN_RESP PASS \n");
-               }
-               else {
+               } else {
                        printf("tcHash EID_UAFV1_SIGN_RESP FAIL \n");
                        goto ERR;
                }
@@ -1057,16 +977,14 @@ testTLV_SignResp(void)
                if (memcmp(getAuthRespInfo->authAssertion->sigData->keyId->data,
                                   getAuthResp->authAssertion->sigData->keyId->data, getAuthResp->authAssertion->sigData->keyId->len) == 0) {
                        printf("keyId EID_UAFV1_SIGN_RESP PASS \n");
-               }
-               else {
+               } else {
                        printf("keyId EID_UAFV1_SIGN_RESP FAIL \n");
                        goto ERR;
                }
 
                        if (getAuthRespInfo->authAssertion->sigData->counter->signCounter == getAuthResp->authAssertion->sigData->counter->signCounter) {
                                printf("signCounter EID_UAFV1_SIGN_RESP PASS \n");
-                       }
-                       else {
+                       } else {
                                printf("signCounter EID_UAFV1_SIGN_RESP FAIL \n");
                                goto ERR;
                        }
@@ -1074,8 +992,7 @@ testTLV_SignResp(void)
        if (memcmp(getAuthRespInfo->authAssertion->sig->data,
                           getAuthResp->authAssertion->sig->data, getAuthResp->authAssertion->sig->len) == 0) {
                printf("signature EID_UAFV1_SIGN_RESP PASS \n");
-       }
-       else {
+       } else {
                printf("signature EID_UAFV1_SIGN_RESP FAIL \n");
                goto ERR;
        }
@@ -1115,8 +1032,7 @@ testTLV_DeRegReq(void)
        int ret = encodableDeRegReq.setEncoder(EID_UAFV1_DEREG_REQ);
        if (ret == 0) {
                printf("setEncoder EID_UAFV1_DEREG_REQ PASS \n");
-       }
-       else {
+       } else {
                printf("setEncoder EID_UAFV1_DEREG_REQ FAIL \n");
                goto ERR;
        }
@@ -1126,8 +1042,7 @@ testTLV_DeRegReq(void)
        if (getDeRegReqInfoBuff != NULL) {
                printf("encode EID_UAFV1_DEREG_REQ PASS \n");
                print_hex(getDeRegReqInfoBuff);
-       }
-       else {
+       } else {
                printf("encode EID_UAFV1_DEREG_REQ FAIL \n");
                goto ERR;
        }
@@ -1137,8 +1052,7 @@ testTLV_DeRegReq(void)
        getDeRegReqInfo = encodableDeRegReq.decode(getDeRegReqInfoBuff->data);
        if (getDeRegReqInfo != NULL) {
                printf("decode EID_UAFV1_DEREG_REQ PASS \n");
-       }
-       else {
+       } else {
                printf("decode EID_UAFV1_DEREG_REQ FAIL \n");
                goto ERR;
        }
@@ -1148,32 +1062,28 @@ testTLV_DeRegReq(void)
 
        if (getDeRegReq->authIdx == getDeRegReqInfo->authIdx) {
                printf("authIdx EID_UAFV1_DEREG_REQ PASS \n");
-       }
-       else {
+       } else {
                printf("authIdx EID_UAFV1_DEREG_REQ FAIL \n");
                goto ERR;
        }
 
        if (strcmp(getDeRegReq->appId, getDeRegReqInfo->appId) == 0) {
                printf("appId EID_UAFV1_DEREG_REQ PASS \n");
-       }
-       else {
+       } else {
                printf("appId EID_UAFV1_DEREG_REQ FAIL \n");
                goto ERR;
        }
 
        if (strcmp(getDeRegReq->keyId, getDeRegReqInfo->keyId) == 0) {
                printf("keyId EID_UAFV1_DEREG_REQ PASS \n");
-       }
-       else {
+       } else {
                printf("keyId EID_UAFV1_DEREG_REQ FAIL \n");
                goto ERR;
        }
 
        if (memcmp(getDeRegReq->khATok->data, getDeRegReqInfo->khATok->data, getDeRegReqInfo->khATok->len) == 0) {
                printf("khATok EID_UAFV1_DEREG_REQ PASS \n");
-       }
-       else {
+       } else {
                printf("khATok EID_UAFV1_DEREG_REQ FAIL \n");
                goto ERR;
        }
@@ -1182,7 +1092,6 @@ testTLV_DeRegReq(void)
 ERR:
        printf("==============testTLV DEREGISTER REQUEST  end============== \n");
        get_user_choice();
-
 }
 
 void
@@ -1201,8 +1110,7 @@ testTLV_DeRegResp(void)
        int ret = encodableDeRegResp.setEncoder(EID_UAFV1_DEREG_RESP);
        if (ret == 0) {
                printf("setEncoder EID_UAFV1_DEREG_RESP PASS \n");
-       }
-       else {
+       } else {
                printf("setEncoder EID_UAFV1_DEREG_RESP FAIL \n");
                goto ERR;
        }
@@ -1212,8 +1120,7 @@ testTLV_DeRegResp(void)
        if (getDeRegRespInfoBuff != NULL) {
                printf("encode EID_UAFV1_DEREG_RESP PASS \n");
                print_hex(getDeRegRespInfoBuff);
-       }
-       else {
+       } else {
                printf("encode EID_UAFV1_DEREG_REQ FAIL \n");
                goto ERR;
        }
@@ -1223,8 +1130,7 @@ testTLV_DeRegResp(void)
        getDeRegRespInfo = encodableDeRegResp.decode(getDeRegRespInfoBuff->data);
        if (getDeRegRespInfo != NULL) {
                printf("decode EID_UAFV1_DEREG_RESP PASS \n");
-       }
-       else {
+       } else {
                printf("decode EID_UAFV1_DEREG_REQ FAIL \n");
                goto ERR;
        }
@@ -1235,8 +1141,7 @@ testTLV_DeRegResp(void)
 
        if (getDeRegRespInfo->statusCode == getDeRegResp->statusCode) {
                printf("statusCode EID_UAFV1_DEREG_RESP PASS \n");
-       }
-       else {
+       } else {
                printf("statusCode EID_UAFV1_DEREG_REQ FAIL \n");
                goto ERR;
        }
@@ -1269,13 +1174,11 @@ testAuthnrManager(void)
                AuthenrStub *authStub = *it;
                if (authStub == NULL) {
                        printf("authStub FAILED\n");
-               }
-               else {
+               } else {
                        int ret = authStub->connect();
                        if (ret != 0) {
                                printf("AuthenrStub::connect FAILED\n");
-                       }
-                       else {
+                       } else {
                                printf("AuthenrStub::connect PASS\n");
                        }
                }
@@ -1300,10 +1203,9 @@ testAuthDb(AsmStorage* obj)
 
        //DELETE DATA
        int ret = obj->deleteData(parcel);
-       if(ret == 0) {
+       if (ret == 0) {
                printf("Records successfully deleted\n");
-       }
-       else if(ret == 1) {
+       } else if (ret == 1) {
                printf("Records not deleted/ does not exists\n");
        }
 }
@@ -1356,10 +1258,9 @@ void deleteByKeyId(AsmStorage* obj, const char *keyId)
        parcel->setString(STR_PROP_KEY_ID, keyId);
 
        int ret = obj->deleteData(parcel);
-       if(ret == 0) {
+       if (ret == 0) {
                printf("Records successfully deleted\n");
-       }
-       else if(ret == 1) {
+       } else if (ret == 1) {
                printf("Records not deleted/ does not exists\n");
        }
 }
@@ -1424,10 +1325,9 @@ testDb(void)
        bulkData.push_back(parcel1);
 
        int ret = obj->insertBulkData(&bulkData);
-       if(ret == 0) {
+       if (ret == 0) {
                printf("Records successfully inserted\n");
-       }
-       else if(ret == 1) {
+       } else if (ret == 1) {
                printf("Records not inserted/ already exists\n");
        }
 
@@ -1461,22 +1361,19 @@ testJsonReqCommon(const char *json, const char *expReqType)
 
        if (ver->getMajor() == 1) {
                printf("getMajor PASSED \n");
-       }
-       else {
+       } else {
                printf("getMajor FAILED \n");
        }
 
        if (ver->getMinor() == 0) {
                printf("getMinor PASSED \n");
-       }
-       else {
+       } else {
                printf("getMinor FAILED \n");
        }
 
        if (asmReq->getRequesttype() == expReqType) {
                printf("getRequesttype PASSED \n");
-       }
-       else {
+       } else {
                printf("getRequesttype FAILED \n");
        }
 
@@ -1515,8 +1412,7 @@ testJsonRegReq(void)
 
        if (asmReqReg->getAuthIndex() == 1) {
                printf("getAuthIndex PASSED \n");
-       }
-       else {
+       } else {
                printf("getAuthIndex FAILED \n");
        }
 
@@ -1531,29 +1427,25 @@ testJsonRegReq(void)
 
        if (regArg->getAppId() == "https://qa-egypt.noknoktest.com:443/UAFSampleProxy/uaf/facets.uaf") {
                printf("getAppId PASSED \n");
-       }
-       else {
+       } else {
                printf("getAppId FAILED \n");
        }
 
        if (regArg->getUserName() == "user1") {
                printf("getUserName PASSED \n");
-       }
-       else {
+       } else {
                printf("getUserName FAILED \n");
        }
 
        if (regArg->getFinalChallenge() == "eyJhcHBJRCI6Imh0dHBzOi8vcWEtZWd5cHQubm9rbm9rdGVzdC5jb206NDQzL1VBRlNhbXBsZVByb3h5L3VhZi9mYWNldHMudWFmIiwiY2hhbGxlbmdlIjoidVlCdUdRZjdyLUxORDE2UTBHVXBQUmkxMTJVakN0Y3ltM2F3am0tTW1tSSIsImNoYW5uZWxCaW5kaW5nIjp7fSwiZmFjZXRJRCI6ImNvbS5ub2tub2suYW5kcm9pZC5zYW1wbGVhcHAifQ") {
                printf("getFinalChallenge PASSED \n");
-       }
-       else {
+       } else {
                printf("getFinalChallenge FAILED \n");
        }
 
        if (regArg->getAttestationType() == 15879) {
                printf("getAttestationType PASSED \n");
-       }
-       else {
+       } else {
                printf("getAttestationType FAILED \n");
        }
 
@@ -1577,8 +1469,7 @@ testJsonAuthReq(void)
 
        if (asmReqAuth->getAuthIndex() == 1) {
                printf("getAuthIndex PASSED \n");
-       }
-       else {
+       } else {
                printf("getAuthIndex FAILED \n");
        }
 
@@ -1593,15 +1484,13 @@ testJsonAuthReq(void)
 
        if (authArg->getAppId() == "https://qa-egypt.noknoktest.com:443/UAFSampleProxy/uaf/facets.uaf") {
                printf("getAppId PASSED \n");
-       }
-       else {
+       } else {
                printf("getAppId FAILED \n");
        }
 
        if (authArg->getFCH() == "eyJhcHBJRCI6Imh0dHBzOi8vcWEtZWd5cHQubm9rbm9rdGVzdC5jb206NDQzL1VBRlNhbXBsZVByb3h5L3VhZi9mYWNldHMudWFmIiwiY2hhbGxlbmdlIjoiM3otaVN2TndENFFLd01kV1NCS0hGT2hNNDN4M1dGOHI1eU9yd0pmVzljSSIsImNoYW5uZWxCaW5kaW5nIjp7fSwiZmFjZXRJRCI6ImNvbS5ub2tub2suYW5kcm9pZC5zYW1wbGVhcHAifQ") {
                printf("getFCH PASSED \n");
-       }
-       else {
+       } else {
                printf("getFCH FAILED \n");
        }
 
@@ -1625,8 +1514,7 @@ testJsonDeRegReq(void)
 
        if (asmReqDereg->getAuthIndex() == 1) {
                printf("getAuthIndex PASSED \n");
-       }
-       else {
+       } else {
                printf("getAuthIndex FAILED \n");
        }
 
@@ -1641,15 +1529,13 @@ testJsonDeRegReq(void)
 
        if (deregArg->getAppId() == "https://qa-egypt.noknoktest.com:443/UAFSampleProxy/uaf/facets.uaf") {
                printf("getAppId PASSED \n");
-       }
-       else {
+       } else {
                printf("getAppId FAILED \n");
        }
 
        if (deregArg->getKeyId() == "1eVp7JIQlwm6YF0YEmGZdNCA27qZoIcZGC0Uaw71bR8") {
                printf("getKeyId PASSED \n");
-       }
-       else {
+       } else {
                printf("getKeyId FAILED \n");
        }
 
@@ -1721,7 +1607,6 @@ testOpGetReg()
 char *
 compose_asm_dereg_request(char *appId, char *keyId, int authIdx)
 {
-
        JsonBuilder *builder = json_builder_new();
 
        json_builder_begin_object(builder);
@@ -1795,7 +1680,7 @@ testOpDeReg(Buffer *keyId)
 
        const char *asmReqJson = compose_asm_dereg_request(appId, kId, 1);
 
-       if(asmReqJson != NULL) {
+       if (asmReqJson != NULL) {
                const std::string callerId = "caller_id";
 
                AsmRequest *req = JsonUtil::parseAsmRequestJson(asmReqJson);
@@ -1808,8 +1693,7 @@ testOpDeReg(Buffer *keyId)
                char *asmResp = operation->execute();
 
                printf("\n\nASM DEREGISTER RESPONSE : [%s]\n\n", asmResp);
-       }
-       else {
+       } else {
                printf("ERROR : ASM DEREGISTER REQ JSON IS NULL");
                return 1;
        }
@@ -1898,11 +1782,11 @@ testOpAuth(Buffer *keyId)
        strcpy(appId, "https://qa-egypt.noknoktest.com:443/UAFSampleProxy/uaf/facets.uaf");
 
        char *fc = (char*)calloc(1, 5000);
-       strcpy(fc,"eyJhcHBJRCI6Imh0dHBzOi8vcWEtZWd5cHQubm9rbm9rdGVzdC5jb206NDQzL1VBRlNhbXBsZVByb3h5L3VhZi9mYWNldHMudWFmIiwiY2hhbGxlbmdlIjoiM3otaVN2TndENFFLd01kV1NCS0hGT2hNNDN4M1dGOHI1eU9yd0pmVzljSSIsImNoYW5uZWxCaW5kaW5nIjp7fSwiZmFjZXRJRCI6ImNvbS5ub2tub2suYW5kcm9pZC5zYW1wbGVhcHAifQ");
+       strcpy(fc, "eyJhcHBJRCI6Imh0dHBzOi8vcWEtZWd5cHQubm9rbm9rdGVzdC5jb206NDQzL1VBRlNhbXBsZVByb3h5L3VhZi9mYWNldHMudWFmIiwiY2hhbGxlbmdlIjoiM3otaVN2TndENFFLd01kV1NCS0hGT2hNNDN4M1dGOHI1eU9yd0pmVzljSSIsImNoYW5uZWxCaW5kaW5nIjp7fSwiZmFjZXRJRCI6ImNvbS5ub2tub2suYW5kcm9pZC5zYW1wbGVhcHAifQ");
 
        const char *asmReqJson = compose_asm_auth_req_json(appId, kId, fc, 1);
 
-       if(asmReqJson != NULL) {
+       if (asmReqJson != NULL) {
                const std::string callerId = "caller_id";
 
                AsmRequest *req = JsonUtil::parseAsmRequestJson(asmReqJson);
@@ -1915,8 +1799,7 @@ testOpAuth(Buffer *keyId)
                char *asmResp = operation->execute();
 
                printf("\n\nASM AUTHENTICATE RESPONSE : [%s]\n\n", asmResp);
-       }
-       else {
+       } else {
                printf("ERROR : ASM AUTH REQ JSON IS NULL");
                return 1;
        }
@@ -1948,7 +1831,7 @@ __parse_asm_reg_response_json(const unsigned char *asmRegResp, char **regAssrtn)
 
        resDataObj = json_object_get_object_member(root_obj, "responseData");
 
-       if(resDataObj != NULL)
+       if (resDataObj != NULL)
        {
                const char *regAssrtn_temp = json_object_get_string_member(resDataObj, "assertion");
 
@@ -2018,8 +1901,7 @@ testOpReg()
        int ret = encodableRegAssrtn.setEncoder(EID_UAFV1_REG_ASSERTION_RESP);
        if (ret == 0) {
                printf("setEncoder EID_UAFV1_REG_ASSERTION_RESP PASS \n");
-       }
-       else {
+       } else {
                printf("setEncoder EID_UAFV1_REG_ASSERTION_RESP FAIL \n");
                return NULL;
        }
@@ -2027,8 +1909,7 @@ testOpReg()
        getRegAssrtnInfo = encodableRegAssrtn.decode(testBuff->data);
        if (getRegAssrtnInfo != NULL) {
                printf("decode EID_UAFV1_REG_ASSERTION_RESP PASS \n");
-       }
-       else {
+       } else {
                printf("decode EID_UAFV1_REG_ASSERTION_RESP FAIL \n");
                return NULL;
        }
@@ -2063,7 +1944,6 @@ testOpGetInfo(void)
        printf("ASM GETINFO RESPOMSE : [%s]\n\n", asmResp);
 
        printf("==============testOp GETINFO end============== \n\n\n");
-
 }
 
 void
@@ -2076,18 +1956,16 @@ testSilentAuth(void)
        Buffer *keyId = NULL;
        keyId = testOpReg();
 
-       if(keyId != NULL) {
+       if (keyId != NULL) {
                ret = testOpAuth(keyId);
-       }
-       else {
+       } else {
                printf("Key Id obtaibed from Registeration process is NULL\n");
        }
 
-       if(ret == 0) {
+       if (ret == 0) {
                printf("User Authenticated :: SUCCESS\n");
                testOpDeReg(keyId);
-       }
-       else {
+       } else {
                printf("User Authenticated :: FAIL\n");
        }
 
old mode 100644 (file)
new mode 100755 (executable)
index 803cde9..ab8fa28
@@ -19,7 +19,7 @@
 #include <string.h>
 #include <stdio.h>
 
-bool 
+bool
 show_confirm_dialog(const char *title)
 {
        const int options[2] = {1, 2};
@@ -47,7 +47,7 @@ show_confirm_dialog(const char *title)
        return answer;
 }
 
-int 
+int
 show_menu(
                const char *title,
                const int *options,
old mode 100644 (file)
new mode 100755 (executable)
index d289cf7..9d5fbcb
@@ -30,9 +30,9 @@ bool show_confirm_dialog(const char *title);
  *         otherwise a negative error value
  */
 int show_menu(
-        const char *title,
-        const int *options,
-        const char **names,
-        int number_of_option);
+       const char *title,
+       const int *options,
+       const char **names,
+       int number_of_option);
 
 #endif /* __FIDO_SHELL_TC_UTIL_H_ */
index 7a84fa4..5350fb7 100755 (executable)
@@ -136,7 +136,7 @@ create_list_view_tc(void)
 
        /*Toolbar*/
        Evas_Object *toolbar = ui_utils_toolbar_add_tc(__ad->nf);
-       if(toolbar) {
+       if (toolbar) {
                evas_object_show(toolbar);
 
                elm_toolbar_select_mode_set(toolbar, ELM_OBJECT_SELECT_MODE_NONE);
@@ -290,7 +290,7 @@ create_list_view_account(void)
 
        /*Toolbar*/
        Evas_Object *toolbar = ui_utils_toolbar_add_account(__ad->nf);
-       if(toolbar) {
+       if (toolbar) {
                evas_object_show(toolbar);
 
                elm_toolbar_select_mode_set(toolbar, ELM_OBJECT_SELECT_MODE_NONE);
@@ -380,20 +380,11 @@ toast_popup(char *text)
 int
 genB64Encode(const unsigned char *input, int inlen, unsigned char * output, int *outlen)
 {
-#if 0
-       EVP_ENCODE_CTX ctx;
-       int t = 0;
-       EVP_EncodeInit(&ctx);
-       EVP_EncodeUpdate(&ctx, output,outlen,input,inlen);
-       EVP_EncodeFinal(&ctx,output + *outlen, &t);
-       *outlen += t -1;
-#else
        BIO * bmem = NULL;
        BIO * b64 = NULL;
        BUF_MEM * bptr = NULL;
        b64 = BIO_new(BIO_f_base64());
-       if(b64 == NULL)
-       {
+       if (b64 == NULL) {
                _ERR("BIO_new failed \n");
                return -1;
        }
@@ -408,25 +399,17 @@ genB64Encode(const unsigned char *input, int inlen, unsigned char * output, int
        memcpy(output, bptr->data, bptr->length);
        output[bptr->length] = 0;
        *outlen = bptr->length;
-       if(b64)
-       {
+       if (b64) {
                BIO_free_all(b64);
        }
-       //printf("outlen is %d, out is %s\n",*outlen, output);
-#endif
+
        int i;
-       for(i =0; i < *outlen ; i++)
-       {
-               if(output[i] == '+')
-               {
+       for (i = 0; i < *outlen ; i++) {
+               if (output[i] == '+') {
                        output[i] = '-';
-               }
-               else if(output[i] == '/')
-               {
+               } else if (output[i] == '/') {
                        output[i] = '_';
-               }
-               else if(output[i] == '=')
-               {
+               } else if (output[i] == '=') {
                        *outlen = i ;
                        output[i] = '\0';
                        break;
@@ -456,8 +439,7 @@ ToBase64Url(const unsigned char *input, int inputLen)
        if (0 != genB64Encode(input,
                                                inputSz,
                                                output,
-                                               &outputSz))
-       {
+                                               &outputSz)) {
                _ERR("Failed to encode base64.");
                free(output);
                return (unsigned char*)"";
@@ -474,13 +456,13 @@ bool
 genHash256(const void* input, unsigned long length, unsigned char* md)
 {
        SHA256_CTX context;
-       if(!SHA256_Init(&context))
+       if (!SHA256_Init(&context))
                return false;
 
-       if(!SHA256_Update(&context, (unsigned char*)input, length))
+       if (!SHA256_Update(&context, (unsigned char*)input, length))
                return false;
 
-       if(!SHA256_Final(md, &context))
+       if (!SHA256_Final(md, &context))
                return false;
 
        return true;
@@ -489,7 +471,7 @@ genHash256(const void* input, unsigned long length, unsigned char* md)
 static void
 pin_save_clicked(void *data, Evas_Object *obj, void *event_info)
 {
-       if(elm_entry_is_empty(__ad->entry) == EINA_TRUE){
+       if (elm_entry_is_empty(__ad->entry) == EINA_TRUE) {
                toast_popup("Enter PIN");
                return;
        }
@@ -507,8 +489,7 @@ pin_save_clicked(void *data, Evas_Object *obj, void *event_info)
 
        if (strcmp(pin_b64, __ad->token_in) == 0) {
                asm_ui_ipc_send_auth_result(0, __ad->nonce, 0, pin);
-       }
-       else {
+       } else {
                dlog_print(DLOG_INFO, "org.tizen.asmui", "fido asm ui [%s][%s][%s]", pin, pin_b64, __ad->token_in);
                toast_popup("Incorrect PIN");
                return;
@@ -584,7 +565,7 @@ create_base_gui_pin(int type)
 
        /*Toolbar*/
        Evas_Object *toolbar = ui_utils_toolbar_add_account(__ad->nf);
-       if(toolbar) {
+       if (toolbar) {
                evas_object_show(toolbar);
 
                elm_toolbar_select_mode_set(toolbar, ELM_OBJECT_SELECT_MODE_NONE);
@@ -752,7 +733,7 @@ main(int argc, char *argv[])
        ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, __ad);
        ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]);
 
-#if !GLIB_CHECK_VERSION(2,35,0)
+#if !GLIB_CHECK_VERSION(2, 35, 0)
        g_type_init();
 #endif
 
old mode 100644 (file)
new mode 100755 (executable)
index 93437df..1e33e05
@@ -39,9 +39,9 @@ __asm_ui_get_dbus_proxy(void)
                                                NULL,
                                                &error);
 
-       if (error != NULL) {
+       if (error != NULL)
                dlog_print(DLOG_INFO, "org.tizen.asmui", "fido asm ui after fidoasm_proxy_new_sync %s", error->message);
-       }
+
        return dbus_proxy;
 }
 
@@ -58,9 +58,8 @@ asm_ui_ipc_send_tc_result(const char *nonce, int result)
        GError *err = NULL;
        fidoasm_call_asm_ui_confirm_tc_sync(dbus_proxy, nonce, result, NULL, &err);
        dlog_print(DLOG_INFO, "org.tizen.asmui", "fido asm ui after fidoasm_call_asm_ui_confirm_tc_sync");
-       if (err != NULL) {
+       if (err != NULL)
                dlog_print(DLOG_INFO, "org.tizen.asmui", "fido asm ui fidoasm_call_asm_ui_confirm_tc_sync %s", err->message);
-       }
 
        return 0;
 }