Lorel / 0MQRxLua-MFR-POC

Try map filter reduce based on 0MQ and RxLua (et un peu de SGX)
0 stars 0 forks source link

Improve decoding of sgxprocess output #10

Closed Lorel closed 7 years ago

Lorel commented 7 years ago

sgxprocess returns a string which should have been encoded in JSON, and so this string is decoded from JSON But if an error occurs inside the SGX enclave, a non-JSON sting is returned by sgxprocess Those cjson.decode raise an error:

/usr/local/lib/lua/5.3/zmq-rx.lua:111: Error: /usr/local/lib/lua/5.3/sgx.lua:65: Expected value but found invalid token at character 1

The encoding of the return value from sgxprocess has to be checked, and in case of non-JSON value, the string value has to be returned as it is