Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add wrapping and unwrapping capability to CKM_AES_GCM mechanism #641

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

keldonin
Copy link
Contributor

This PR adds wrapping and unwrapping capability to the CKM_AES_GCM mechanism.
It comes along with new cases to the test suite.

@keldonin
Copy link
Contributor Author

The build seems to fail with Appveyor. However, when looking closer to the logs:

  • all builds are on MSVC/Windows (no build on linux/BSD?)
  • the builds fail as syslog.h cannot be found (and is probably not expected on this platform).

Is something broken in the source code, that prevents building on Windows?

"C:\projects\softhsmv2\softhsm2.sln" (Build target) (1) ->
"C:\projects\softhsmv2\ALL_BUILD.vcxproj.metaproj" (default target) (2) ->
"C:\projects\softhsmv2\src\lib\softhsm2.vcxproj.metaproj" (default target) (4) ->
"C:\projects\softhsmv2\src\lib\common\softhsm_common.vcxproj.metaproj" (default target) (5) ->
"C:\projects\softhsmv2\src\lib\common\softhsm_common.vcxproj" (default target) (6) ->
(ClCompile target) -> 
  c:\projects\softhsmv2\src\lib\common\log.h(40): fatal error C1083: Cannot open include file: 'syslog.h': No such file or directory [C:\projects\softhsmv2\src\lib\common\softhsm_common.vcxproj]

@saper
Copy link
Contributor

saper commented Jan 4, 2022

@keldonin I found another issue with AES GCM and have a fix in #664. Since the fix would have need to be applied also to the wrapping code, maybe we should think about extracting those AES parameter checks into a common function. I have also refactored the test d155341 to be able to test different sets of parameters.

return CKR_ARGUMENTS_BAD;
}
iv.resize(CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulIvLen);
memcpy(&iv[0], CK_GCM_PARAMS_PTR(pMechanism->pParameter)->pIv, CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulIvLen);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this requires the same fix as in #664

iv.resize(CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulIvLen);
memcpy(&iv[0], CK_GCM_PARAMS_PTR(pMechanism->pParameter)->pIv, CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulIvLen);
aad.resize(CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulAADLen);
memcpy(&aad[0], CK_GCM_PARAMS_PTR(pMechanism->pParameter)->pAAD, CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulAADLen);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this requires the same fix as in #664

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants