/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <pthread.h>
#include <stdlib.h>
#include <security/cryptoki.h>
#include "pkcs11Global.h"
#include "pkcs11Slot.h"
#include "pkcs11Session.h"
/*
* pkcs11_session_add:
* Create a session and add it to the list of sessions associated
* with the slot it is being opened on. The session handle, fwsessionp,
* will be the memory address of the session, typecast to a CK_SESSION_HANDLE.
*
* Assumptions: slotp is a valid slot, mutexes are not held, and
* the provider already successfully opened related session.
*/
{
return (CKR_HOST_MEMORY);
}
/* Insert the new session in the front of the slot's session list */
} else {
}
/* Typecast the address of session structure to a session handle */
return (CKR_OK);
}
/*
* pkcs11_session_delete:
* Delete a session from a particular slot's session list.
*
* Assumptions: slotp is a valid slot, sessp is a valid session,
* provider has already successfully closed this session, and
* mutexes are not held.
*/
void
{
/* Acquire the slot's lock */
/* This is the first session in the list */
} else {
/* Session is the only one in the list */
}
} else {
/* Session is not the first one in the list */
/* Session is in the middle of the list */
} else {
/* Session is the last one in the list */
}
}
/* Mark session as no longer valid */
}
/*
* pkcs11_sessionlist_delete:
* Delete all sessions associated with a particular slot's session list.
*
* Assumptions: slotp is a valid slot, no mutexes are held, and the
* sessions were successfully closed with the provider already.
*/
void
{
/* Delete all the sessions in this slot's session list */
while (sessp) {
sessp = sess_nextp;
}
}