未验证 提交 74ae38c3 编写于 作者: Y YangLiang 提交者: GitHub

ra-tls: Fix an error and remove a hardcode

In python, range paramter should use int type instead of float. And remove SGX_UNLINKABLE_SIGNATURE hardcode by variant quote_type.
Signed-off-by: NLiang Yang <liang3.yang@intel.com>
上级 4047a18a
......@@ -16,7 +16,7 @@ if ( [[ "$QUOTE_TYPE" != "SGX_LINKABLE_SIGNATURE" ]] ) && \
echo "//QUOTE_TYPE must be one of SGX_UNLINKABLE_SIGNATURE or SGX_LINKABLE_SIGNATURE"
fi
SPID_BYTE_ARRAY=$(echo $SPID | python -c 'import sys ; s = sys.stdin.readline().strip(); print("".join(["0x"+s[2*i:2*i+2]+"," for i in range(len(s)/2)]))')
SPID_BYTE_ARRAY=$(echo $SPID | python -c 'import sys ; s = sys.stdin.readline().strip(); print("".join(["0x"+s[2*i:2*i+2]+"," for i in range(int(len(s)/2))]))')
cat <<HEREDOC
#include "ra-attester.h"
......@@ -24,7 +24,7 @@ cat <<HEREDOC
struct ra_tls_options my_ra_tls_options = {
// SPID format is 32 hex-character string, e.g., 0123456789abcdef0123456789abcdef
.spid = {{$SPID_BYTE_ARRAY}},
.quote_type = SGX_UNLINKABLE_SIGNATURE,
.quote_type = $QUOTE_TYPE,
.ias_server = "api.trustedservices.intel.com/sgx/dev",
// EPID_SUBSCRIPTION_KEY format is "012345679abcdef012345679abcdef"
.subscription_key = "$EPID_SUBSCRIPTION_KEY"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册