libkcapi - エラー:Netlinkエラー:netlinkソケットを開けません。

libkcapi - エラー:Netlinkエラー:netlinkソケットを開けません。

私はランダムジェネレータを使用しようとしています。クカピ試してみてください。

私がしたことは次のとおりです。

$ wget http://www.chronox.de/libkcapi/libkcapi-0.13.0.tar.xz
$ tar xf libkcapi-0.13.0.tar.xz
$ cd libkcapi-0.13.0
$ cd lib
$ make
$ cd ../test
$ make
$ ./kcapi -x 3  -c sha1  -p 8c899bba
libkcapi - Error: Netlink error: cannot open netlink socket
libkcapi - Error: Netlink error: cannot open netlink socket
libkcapi - Error: NETLINK_CRYPTO: cannot obtain cipher information for sha1 (is required crypto_user.c patch missing? see documentation)
Allocation of hash sha1 failed
Failed to invoke testing

strace 出力を見ると、次のようになります。

socket(AF_NETLINK, SOCK_RAW, NETLINK_CRYPTO) = -1 EPROTONOSUPPORT (Protocol not supported)
write(2, "libkcapi - Error: Netlink error:"..., 60libkcapi - Error: Netlink error: cannot open netlink socket
) = 60
socket(AF_NETLINK, SOCK_RAW, NETLINK_CRYPTO) = -1 EPROTONOSUPPORT (Protocol not supported)
write(2, "libkcapi - Error: Netlink error:"..., 60libkcapi - Error: Netlink error: cannot open netlink socket
) = 60
write(2, "libkcapi - Error: NETLINK_CRYPTO"..., 137libkcapi - Error: NETLINK_CRYPTO: cannot obtain cipher information for sha1 (is required crypto_user.c patch missing? see documentation)

トップレベルのREADME.mdファイルで述べたように:

カーネルインタフェースとこのライブラリは、権限のないプロセスで使用できます。

私も試してみましたが、sudo運がありませんでした。

ちなみに私は以下を使用しています。

$ uname -a
Linux macbookpro 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64 GNU/Linux

libkcapiLinuxでこれを使用する方法を知っている人はいますか?

ベストアンサー1

実際、答えは簡単です。ドキュメントから:

以下が必要です。

  • CONFIG_CRYPTO_USER
  • CONFIG_CRYPTO_USER_API
  • CONFIG_CRYPTO_USER_API_HASH
  • CONFIG_CRYPTO_USER_API_SKCIPHER
  • CONFIG_CRYPTO_USER_API_AEAD
  • CONFIG_CRYPTO_USER_API_RNG
  • (CONFIG_CRYPTO_USER_API_AKCIPHER)不要

しかし、これはデフォルトのDebianカーネルを使って得たものです:

% grep CONFIG_CRYPTO_USER /boot/config-4.9.0-3-amd64 
# CONFIG_CRYPTO_USER is not set
CONFIG_CRYPTO_USER_API=m
CONFIG_CRYPTO_USER_API_HASH=m
CONFIG_CRYPTO_USER_API_SKCIPHER=m
# CONFIG_CRYPTO_USER_API_RNG is not set
CONFIG_CRYPTO_USER_API_AEAD=m

報告しましたが、何が起こるのか見てみましょう。

おすすめ記事