The previous code would reuse slices of type []*pkcs11.Attribute when attempting to find the values of attributes associated with objects in PKCS#11.
The current version will reassign the entire slice to the variable used in the call to module.GetAttributeValue. This prevents potential index out of bounds accesses when assigning to individual elements in the slice (which could've been modified by the previous module.GetAttributeValue call).
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Description of changes:
The previous code would reuse slices of type
[]*pkcs11.Attribute
when attempting to find the values of attributes associated with objects in PKCS#11.The current version will reassign the entire slice to the variable used in the call to module.GetAttributeValue. This prevents potential index out of bounds accesses when assigning to individual elements in the slice (which could've been modified by the previous module.GetAttributeValue call).
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.