[OTR-dev] Active fingerprint context pointer possible issue

David Goulet dgoulet at ev0ke.net
Thu Nov 22 09:29:26 EST 2012

Hash: SHA512

Hi Ian,

Yes I figured after sending the last email that it might be confusing
on what I'm trying to do :). Here goes.

I'm currently working on the Irssi OTR module and I added a command to
forget a given fingerprint. So either the user does the command within
the chat window where for this case I have access to the OTR context
so no need to pass a fingerprint to the command or the user specifies
the human readable form of the fingerprint. (available fingerprints
can be listed using an other command.)

With the later, the only thing I have is the string fingerprint (fp)
so, for now, the only solution I came up with is to iterate over all
OTR contexts of the user state for which I iterate over all fps and
try to match the fp using the otrl_privkey_hash_to_human() and, on
match, using otrl_context_find_fingerprint() for the fp object pointer.

Once getting this pointer, I have to check to see if this fp is NOT in
an ENCRYPTED context before forgetting it.

Here lies my problem, the fp->context always point to the m_context
which does not indicates me the right message state. For now, I've
fixed my problem by returning back the context of the fp previously
found with otrl_context_find_fingerprint() but I guess I should be
able to access all associated context(s) of the fp and make sure it's
safe to forget it? I guess, iterating on them starting with
m_context->next ?

TBH, I'm just confused on how to proceed safely.

Hope this is clearer :)

Thanks a lot!

Ian Goldberg:
> On Wed, Nov 21, 2012 at 04:42:31PM -0500, David Goulet wrote:
>>> Is the issue that active_fingerprint->context is pointing to
>>> the master context?  (i.e. is ctx->m_context == 
>>> ctx->active_fingerprint->context ?) If not, can you tell where
>>> it is pointing?
>> Yes it is!
>> So, what's the procedure here if I want to get the "current"
>> context of the active fingerprint to verify it's message state?
>> Thanks! David
> David,
> Can you say a little more about what you're trying to do?  I'm not
> sure I follow.  You're in a gone_secure callback, and you want to
> make sure you really are in ENCRYPTED?  I would hope that would
> always be true, but just looking at ctx directly would tell you.
> How does the active fingerprint fit in?
> Thanks,
> - Ian
> [Note that I will be offline pretty much the rest of today, for
> reasons obvious to people in the US.  ;-) ] 
> _______________________________________________ OTR-dev mailing
> list OTR-dev at lists.cypherpunks.ca 
> http://lists.cypherpunks.ca/mailman/listinfo/otr-dev
Version: GnuPG v1.4.12 (GNU/Linux)


More information about the OTR-dev mailing list