mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "Release the memory allocated in the algorithm to prevent memory leaks" am: a3fe17250d am: a80338f802 am: 89b620d117 am: d6835f6346
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2186106 Change-Id: I6ad3f54784ab9424c8e62a3b86a3a9945214ebbe Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -100,6 +100,7 @@ void eicOpsHmacSha256Final(EicHmacSha256Ctx* ctx, uint8_t digest[EIC_SHA256_DIGE
|
||||
if (size != EIC_SHA256_DIGEST_SIZE) {
|
||||
LOG(ERROR) << "Expected 32 bytes from HMAC_Final, got " << size;
|
||||
}
|
||||
HMAC_CTX_cleanup(realCtx);
|
||||
}
|
||||
|
||||
void eicOpsSha256Init(EicSha256Ctx* ctx) {
|
||||
@@ -394,14 +395,17 @@ bool eicOpsEcDsa(const uint8_t privateKey[EIC_P256_PRIV_KEY_SIZE],
|
||||
}
|
||||
|
||||
if (BN_bn2binpad(sig->r, signature, 32) != 32) {
|
||||
ECDSA_SIG_free(sig);
|
||||
eicDebug("Error encoding r");
|
||||
return false;
|
||||
}
|
||||
if (BN_bn2binpad(sig->s, signature + 32, 32) != 32) {
|
||||
ECDSA_SIG_free(sig);
|
||||
eicDebug("Error encoding s");
|
||||
return false;
|
||||
}
|
||||
|
||||
ECDSA_SIG_free(sig);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user