-
Notifications
You must be signed in to change notification settings - Fork 7
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
[WIP] Remove associated OTR keys when account is removed #95
base: master
Are you sure you want to change the base?
Conversation
6f06513
to
5e5638f
Compare
chrome/content/otr.js
Outdated
let newKey = new libOTR.s_pending_privkey_calc(); | ||
newKey.accountname = libC.strdup(key.contents.accountname); | ||
newKey.protocol = libC.strdup(key.contents.protocol); | ||
newKey.privkey = key.contents.privkey; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have trouble with this, would love to hear your ideas here. @arlolra
I tried with length = gcry_sexp_sprint(); gcry_sexp_new(newKey.privkey, key.contents.privkey, length, {0,1})
but it didn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried with
length = gcry_sexp_sprint();
I'm assuming you mean gcry_sexp_length
?
gcry_sexp_new(newKey.privkey, key.contents.privkey, length, {0,1})
but it didn't work.
The definition of gcry_sexp_new
is such that the second argument is expected to be "its external representation" but here key.contents.privkey
has already been parsed.
I would say to get it working with a memcpy
for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming you mean
gcry_sexp_length
?
Sorry, I should write it clearly. I meant length = gcry_sexp_sprint(privkey, {0,1,2,3}, null, 0)
. gcry_sexp_length
doesn't seem to work here (gcry_sexp_length(key.contents.privkey)
always returns 2).
Yeah, the calls to |
I think it works now. Tested with a Linux build applied TheTorProject/tor-messenger-build#15. |
We need to use memcpy instead of assigning the pointer directly https://github.com/arlolra/ctypes-otr/pull/95/files#diff-0ae302860237c1727af8cba50ff6e1c6R272. Currently the app crashes because of "double free" (perhaps).