Move crypto2pkcs11_error_number to libcryptoutil
Upstream of Joyent OS-6619
Currently, pkcs11_kernel.so (the PKCS#11 wrapper for the kernel crypto driver) has a function crypto2pkcs11_error_number which maps KCF error values (CRYPTO_xx) to PKCS#11 error values (CKM_xx). Since the code in usr/src/common/crypto and thus libsofttoken all use the KCF error values, it would be useful to move this function to a more common location. It could also prove useful with the crypto tests as well for similar reasons.
The pkcs11_kernel implementation is currently a strictly internal function to pkcs11_kernel and not exported in it's map file, so there should be no API or ABI concerns with moving it.
The most sensible place would be libcryptoutil. It is designed (at least from appearances) to be an assistive library for crypto (and especially PKCS#11) related bits in the system. It is considered a private library (all functions are exported as SUNWprivate), and at least for the time being, would be kept that way in libcryptoutil.