Giter Site home page Giter Site logo

Comments (2)

stefanberger avatar stefanberger commented on August 16, 2024

Instrumentation of the code and displaying the offsets into the buffer and pointers shows that this is indeed a false positive.

diff --git a/src/tpm2/AlgorithmTests.c b/src/tpm2/AlgorithmTests.c
index 08ee6b02..479ad5c0 100644
--- a/src/tpm2/AlgorithmTests.c
+++ b/src/tpm2/AlgorithmTests.c
@@ -196,8 +196,10 @@ MakeIv(
        }
     else
        {
-           for(i = 0; i < size; i++)
+           for(i = 0; i < size; i++) {
+               fprintf(stderr, "iv: %p, i: %d\n", iv, i);
                *iv++ = i;
+           }
        }
     return size;
 }
@@ -220,6 +222,7 @@ TestSymmetricAlgorithm(

     //
     // Get the appropriate IV
+    fprintf(stderr,"==> buffer: %p\n", &iv.t.buffer[0]);
     iv.t.size = (UINT16)MakeIv(mode, test->ivSize, iv.t.buffer);
     // Encrypt known data
     CryptSymmetricEncrypt(encrypted, test->alg, test->keyBits, test->key, &iv,

from libtpms.

stefanberger avatar stefanberger commented on August 16, 2024

For the record. This patch here resolves this issue [I will not apply it upstream]:

Do not inline MakeIV due toppc64 compiler issue

The ppc64 gcc compiler has an issue with MakeIv.

---
 src/tpm2/AlgorithmTests.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/src/tpm2/AlgorithmTests.c
+++ b/src/tpm2/AlgorithmTests.c
@@ -179,6 +179,9 @@
 /* 10.2.1.4.1 MakeIv() */
 /* Internal function to make the appropriate IV depending on the mode. */
 static UINT32
+#if defined(__powerpc64__)
+__attribute__((noinline))
+#endif
 MakeIv(
        TPM_ALG_ID    mode,     // IN: symmetric mode
        UINT32        size,     // IN: block size of the algorithm

from libtpms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.