From a53bc7260df2723a2d17ef18311e63c79d06823f Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Thu, 10 May 2018 11:11:48 +0200 Subject: Fixes for ECDSA signature Change-Id: I0345d16e22024419e0a538c0a09376ef74b8e440 Signed-off-by: Mauro Sardara --- libparc/parc/security/parc_InMemoryVerifier.c | 2 +- libparc/parc/security/parc_Pkcs12KeyStore.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'libparc/parc/security') diff --git a/libparc/parc/security/parc_InMemoryVerifier.c b/libparc/parc/security/parc_InMemoryVerifier.c index e5946d33..c3af4d7d 100644 --- a/libparc/parc/security/parc_InMemoryVerifier.c +++ b/libparc/parc/security/parc_InMemoryVerifier.c @@ -363,7 +363,7 @@ _parcInMemoryVerifier_ECDSAKey_Verify(PARCInMemoryVerifier *verifier, PARCCrypto PARCByteArray *bytearray = parcBuffer_Array(sigbits); unsigned signatureLength = (unsigned) parcBuffer_Remaining(sigbits); uint8_t *sigbuffer = parcByteArray_Array(bytearray); - size_t signatureOffset = parcBuffer_ArrayOffset(sigbits); + size_t signatureOffset = parcBuffer_Position(sigbits); success = ECDSA_verify(openssl_digest_type, (unsigned char *) parcByteArray_Array(parcBuffer_Array(parcCryptoHash_GetDigest(localHash))), diff --git a/libparc/parc/security/parc_Pkcs12KeyStore.c b/libparc/parc/security/parc_Pkcs12KeyStore.c index fd12c56f..392c9d34 100644 --- a/libparc/parc/security/parc_Pkcs12KeyStore.c +++ b/libparc/parc/security/parc_Pkcs12KeyStore.c @@ -311,6 +311,7 @@ _GetPublickKeyDigest(PARCPkcs12KeyStore *keystore) assertNotNull(keystore, "Parameter must be non-null PARCPkcs12KeyStore"); +#if 0 if (keystore->public_key_digest == NULL) { AUTHORITY_KEYID *akid = X509_get_ext_d2i(keystore->x509_cert, NID_authority_key_identifier, NULL, NULL); if (akid != NULL) { @@ -324,6 +325,7 @@ _GetPublickKeyDigest(PARCPkcs12KeyStore *keystore) AUTHORITY_KEYID_free(akid); } } +#endif // If we could not load the digest from the certificate, then calculate it from the public key. if (keystore->public_key_digest == NULL) { -- cgit 1.2.3-korg