mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Add function to extract algorithm number from context.
This commit is contained in:
committed by
Simon Kelley
parent
3471f18130
commit
6759b99e28
@@ -45,5 +45,6 @@ struct VerifyAlgCtx
|
||||
int verifyalg_supported(int algo);
|
||||
VerifyAlgCtx* verifyalg_alloc(int algo);
|
||||
void verifyalg_free(VerifyAlgCtx *a);
|
||||
int verifyalg_algonum(VerifyAlgCtx *a);
|
||||
|
||||
#endif /* DNSSEC_CRYPTO_H */
|
||||
|
||||
@@ -201,3 +201,11 @@ void verifyalg_free(VerifyAlgCtx *a)
|
||||
|
||||
pool_used &= ~(1 << pool_idx);
|
||||
}
|
||||
|
||||
int verifyalg_algonum(VerifyAlgCtx *a)
|
||||
{
|
||||
int num = a->vtbl - valgs;
|
||||
if (num < 0 || num >= countof(valgs))
|
||||
return -1;
|
||||
return num;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user