Commit 014d7c2
committed
Populate attributes in Python Signature
ctypes.Structure.__init__() initializes Signature attributes using the
list _fields_. However, these are empty because this happens before
native().OQS_SIG_new() is called.
The dict self.details was showing correct values by reading and
decoding directly from self._sig. However, all the other public
attributes like self.method_name, self.alg_version or the keys and
signature lengths were incorrect. Either None or 0 depending on the
ctype defined in _fields_.
Instead, let's manually populate all relevant attributes from _fields_
after OQS_SIG_new() is called, and let's use those values to create the
dict self.details.
Signed-off-by: Iyán Méndez Veiga <[email protected]>1 parent 9e64e12 commit 014d7c2
1 file changed
+18
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
415 | 425 | | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
424 | 434 | | |
425 | 435 | | |
426 | 436 | | |
| |||
0 commit comments