AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题 / 1510368
Accepted
Jiří Malák
Jiří Malák
Asked: 2019-12-17 02:23:39 +0800 CST2019-12-17 02:23:39 +0800 CST 2019-12-17 02:23:39 +0800 CST

配置 WPA 请求者以使用 tpm2 pkcs11 工具

  • 772

我想将 WPA 请求者配置为使用 TPM 2.0 托管证书进行身份验证,以便连接到公司网络。

我创建了由我的 TPM 管理的 RSA 密钥对,生成了 CSR 并收到了由公司 CA 签名的证书。现在我需要配置 WPA 请求者以使用此证书,发现只有 1 个对 TPM 1.0 有效的示例:

https://w1.fi/cgit/hostap/plain/wpa_supplicant/examples/openCryptoki.conf

# EAP-TLS using private key and certificates via OpenSSL PKCS#11 engine and
# openCryptoki (e.g., with TPM token)

# This example uses following PKCS#11 objects:
# $ pkcs11-tool --module /usr/lib/opencryptoki/libopencryptoki.so  -O -l
# Please enter User PIN:
# Private Key Object; RSA
#   label:      rsakey
#   ID:         04
#   Usage:      decrypt, sign, unwrap
# Certificate Object, type = X.509 cert
#   label:      ca
#   ID:         01
# Certificate Object, type = X.509 cert
#   label:      cert
#   ID:         04

# Configure OpenSSL to load the PKCS#11 engine and openCryptoki module
pkcs11_engine_path=/usr/lib/engines/engine_pkcs11.so
pkcs11_module_path=/usr/lib/opencryptoki/libopencryptoki.so

network={
    ssid="test network"
    key_mgmt=WPA-EAP
    eap=TLS
    identity="User"

    # use OpenSSL PKCS#11 engine for this network
    engine=1
    engine_id="pkcs11"

    # select the private key and certificates based on ID (see pkcs11-tool
    # output above)
    key_id="4"
    cert_id="4"
    ca_cert_id="1"

    # set the PIN code; leave this out to configure the PIN to be requested
    # interactively when needed (e.g., via wpa_gui or wpa_cli)
    pin="123456"
}

当我更改pkcs11_engine_path与pkcs11_module_pathTPM 2.0 兼容实用程序的路径时,如何在此配置中使用我的证书?我也应该让它由 TPM 管理吗?如何管理?

提前感谢您的帮助。

linux certificate
  • 2 2 个回答
  • 799 Views

2 个回答

  • Voted
  1. Best Answer
    user1686
    2019-12-17T02:40:03+08:002019-12-17T02:40:03+08:00

    您不需要特定于 TPM 的 PKCS#11 示例——它们的工作方式与任何其他 PKCS#11 模块一样。如果你可以让它与 Yubikey 或 SoftHSM2 一起工作,那么它应该与 tpm2-pkcs11 完全相同。

    是的,许多程序都希望证书可以通过与相应密钥相同的 PKCS#11 模块进行访问。导入证书的功能实际上是在几天前添加到 tpm2-pkcs11 中的。(如果您打算从 Git master 构建,请注意 DB 格式也已更改。)

    但是,wpa_supplicant(如果使用 OpenSSL)现在可以识别“pkcs11:”URI 并自动加载 engine_pkcs11;您不再需要使用engine=orkey_id=选项。相反,您可以使用:

    network={
        ssid="test network"
        key_mgmt=WPA-EAP
        eap=TLS
        identity="User"
        client_cert="pkcs11:model=NPCT75x;token=JM;object=myfirstcert;type=certificate"
        private_key="pkcs11:model=NPCT75x;token=JM;object=myfirstcert;type=private"
    }
    

    所以理论上这应该允许你指定一个本地文件路径作为客户端证书,同时仍然使用一个令牌 URI 作为私钥。

    • 2
  2. Spotter
    2020-05-16T17:29:15+08:002020-05-16T17:29:15+08:00

    这对我有用:

    network={
        ssid="test network"
        key_mgmt=WPA-EAP
        eap=TLS
        identity="User"
        ca_cert="pkcs11:id=%03;type=cert"
        client_cert="pkcs11:id=%04;type=cert"
        private_key="pkcs11:id=%04;type=private;pin-value=123456"
    }
    

    请注意,类型是“证书”而不是“证书”。即使未使用(插槽 9e),也需要在 private_key 上显示 pin-value。

    • 0

相关问题

  • 如何让我的 Linux 机器看起来像是在运行 Windows?

  • 对于 cp 或 mv,是否有等同于 cd - 的东西?

  • 以 root 身份运行 docker 容器

  • 如何在域和 Linux 活动目录中启用指纹传感器

  • 如何在CentOS 7 中将Ctrl+C 永久更改为Ctrl+K?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    Windows 10 服务称为 AarSvc_70f961。它是什么,我该如何禁用它?

    • 2 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Marko Smith

    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1056)

    • 4 个回答
  • Marko Smith

    我如何知道 Windows 安装在哪个驱动器上?

    • 6 个回答
  • Martin Hope
    Albin 支持结束后如何激活 WindowsXP? 2019-11-18 03:50:17 +0800 CST
  • Martin Hope
    fixer1234 “HTTPS Everywhere”仍然相关吗? 2019-10-27 18:06:25 +0800 CST
  • Martin Hope
    Kagaratsch Windows 10 删除大量小文件的速度非常慢。有什么办法可以加快速度吗? 2019-09-23 06:05:43 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    Inter Sys Ctrl+C 和 Ctrl+V 是如何工作的? 2019-05-15 02:51:21 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve