| 871eec00 | 22-Apr-2020 |
John Baldwin <[email protected]> |
Update blake2 accelerated software tests to work after OCF refactoring.
- Lookup device drivers to test by name instead of assuming that the software / hardware flags will select specific drivers.
Update blake2 accelerated software tests to work after OCF refactoring.
- Lookup device drivers to test by name instead of assuming that the software / hardware flags will select specific drivers. - Set the sysctl to permit software /dev/crypto requests when testing the accelerated software blake2 driver.
PR: 245825 Reported by: lwhsu Reviewed by: cem, lwhsu Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24540
show more ...
|
| f2a34445 | 21-May-2019 |
Enji Cooper <[email protected]> |
Add my name to the copyright
I have contributed a number of changes to these tests over the past few hundred revisions, and believe I deserve credit for the changes I have made (plus, the copyright
Add my name to the copyright
I have contributed a number of changes to these tests over the past few hundred revisions, and believe I deserve credit for the changes I have made (plus, the copyright hadn't been updated since 2014).
MFC after: 1 week
show more ...
|
| ef02523d | 21-May-2019 |
Enji Cooper <[email protected]> |
Follow up to r348042: cast `aad` to a byte array
This is not completely necessary today, but this change is being made in a conservative manner to avoid accidental breakage in the future, if this ev
Follow up to r348042: cast `aad` to a byte array
This is not completely necessary today, but this change is being made in a conservative manner to avoid accidental breakage in the future, if this ever was a unicode string.
PR: 237403 MFC after: 1 week
show more ...
|
| ffbc8cc0 | 21-May-2019 |
Enji Cooper <[email protected]> |
Fix encoding issues with python 3
In python 3, the default encoding was switched from ascii character sets to unicode character sets in order to support internationalization by default. Some interfa
Fix encoding issues with python 3
In python 3, the default encoding was switched from ascii character sets to unicode character sets in order to support internationalization by default. Some interfaces, like ioctls and packets, however, specify data in terms of non-unicode encodings formats, either in host endian (`fcntl.ioctl`) or network endian (`dpkt`) byte order/format.
This change alters assumptions made by previous code where it was all data objects were assumed to be basestrings, when they should have been treated as byte arrays. In order to achieve this the following are done: * str objects with encodings needing to be encoded as ascii byte arrays are done so via `.encode("ascii")`. In order for this to work on python 3 in a type agnostic way (as it anecdotally varied depending on the caller), call `.encode("ascii")` only on str objects with python 3 to cast them to ascii byte arrays in a helper function name `str_to_ascii(..)`. * `dpkt.Packet` objects needing to be passed in to `fcntl.ioctl(..)` are done so by casting them to byte arrays via `bytes()`, which calls `dpkt.Packet__str__` under the covers and does the necessary str to byte array conversion needed for the `dpkt` APIs and `struct` module.
In order to accomodate this change, apply the necessary typecasting for the byte array literal in order to search `fop.name` for nul bytes.
This resolves all remaining python 2.x and python 3.x compatibility issues on amd64. More work needs to be done for the tests to function with i386, in general (this is a legacy issue).
PR: 237403 MFC after: 1 week Tested with: python 2.7.16 (amd64), python 3.6.8 (amd64)
show more ...
|
| f6d7fcda | 21-May-2019 |
Enji Cooper <[email protected]> |
Remove spurious newline
Even though some python styles suggest there should be multiple newlines between methods/classes, for consistency with the surrounding code, it's best to be consistent by hav
Remove spurious newline
Even though some python styles suggest there should be multiple newlines between methods/classes, for consistency with the surrounding code, it's best to be consistent by having merely one newline between each functional block.
MFC after: 1 week
show more ...
|
| a60d9a98 | 21-May-2019 |
Enji Cooper <[email protected]> |
Fix `KAT(CCM)?Parser` file descriptor leaks
Make `KAT(CCM)?Parser` into a context suite-capable object by implementing `__enter__` and `__exit__` methods which manage opening up the file descriptors
Fix `KAT(CCM)?Parser` file descriptor leaks
Make `KAT(CCM)?Parser` into a context suite-capable object by implementing `__enter__` and `__exit__` methods which manage opening up the file descriptors and closing them on context exit. This implementation was decided over adding destructor logic to a `__del__` method, as there are a number of issues around object lifetimes when dealing with threading cleanup, atexit handlers, and a number of other less obvious edgecases. Plus, the architected solution is more pythonic and clean.
Complete the iterator implementation by implementing a `__next__` method for both classes which handles iterating over the data using a generator pattern, and by changing `__iter__` to return the object instead of the data which it would iterate over. Alias the `__next__` method to `next` when working with python 2.x in order to maintain functional compatibility between the two major versions.
As part of this work and to ensure readability, push the initialization of the parser objects up one layer and pass it down to a helper function. This could have been done via a decorator, but I was trying to keep it simple for other developers to make it easier to modify in the future.
This fixes ResourceWarnings with python 3.
PR: 237403 MFC after: 1 week Tested with: python 2.7.16 (amd64), python 3.6.8 (amd64)
show more ...
|