Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AskForHelp: Can not run ego sign #138

Closed
Laisky opened this issue Jun 10, 2022 · 3 comments
Closed

AskForHelp: Can not run ego sign #138

Laisky opened this issue Jun 10, 2022 · 3 comments

Comments

@Laisky
Copy link

Laisky commented Jun 10, 2022

Issue description

got a lot of error run ego-sign.

To reproduce

I tried to write a wrapper SDK with ego,
you can reproduce with:

package main

import (
	"fmt"

	xego "github.com/Laisky/xego"
)

func main() {
	fmt.Println(xego.Report{})
}

then:

ego-go build server.go
ego sign server.go

got:

EGo v0.5.0 (19fe24700941af32c196bce44ded7afc3e54f87f)
2022-06-10T08:09:44+0000.256659Z [(H)ERROR] tid(0x7fe489759740) | symbol not found: X509_free [/opt/intel/edgelessrt/build/3rdparty/openenclave/openenclave-src/host/sgx/loadelf.c:_link_elf_image:827]
2022-06-10T08:09:44+0000.287137Z [(H)ERROR] tid(0x7fe489759740) | symbol not found: OPENSSL_sk_value [/opt/intel/edgelessrt/build/3rdparty/openenclave/openenclave-src/host/sgx/loadelf.c:_link_elf_image:827]
2022-06-10T08:09:44+0000.307510Z [(H)ERROR] tid(0x7fe489759740) | symbol not found: EVP_PKEY_sign [/opt/intel/edgelessrt/build/3rdparty/openenclave/openenclave-src/host/sgx/loadelf.c:_link_elf_image:827]
2022-06-10T08:09:44+0000.322884Z [(H)ERROR] tid(0x7fe489759740) | symbol not found: X509_verify_cert [/opt/intel/edgelessrt/build/3rdparty/openenclave/openenclave-src/host/sgx/loadelf.c:_link_elf_image:827]
......

After some searching I found this: https://github.com/edgelesssys/ego/tree/master/samples/cgo

➜ ldd server
        linux-vdso.so.1 (0x00007ffdb22ed000)
        libcrypto.so.1.1 => /lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007f375ff5c000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f375ff56000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f375ff33000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f375fd41000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f37605c5000)

I don't know much about C++ and my understanding is that I should make libcrypt.so a static link, but I don't quite understand how to do that, could you kindly provide some help please?

@thomasten
Copy link
Member

Hi,
The problem is that you import the eclient package in your package:
https://github.com/Laisky/xego/blob/9b786cfade57fb9d817e6281f7d8487890ec6b5d/client.go#L18
I suggest you move client.go into a different package, e.g., create a subpackage xego/client.

@Laisky
Copy link
Author

Laisky commented Jun 10, 2022

Hi, The problem is that you import the eclient package in your package: https://github.com/Laisky/xego/blob/9b786cfade57fb9d817e6281f7d8487890ec6b5d/client.go#L18 I suggest you move client.go into a different package, e.g., create a subpackage xego/client.

Thank you so much for such quickly response, it really solved my problem!

Could you briefly explain why, it would help me a lot.

@thomasten
Copy link
Member

As stated in the package docs, this package is only for "programs that don't run in an enclave themselves but interact with enclaved programs". It requires dependencies that can't be resolved in the enclave.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants