Commit 6759b99e authored by Giovanni Bajo's avatar Giovanni Bajo Committed by Simon Kelley

Add function to extract algorithm number from context.

parent 3471f181
...@@ -45,5 +45,6 @@ struct VerifyAlgCtx ...@@ -45,5 +45,6 @@ struct VerifyAlgCtx
int verifyalg_supported(int algo); int verifyalg_supported(int algo);
VerifyAlgCtx* verifyalg_alloc(int algo); VerifyAlgCtx* verifyalg_alloc(int algo);
void verifyalg_free(VerifyAlgCtx *a); void verifyalg_free(VerifyAlgCtx *a);
int verifyalg_algonum(VerifyAlgCtx *a);
#endif /* DNSSEC_CRYPTO_H */ #endif /* DNSSEC_CRYPTO_H */
...@@ -201,3 +201,11 @@ void verifyalg_free(VerifyAlgCtx *a) ...@@ -201,3 +201,11 @@ void verifyalg_free(VerifyAlgCtx *a)
pool_used &= ~(1 << pool_idx); 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment