Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -----------------------------------
- #build
- [[email protected] ~/local/linux] gcc -g -lcrypto /home/siudin/fbsource/fbcode/kernel/sign-file/sign-file.c
- /home/siudin/fbsource/fbcode/kernel/sign-file/sign-file.c: In function ‘main’:
- /home/siudin/fbsource/fbcode/kernel/sign-file/sign-file.c:284:7: warning: implicit declaration of function ‘asprintf’; did you mean ‘vsprintf’? [-Wimplicit-function-declaration]
- ERR(asprintf(&dest_name, "%s.~signed~", module_name) < 0,
- ^~~~~~~~
- /home/siudin/fbsource/fbcode/kernel/sign-file/sign-file.c:106:18: note: in definition of macro ‘ERR’
- bool __cond = (cond); \
- ^~~~
- ---------------------------------
- #prepare module for experiments
- [[email protected] ~/local/linux] cp /lib/modules/5.2.9-229_fbk15_hardened_4185_g357f49b36602/kernel/net/sched/cls_tcindex.ko mods/
- [[email protected] ~/local/linux] modinfo mods/cls_tcindex.ko
- filename: /home/siudin/local/linux/mods/cls_tcindex.ko
- license: GPL
- srcversion: A95839E67E14DB82E6A8670
- depends:
- retpoline: Y
- intree: Y
- name: cls_tcindex
- vermagic: 5.2.9-229_fbk15_hardened_4185_g357f49b36602 SMP mod_unload modversions
- ---------------------------------
- #try to feed valid path via rfc7512-compliant URI
- [[email protected] ~/local/linux] ./a.out sha512 'pkcs11:module-path=/usr/local/lib64/libgoop11-hsm_backend.so' x509 ./mods/cls_tcindex.ko
- Failed to enumerate slots
- Failed to enumerate slots
- PKCS11_get_private_key returned NULL
- At main.c:162:
- - SSL error:FFFFFFFF80067065:pkcs11 engine:ctx_load_privkey:object not found: eng_back.c:975
- - SSL error:26096080:engine routines:ENGINE_load_private_key:failed loading private key: crypto/engine/eng_pkey.c:78
- a.out: pkcs11:module-path=/usr/local/lib64/libgoop11-hsm_backend.so: No such file or directory
- [[email protected] ~/local/linux] modinfo mods/cls_tcindex.ko
- filename: /home/siudin/local/linux/mods/cls_tcindex.ko
- license: GPL
- srcversion: A95839E67E14DB82E6A8670
- depends:
- retpoline: Y
- intree: Y
- name: cls_tcindex
- vermagic: 5.2.9-229_fbk15_hardened_4185_g357f49b36602 SMP mod_unload modversions
- ---------------------------------
- #try to feed bogus path via URI
- [[email protected] ~/local/linux] ./a.out sha512 'pkcs11:module-path=/obviously-broken-path.so' x509 ./mods/cls_tcindex.ko
- Failed to enumerate slots
- Failed to enumerate slots
- PKCS11_get_private_key returned NULL
- At main.c:160:
- - SSL error:FFFFFFFF80067065:pkcs11 engine:ctx_load_privkey:object not found: eng_back.c:975
- - SSL error:26096080:engine routines:ENGINE_load_private_key:failed loading private key: crypto/engine/eng_pkey.c:78
- a.out: pkcs11:module-path=/obviously-broken-path.so: No such file or directory
- [[email protected] ~/local/linux] modinfo mods/cls_tcindex.ko
- filename: /home/siudin/local/linux/mods/cls_tcindex.ko
- license: GPL
- srcversion: A95839E67E14DB82E6A8670
- depends:
- retpoline: Y
- intree: Y
- name: cls_tcindex
- vermagic: 5.2.9-229_fbk15_hardened_4185_g357f49b36602 SMP mod_unload modversions
- ---------------------------------
- #try to feed bogus module explicitly via ENGINE_ctrl_cmd_string(e, "MODULE_PATH",
- [[email protected] ~/local/linux] KBUILD_PKCS11_MODULE=/usr/local/lib64/obviously-wrong.so ./a.out sha512 'pkcs11:' x509 mods/cls_tcindex.ko
- /usr/local/lib64/obviously-wrong.so: cannot open shared object file: No such file or directory
- Unable to load module /usr/local/lib64/obviously-wrong.so
- /usr/local/lib64/obviously-wrong.so: cannot open shared object file: No such file or directory
- Unable to load module /usr/local/lib64/obviously-wrong.so
- PKCS11_get_private_key returned NULL
- At main.c:160:
- - SSL error:FFFFFFFF81065401:libp11:pkcs11_CTX_load:Unable to load PKCS#11 module: p11_load.c:79
- - SSL error:26096080:engine routines:ENGINE_load_private_key:failed loading private key: crypto/engine/eng_pkey.c:78
- a.out: pkcs11:: No such file or directory
- [[email protected] ~/local/linux] modinfo mods/cls_tcindex.ko
- filename: /home/siudin/local/linux/mods/cls_tcindex.ko
- license: GPL
- srcversion: A95839E67E14DB82E6A8670
- depends:
- retpoline: Y
- intree: Y
- name: cls_tcindex
- vermagic: 5.2.9-229_fbk15_hardened_4185_g357f49b36602 SMP mod_unload modversions
- ---------------------------------
- # try to feed correct module explicitly
- [[email protected] ~/local/linux] KBUILD_PKCS11_MODULE=/usr/local/lib64/libgoop11-hsm_backend.so ./a.out sha512 'pkcs11:' x509 mods/cls_tcindex.ko
- V0824 17:42:10.555155 1696387 crypto_impl.go:46] Client: &{<nil> 0xc0001987c8}
- V0824 17:42:10.558873 1696387 crypto_impl.go:46] Client: &{<nil> 0xc0001987c8}
- V0824 17:42:10.563652 1696387 crypto_impl.go:46] Client: &{<nil> 0xc0001987c8}
- V0824 17:42:10.564741 1696387 crypto_impl.go:46] Client: &{<nil> 0xc0001987c8}
- V0824 17:42:10.572171 1696387 crypto_impl.go:46] Client: &{<nil> 0xc0001987c8}
- [[email protected] ~/local/linux] modinfo mods/cls_tcindex.ko
- filename: /home/siudin/local/linux/mods/cls_tcindex.ko
- license: GPL
- srcversion: A95839E67E14DB82E6A8670
- depends:
- retpoline: Y
- intree: Y
- name: cls_tcindex
- vermagic: 5.2.9-229_fbk15_hardened_4185_g357f49b36602 SMP mod_unload modversions
- sig_id: PKCS#7
- signer: HSM TestOrg
- sig_key: 5F:98:4C:C0:51:DC:7C:7C
- sig_hashalgo: sha512
- signature: 30:B3:08:A2:E0:F0:5C:B6:17:3C:B3:D0:CB:64:2A:3A:54:A8:0A:9D:
- ED:ED:04:91:91:3C:B5:D8:D5:A2:70:D0:A2:63:45:FC:50:66:89:59:
- 9A:82:B1:27:6C:45:0B:0A:BA:33:23:8C:2D:FD:3F:96:31:B0:4E:81:
Add Comment
Please, Sign In to add comment