2016-03-26 18:06:05

by Jeffrey Walton

[permalink] [raw]
Subject: How to detect availability of asynchronous ciphers at runtime?

Hi Everyone,

Please forgive my ignorance here... I'm trying to detect the
availability of asynchronous ciphers support at runtime. The back
story is there's some feature tests going on based on hard coded
kernel version numbers (namely, 4.1). I feel like there's probably a
better way to go about it.

It seems like 'socket(AF_ALG, ...)' is not enough since that only
detects availability of userland crypto support.

How do I detect the availability of asynchronous ciphers at runtime?

Thank you in advance.


2016-03-26 18:09:29

by Vladimir Zapolskiy

[permalink] [raw]
Subject: Re: How to detect availability of asynchronous ciphers at runtime?

On 26.03.2016 20:06, Jeffrey Walton wrote:
> Hi Everyone,
>
> Please forgive my ignorance here... I'm trying to detect the
> availability of asynchronous ciphers support at runtime. The back
> story is there's some feature tests going on based on hard coded
> kernel version numbers (namely, 4.1). I feel like there's probably a
> better way to go about it.
>
> It seems like 'socket(AF_ALG, ...)' is not enough since that only
> detects availability of userland crypto support.
>
> How do I detect the availability of asynchronous ciphers at runtime?
>
> Thank you in advance.

Try this method:

# cat /proc/crypto | egrep '^(name|driver|async|$)'

--
With best wishes,
Vladimir