Fixes for ECDSA signature 18/12518/1
authorMauro Sardara <[email protected]>
Thu, 10 May 2018 09:11:48 +0000 (11:11 +0200)
committerMauro Sardara <[email protected]>
Thu, 10 May 2018 09:11:48 +0000 (11:11 +0200)
Change-Id: I0345d16e22024419e0a538c0a09376ef74b8e440
Signed-off-by: Mauro Sardara <[email protected]>
libparc/parc/security/parc_InMemoryVerifier.c
libparc/parc/security/parc_Pkcs12KeyStore.c

index e5946d3..c3af4d7 100644 (file)
@@ -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))),
index fd12c56..392c9d3 100644 (file)
@@ -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) {