Add function to extract algorithm number from context.

This commit is contained in:
Giovanni Bajo authored and Simon Kelley committed 2013-08-20 15:41:20 +01:00
1 parent 3471f18130
commit 6759b99e28
2 files changed
+9

No files matched your search

+1
View File
@@ -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 */
+8
View File
@@ -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;
}