Commit f518786
Merged PR 10534989: Fix CallBackAlloc to adjust the nBytes in case the size is not aligned.
## Description:
SymCryptCallBackAlloc failed as part of a call to SymCryptRsakeyGenerate with the new SymCrypt.
After investigation, the failure occurs since we changed the API from "posix_alloc" to "aligned_alloc".
aligned_alloc - expect to get the number of bytes to allocate as an integral multiple of the alignment.
So, when passing not a multiple of the alignment number the function failed.
I suspect this issue is important since the regular Linux product use the API without the check of the size alignment.
Hence, I created this PR with a fix that adjust the size we receive to be aligned.
## Admin Checklist:
- [ ] You have updated documentation in symcrypt.h to reflect any changes in behavior
- [ ] You have updated CHANGELOG.md to reflect any changes in behavior
- [ ] You have updated symcryptunittest to exercise any new functionality
- [ ] If you have introduced any symbols in symcrypt.h you have updated production and test dynamic export symbols (exports.ver / exports.def / symcrypt.src) and tested the updated dynamic modules with symcryptunittest
- [ ] If you have introduced functionality that varies based on CPU features, you have manually tested with and without relevant features
- [ ] If you have made significant changes to a particular algorithm, you have checked that performance numbers reported by symcryptunittest are in line with expectations
- [ ] If you have added new algorithms/modes, you have updated the status indicator text for the associated modules if necessary
Fix CallBackAlloc to adjust the nBytes for allocation in case the size is not aligned
Signed-off-by: v-shlevy <[email protected]>
Related work items: #494194161 parent d02569c commit f518786
File tree
2 files changed
+8
-2
lines changed- modules/linux/common
2 files changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
0 commit comments