PRBool extractable; CK_RV crv = PR_TRUE;
PRBool extractable = PR_TRUE; CK_RV crv = CKR_OK;
pk11_DeriveSensitiveCheck(PK11Object *baseKey,PK11Object *destKey) {    PRBool hasSensitive;    PRBool sensitive;    PRBool hasExtractable;    PRBool extractable;    CK_RV crv = PR_TRUE;    PK11Attribute *att;    hasSensitive = PR_FALSE;    att = pk11_FindAttribute(destKey,CKA_SENSITIVE);    if (att) {        hasSensitive = PR_FALSE;	sensitive = (PRBool) *(CK_BBOOL *)att->attrib.pValue;	pk11_FreeAttribute(att);    }    hasExtractable = PR_FALSE;    att = pk11_FindAttribute(destKey,CKA_EXTRACTABLE);    if (att) {        hasExtractable = PR_FALSE;	extractable = (PRBool) *(CK_BBOOL *)att->attrib.pValue;	pk11_FreeAttribute(att);    }    /* don't make a key more accessible */    if (pk11_isTrue(baseKey,CKA_SENSITIVE) && hasSensitive && 						(sensitive == PR_FALSE)) {	return CKR_KEY_FUNCTION_NOT_PERMITTED;    }    if (!pk11_isTrue(baseKey,CKA_EXTRACTABLE) && hasExtractable && 						(extractable == PR_TRUE)) {	return CKR_KEY_FUNCTION_NOT_PERMITTED;    }    /* inherit parent's sensitivity */    if (!hasSensitive) {        att = pk11_FindAttribute(baseKey,CKA_SENSITIVE);	if (att == NULL) return CKR_KEY_TYPE_INCONSISTENT;	crv = pk11_defaultAttribute(destKey,pk11_attr_expand(&att->attrib));	pk11_FreeAttribute(att);	if (crv != CKR_OK) return crv;    }    if (!hasExtractable) {        att = pk11_FindAttribute(baseKey,CKA_EXTRACTABLE);	if (att == NULL) return CKR_KEY_TYPE_INCONSISTENT;	crv = pk11_defaultAttribute(destKey,pk11_attr_expand(&att->attrib));	pk11_FreeAttribute(att);	if (crv != CKR_OK) return crv;    }    /* we should inherit the parent's always extractable/ never sensitive info,     * but handleObject always forces this attributes, so we would need to do     * something special. */    return CKR_OK;}