Skip to content

"FIXME: cancel the operation when we exit the generator early." #75

@figbux

Description

@figbux

Hello,

I'm facing this not-fixed issue due to cancelling an operation in the middle. In my specific case, I have to cancel before finishing; so I have to overcome this issue.

For encryption, I overcame this by adding an _encrypt_halt() method, which used to work fine:

     # call this in OperationActive exception
     def _encrypt_halt(self):
        cdef CK_BYTE [:] tmp_out = CK_BYTE_buffer(8192)
        cdef CK_ULONG tmp_len = 8192
        # try to consume the buffer
        assertRV(_funclist.C_EncryptFinal(self.session._handle,
                                &tmp_out[0], &tmp_len))

But I think this is a hack, not the proper way. Doing similar for sign/verify functions etc. not working; so I've decided to really fix the issue.

What is the best way of cancelling an operation? Hopefully I'll implement it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions