GateKeeper.cpp
changeset 128 a026de7eb3cd
parent 127 7f39af9b8dee
child 129 9985c2d61311
     1.1 --- a/GateKeeper.cpp	Fri Jun 24 22:24:47 2016 +0200
     1.2 +++ b/GateKeeper.cpp	Fri Jun 24 22:52:55 2016 +0200
     1.3 @@ -382,6 +382,8 @@
     1.4          HANDLE hFile = NULL;
     1.5          char *unencrypted_buffer = NULL;
     1.6  
     1.7 +        char nonce[12];
     1.8 +
     1.9          ULONG unencrypted_size;
    1.10          NTSTATUS status = BCryptDecrypt(dk, (PUCHAR) crypted.data(), crypted.size(),
    1.11                  NULL, NULL, 0, NULL, 0, &unencrypted_size, 0);
    1.12 @@ -437,6 +439,9 @@
    1.13          assert(status == 0);
    1.14          if (status)
    1.15              goto closing;
    1.16 +        status = BCryptSetProperty(hAES, BCRYPT_CHAINING_MODE, (PUCHAR) BCRYPT_CHAIN_MODE_CCM, sizeof(BCRYPT_CHAIN_MODE_CCM), 0);
    1.17 +        if (status)
    1.18 +            goto closing;
    1.19  
    1.20          status = BCryptOpenAlgorithmProvider(&hRSA, BCRYPT_RSA_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0);
    1.21          assert(status == 0);