alex.kopachov 2 лет назад
Родитель
Сommit
699765891d
2 измененных файлов с 10 добавлено и 6 удалено
  1. 3 3
      services/totp/totp.c
  2. 7 3
      types/token_info.c

+ 3 - 3
services/totp/totp.c

@@ -7,10 +7,10 @@
 #include "../../config/wolfssl/config.h"
 #include <wolfssl/wolfcrypt/hmac.h>
 #ifdef NO_INLINE
-    #include <wolfssl/wolfcrypt/misc.h>
+#include <wolfssl/wolfcrypt/misc.h>
 #else
-    #define WOLFSSL_MISC_INCLUDED
-    #include <wolfcrypt/src/misc.c>
+#define WOLFSSL_MISC_INCLUDED
+#include <wolfcrypt/src/misc.c>
 #endif
 
 #define HMAC_MAX_RESULT_SIZE WC_SHA512_DIGEST_SIZE

+ 7 - 3
types/token_info.c

@@ -8,8 +8,8 @@
 #include "common.h"
 #include "../services/crypto/crypto_facade.h"
 
-#define ESTIMATE_BASE32_PLAIN_LENGTH(base32_length) ((base32_length) * 0.625f)
-#define ESTIMATE_BASE64_PLAIN_LENGTH(base64_length) ((base64_length) * 0.75f)
+#define ESTIMATE_BASE32_PLAIN_LENGTH(base32_length) ((base32_length)*0.625f)
+#define ESTIMATE_BASE64_PLAIN_LENGTH(base64_length) ((base64_length)*0.75f)
 
 TokenInfo* token_info_alloc() {
     TokenInfo* tokenInfo = malloc(sizeof(TokenInfo));
@@ -47,7 +47,11 @@ bool token_info_set_secret(
         plain_secret_length = plain_secret_size;
         plain_secret = malloc(plain_secret_size);
         furi_check(plain_secret != NULL);
-        if (Base64_Decode((const uint8_t*)plain_token_secret, token_secret_length, plain_secret, &plain_secret_length) != 0) {
+        if(Base64_Decode(
+               (const uint8_t*)plain_token_secret,
+               token_secret_length,
+               plain_secret,
+               &plain_secret_length) != 0) {
             plain_secret_length = 0;
         }
     } else {