int key_size, void * wincx)
int key_size, void * wincx, CK_RV *crvp)
pk11_HandUnwrap(PK11SlotInfo *slot, CK_OBJECT_HANDLE wrappingKey,                CK_MECHANISM *mech, SECItem *inKey, CK_MECHANISM_TYPE target, 		CK_ATTRIBUTE *keyTemplate, unsigned int templateCount, 		int key_size, void * wincx){    CK_ULONG len;    SECItem outKey;    PK11SymKey *symKey;    CK_RV crv;    PRBool owner = PR_TRUE;    PRBool bool = PR_TRUE;    CK_SESSION_HANDLE session;    /* remove any VALUE_LEN parameters */    if (keyTemplate[templateCount-1].type == CKA_VALUE_LEN) {        templateCount--;    }    /* keys are almost always aligned, but if we get this far,     * we've gone above and beyond anyway... */    outKey.data = (unsigned char*)PORT_Alloc(inKey->len);    if (outKey.data == NULL) {	PORT_SetError( SEC_ERROR_NO_MEMORY );	return NULL;    }    len = inKey->len;    /* use NULL IV's for wrapping */    session = pk11_GetNewSession(slot,&owner);    if (!owner || !(slot->isThreadSafe)) PK11_EnterSlotMonitor(slot);    crv = PK11_GETTAB(slot)->C_DecryptInit(session,mech,wrappingKey);    if (crv != CKR_OK) {	if (!owner || !(slot->isThreadSafe)) PK11_ExitSlotMonitor(slot);	pk11_CloseSession(slot,session,owner);	PORT_Free(outKey.data);	PORT_SetError( PK11_MapError(crv) );	return NULL;    }    crv = PK11_GETTAB(slot)->C_Decrypt(session,inKey->data,inKey->len,							   outKey.data, &len);    if (!owner || !(slot->isThreadSafe)) PK11_ExitSlotMonitor(slot);    pk11_CloseSession(slot,session,owner);    if (crv != CKR_OK) {	PORT_Free(outKey.data);	PORT_SetError( PK11_MapError(crv) );	return NULL;    }    outKey.len = (key_size == 0) ? len : key_size;    if (PK11_DoesMechanism(slot,target)) {	symKey = pk11_ImportSymKeyWithTempl(slot, target, PK11_OriginUnwrap, 	                                    keyTemplate, templateCount, 					    &outKey, wincx);    } else {	slot = PK11_GetBestSlot(target,wincx);	if (slot == NULL) {	    PORT_SetError( SEC_ERROR_NO_MODULE );	    PORT_Free(outKey.data);	    return NULL;	}	symKey = pk11_ImportSymKeyWithTempl(slot, target, PK11_OriginUnwrap, 	                                    keyTemplate, templateCount, 					    &outKey, wincx);	PK11_FreeSlot(slot);    }    PORT_Free(outKey.data);    return symKey;}