google / pkcs11test

PKCS#11 Test Suite
Apache License 2.0
75 stars 51 forks source link

Improper function calls in FindObject tests #30

Closed makerj closed 4 years ago

makerj commented 4 years ago

https://github.com/google/pkcs11test/blob/ccd37ec33be75e61a6fc4c48a3fa928577e691d2/object.cc#L415 https://github.com/google/pkcs11test/blob/ccd37ec33be75e61a6fc4c48a3fa928577e691d2/object.cc#L418 https://github.com/google/pkcs11test/blob/ccd37ec33be75e61a6fc4c48a3fa928577e691d2/object.cc#L489 https://github.com/google/pkcs11test/blob/ccd37ec33be75e61a6fc4c48a3fa928577e691d2/object.cc#L508 https://github.com/google/pkcs11test/blob/ccd37ec33be75e61a6fc4c48a3fa928577e691d2/object.cc#L519 https://github.com/google/pkcs11test/blob/ccd37ec33be75e61a6fc4c48a3fa928577e691d2/object.cc#L523 https://github.com/google/pkcs11test/blob/ccd37ec33be75e61a6fc4c48a3fa928577e691d2/object.cc#L531

By PKCS#11 specification,

ulMaxObjectCount is the maximum number of object handles to be returned

So, I think the value of third parameter should be capacity of object variable(in this case, 5), not a octet count of object variable.

daviddrysdale commented 4 years ago

Good spot! Does #31 look like it covers all the places you found?

makerj commented 4 years ago

Yes, #31 covers all the places. (whole project, AFAIK.) Thank you.