case CKM_GENERIC_SECRET_KEY_GEN:
PK11_GetKeyGen(CK_MECHANISM_TYPE type){    switch (type) {    case CKM_AES_ECB:    case CKM_AES_CBC:    case CKM_AES_MAC:    case CKM_AES_MAC_GENERAL:    case CKM_AES_CBC_PAD:	return CKM_AES_KEY_GEN;    case CKM_DES_ECB:    case CKM_DES_CBC:    case CKM_DES_MAC:    case CKM_DES_MAC_GENERAL:    case CKM_KEY_WRAP_LYNKS:    case CKM_DES_CBC_PAD:	return CKM_DES_KEY_GEN;    case CKM_DES3_ECB:    case CKM_DES3_CBC:    case CKM_DES3_MAC:    case CKM_DES3_MAC_GENERAL:    case CKM_DES3_CBC_PAD:	return CKM_DES3_KEY_GEN;    case CKM_CDMF_ECB:    case CKM_CDMF_CBC:    case CKM_CDMF_MAC:    case CKM_CDMF_MAC_GENERAL:    case CKM_CDMF_CBC_PAD:	return CKM_CDMF_KEY_GEN;    case CKM_RC2_ECB:    case CKM_RC2_CBC:    case CKM_RC2_MAC:    case CKM_RC2_MAC_GENERAL:    case CKM_RC2_CBC_PAD:	return CKM_RC2_KEY_GEN;    case CKM_RC4:	return CKM_RC4_KEY_GEN;    case CKM_RC5_ECB:    case CKM_RC5_CBC:    case CKM_RC5_MAC:    case CKM_RC5_MAC_GENERAL:    case CKM_RC5_CBC_PAD:	return CKM_RC5_KEY_GEN;    case CKM_SKIPJACK_CBC64:    case CKM_SKIPJACK_ECB64:    case CKM_SKIPJACK_OFB64:    case CKM_SKIPJACK_CFB64:    case CKM_SKIPJACK_CFB32:    case CKM_SKIPJACK_CFB16:    case CKM_SKIPJACK_CFB8:    case CKM_SKIPJACK_WRAP:	return CKM_SKIPJACK_KEY_GEN;    case CKM_BATON_ECB128:    case CKM_BATON_ECB96:    case CKM_BATON_CBC128:    case CKM_BATON_COUNTER:    case CKM_BATON_SHUFFLE:    case CKM_BATON_WRAP:	return CKM_BATON_KEY_GEN;    case CKM_JUNIPER_ECB128:    case CKM_JUNIPER_CBC128:    case CKM_JUNIPER_COUNTER:    case CKM_JUNIPER_SHUFFLE:    case CKM_JUNIPER_WRAP:	return CKM_JUNIPER_KEY_GEN;    case CKM_IDEA_CBC:    case CKM_IDEA_ECB:    case CKM_IDEA_MAC:    case CKM_IDEA_MAC_GENERAL:    case CKM_IDEA_CBC_PAD:	return CKM_IDEA_KEY_GEN;    case CKM_CAST_ECB:    case CKM_CAST_CBC:    case CKM_CAST_MAC:    case CKM_CAST_MAC_GENERAL:    case CKM_CAST_CBC_PAD:	return CKM_CAST_KEY_GEN;    case CKM_CAST3_ECB:    case CKM_CAST3_CBC:    case CKM_CAST3_MAC:    case CKM_CAST3_MAC_GENERAL:    case CKM_CAST3_CBC_PAD:	return CKM_CAST3_KEY_GEN;    case CKM_CAST5_ECB:    case CKM_CAST5_CBC:    case CKM_CAST5_MAC:    case CKM_CAST5_MAC_GENERAL:    case CKM_CAST5_CBC_PAD:	return CKM_CAST5_KEY_GEN;    case CKM_RSA_PKCS:    case CKM_RSA_9796:    case CKM_RSA_X_509:    case CKM_MD2_RSA_PKCS:    case CKM_MD5_RSA_PKCS:    case CKM_SHA1_RSA_PKCS:    case CKM_KEY_WRAP_SET_OAEP:	return CKM_RSA_PKCS_KEY_PAIR_GEN;    case CKM_DSA:    case CKM_DSA_SHA1:	return CKM_DSA_KEY_PAIR_GEN;    case CKM_DH_PKCS_DERIVE:	return CKM_DH_PKCS_KEY_PAIR_GEN;    case CKM_KEA_KEY_DERIVE:	return CKM_KEA_KEY_PAIR_GEN;    case CKM_ECDSA:	return CKM_ECDSA_KEY_PAIR_GEN;    case CKM_SSL3_PRE_MASTER_KEY_GEN:    case CKM_SSL3_MASTER_KEY_DERIVE:    case CKM_SSL3_KEY_AND_MAC_DERIVE:    case CKM_SSL3_SHA1_MAC:    case CKM_SSL3_MD5_MAC:    case CKM_TLS_MASTER_KEY_DERIVE:    case CKM_TLS_KEY_AND_MAC_DERIVE:	return CKM_SSL3_PRE_MASTER_KEY_GEN;    case CKM_SHA_1_HMAC:    case CKM_SHA_1_HMAC_GENERAL:    case CKM_MD2_HMAC:    case CKM_MD2_HMAC_GENERAL:    case CKM_MD5_HMAC:    case CKM_MD5_HMAC_GENERAL:    case CKM_TLS_PRF_GENERAL:	return CKM_GENERIC_SECRET_KEY_GEN;    case CKM_PBE_MD2_DES_CBC:    case CKM_PBE_MD5_DES_CBC:    case CKM_PBA_SHA1_WITH_SHA1_HMAC:    case CKM_NETSCAPE_PBE_SHA1_HMAC_KEY_GEN:    case CKM_NETSCAPE_PBE_MD5_HMAC_KEY_GEN:    case CKM_NETSCAPE_PBE_MD2_HMAC_KEY_GEN:    case CKM_NETSCAPE_PBE_SHA1_DES_CBC:    case CKM_NETSCAPE_PBE_SHA1_40_BIT_RC2_CBC:    case CKM_NETSCAPE_PBE_SHA1_128_BIT_RC2_CBC:    case CKM_NETSCAPE_PBE_SHA1_40_BIT_RC4:    case CKM_NETSCAPE_PBE_SHA1_128_BIT_RC4:    case CKM_NETSCAPE_PBE_SHA1_TRIPLE_DES_CBC:    case CKM_NETSCAPE_PBE_SHA1_FAULTY_3DES_CBC:    case CKM_PBE_SHA1_RC2_40_CBC:    case CKM_PBE_SHA1_RC2_128_CBC:    case CKM_PBE_SHA1_RC4_40:    case CKM_PBE_SHA1_RC4_128:    case CKM_PBE_SHA1_DES3_EDE_CBC:    case CKM_PBE_SHA1_DES2_EDE_CBC:    	return type;    default:	return pk11_lookup(type)->keyGen;    }}