security: Fixing bug with signing in SecTpmOsx
Change-Id: Id531a8ed1881a8f4cc98f625151219c7f3389645
diff --git a/src/security/identity/sec-tpm-osx.cpp b/src/security/identity/sec-tpm-osx.cpp
index 9fad367..f9954de 100644
--- a/src/security/identity/sec-tpm-osx.cpp
+++ b/src/security/identity/sec-tpm-osx.cpp
@@ -282,11 +282,10 @@
void
SecTpmOsx::sign(Data &data, const Name& keyName, DigestAlgorithm digestAlgorithm)
{
- const uint8_t *begin = data.wireEncode().value();
- const uint8_t *end = &*data.getSignature().getInfo().end();
-
- data.setSignature
- (sign(begin, end-begin, keyName, digestAlgorithm));
+ data.setSignatureValue
+ (sign(data.wireEncode().value(),
+ data.wireEncode().value_size() - data.getSignature().getValue().size(),
+ keyName, digestAlgorithm));
}
ConstBufferPtr