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

authentication with openssl causes illegal instruction #4

Open
rudieee6 opened this issue May 23, 2019 · 0 comments
Open

authentication with openssl causes illegal instruction #4

rudieee6 opened this issue May 23, 2019 · 0 comments

Comments

@rudieee6
Copy link

On an ARM Cortex A9 , the posting a request fails during execution of libcrypto code

(gdb) bt
#0 0xb58e3568 in _armv7_tick () from /usr/lib/libcrypto.so.1.0.0
#1 0xb58e00a0 in OPENSSL_cpuid_setup () from /usr/lib/libcrypto.so.1.0.0
#2 0xb6fe2430 in ?? () from /lib/ld-linux-armhf.so.3
#3 0x00000004 in ?? ()

It is well documented gdb will thrown an illegal instruction exception; however, even running without GDB, the post function yields a status code of zero and no valid data; the program continues and throws a DropboxException.

`DropboxAuthInfo DropboxWebAuth::getTokenFromCode(const DropboxAppInfo& appInfo, QString code)
{
QNetworkAccessManager mgr;
QEventLoop loop;
QUrl url(QString("https://%1/%2").arg(DropboxHost::DEFAULT().getApi()).arg("oauth2/token"));

QUrlQuery q;
q.addQueryItem("grant_type", "authorization_code");
q.addQueryItem("code", code.toStdString().c_str());
q.addQueryItem("client_id", appInfo.getKey().toStdString().c_str());
q.addQueryItem("client_secret", appInfo.getSecret().toStdString().c_str());
url.setQuery(q);

QNetworkRequest req(url);
req.setRawHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");

bool ok = false;
std::string errorInfo;
int status_code = 0;    
DropboxAuthInfo rv;
QByteArray nothing2post;
QNetworkReply *reply = mgr.post(req, nothing2post);`

Below is how the binary was compiled:

readelf -A authorize
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "7-A"
Tag_CPU_arch: v7
Tag_CPU_arch_profile: Application
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-2
Tag_FP_arch: VFPv3-D16
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_rounding: Needed
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_align_preserved: 8-byte, except leaf SP
Tag_ABI_enum_size: int
Tag_ABI_HardFP_use: SP and DP
Tag_ABI_VFP_args: VFP registers
Tag_CPU_unaligned_access: v6

I am unsure if this is an issue how openSSL was built or there needs to be more code to handle the openSSL exceptions.

gtalusan pushed a commit to kobolabs/dropboxQt that referenced this issue Sep 30, 2019
Remove brace initialization that vs2012 doesn't seem to like
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

1 participant