1

In the library that I have developer passes source key and CK_INVALID_HANDLE (instead of wrapping key) to C_wrapKey API and in return I get success.

I doubt this behaviour. Is this the correct return code?

Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263
TheBeginner
  • 405
  • 5
  • 23
  • I think that you should ask the developer of the PKCS#11 module how this can happen. Note that your title and body were slightly out of sync: an explicit invalid handle is different than passing a handle to a key that doesn't exist (anymore). – Maarten Bodewes Mar 01 '18 at 09:02

1 Answers1

2

If you mean that C_WrapKey receives an invalid value for hWrappingKey parameter, then it should return CKR_WRAPPING_KEY_HANDLE_INVALID.

Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263
Egl
  • 774
  • 7
  • 20
  • Hi Egi, I formatted your question for easier reading. Remarks like "I don't think I fully understand your question" should be a comment instead of being part of the answer. I've used the backticks which can be used to format inline code so that the identifier names can be highlighted. Note that you can always re-edit or roll back if you're not happy about the changes. – Maarten Bodewes Mar 01 '18 at 08:56