rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | python __anonymous () { |
| 2 | hsm_env_str = "" |
| 3 | |
| 4 | hsm_support = d.getVar('HSM_SUPPORT', True) |
| 5 | if hsm_support != 'yes': |
| 6 | d.setVar('HSM_SIGN_TOOL','') |
| 7 | d.setVar('HSM_SIGN_PARAM','') |
| 8 | d.setVar('HSM_ENV', '') |
| 9 | return |
| 10 | hsm_env_str += "HSM_SUPPORT=yes " |
| 11 | |
| 12 | top_dir = d.getVar('TOPDIR',True) |
| 13 | hsm_sign_tool_dir = top_dir+"/../src/devtools/hsmsigntool/" |
| 14 | |
| 15 | hsm_sign_tool = hsm_sign_tool_dir+"hsm_sign_tool" |
| 16 | hsm_env_str += "HSM_SIGN_TOOL=\""+hsm_sign_tool+"\" " |
| 17 | |
| 18 | hsm_sign_tool_conf = d.getVar('HSM_SIGN_TOOL_CONF',True) |
| 19 | if hsm_sign_tool_conf is None: |
| 20 | hsm_sign_tool_conf = hsm_sign_tool_dir+"hsm_sign_tool.conf" |
| 21 | hsm_env_str += "HSM_SIGN_TOOL_CONF=\""+hsm_sign_tool_conf+"\" " |
| 22 | |
| 23 | verified_key = d.getVar('VERIFIED_KEY') |
| 24 | hsm_env_str += "VERIFIED_KEY=\""+verified_key+"\" " |
| 25 | |
| 26 | softhsm2_conf = d.getVar('SOFTHSM2_CONF',True) |
| 27 | if softhsm2_conf is not None: |
| 28 | hsm_env_str += "SOFTHSM2_CONF=\""+softhsm2_conf+"\" " |
| 29 | |
| 30 | d.setVar('HSM_SIGN_TOOL',hsm_sign_tool) |
| 31 | d.setVar('HSM_SIGN_PARAM',' --signing_helper '+hsm_sign_tool) |
| 32 | d.setVar('HSM_ENV', hsm_env_str) |
| 33 | } |