//
// sub_808A80 from 0x808a80 to 0x808b9c (284 bytes)
//
// 1 xrefs:
// > ??> @ 0xa322e8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall sub_808A80(int a1, int a2)
{
int v4; // r0
int v5; // r5
int v6; // r0
_DWORD *data; // r5
_DWORD *v8; // r0
int v9; // r1
_DWORD *v10; // r6
int v11; // r1
int v12; // r0
int v13; // r5
v4 = CRYPTO_zalloc(24, "crypto/hmac/hm_pmeth.c", 30);
v5 = v4;
if ( !v4 )
return 0;
*(_DWORD *)(v4 + 8) = 4;
v6 = HMAC_CTX_new(v4);
*(_DWORD *)(v5 + 20) = v6;
if ( !v6 )
{
CRYPTO_free(v5, "crypto/hmac/hm_pmeth.c", 36);
return 0;
}
*(_DWORD *)(a1 + 36) = 0;
*(_DWORD *)(a1 + 20) = v5;
data = (_DWORD *)EVP_PKEY_CTX_get_data(a2);
v8 = (_DWORD *)EVP_PKEY_CTX_get_data(a1);
v9 = data[5];
*v8 = *data;
v10 = v8;
if ( !HMAC_CTX_copy(v8[5], v9) || (v11 = data[3]) != 0 && !ASN1_OCTET_STRING_set(v10 + 1, v11, data[1]) )
{
v12 = EVP_PKEY_CTX_get_data(a1);
v13 = v12;
if ( v12 )
{
HMAC_CTX_free(*(_DWORD *)(v12 + 20));
CRYPTO_clear_free(*(_DWORD *)(v13 + 12), *(_DWORD *)(v13 + 4), "crypto/hmac/hm_pmeth.c", 78);
CRYPTO_free(v13, "crypto/hmac/hm_pmeth.c", 79);
EVP_PKEY_CTX_set_data(a1, 0);
return 0;
}
return 0;
}
return 1;
}