2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * Obtain the session pointer. Also, increment the session 2N/A /* Acquire the session lock */ 2N/A /* Check to see if digest operation is already active */ 2N/A * Free the memory to avoid memory leak. 2N/A * This active flag will remain ON until application calls either 2N/A * C_Digest or C_DigestFinal to actually obtain the value of 2N/A * the message digest. 2N/A * Decrement the session reference count. 2N/A * We hold the session lock, and SES_REFRELE() 2N/A * will release the session lock for us. 2N/A * Decrement the session reference count. 2N/A * We do not hold the session lock. 2N/A * Obtain the session pointer. Also, increment the session 2N/A /* Acquire the session lock */ 2N/A /* Application must call C_DigestInit before calling C_Digest */ 2N/A * Decrement the session reference count. 2N/A * We hold the session lock, and SES_REFRELE() 2N/A * will release the session lock for us. 2N/A * C_Digest must be called without intervening C_DigestUpdate 2N/A * C_Digest can not be used to terminate a multi-part 2N/A * operation, so we'll leave the active digest operation 2N/A * flag on and let the application continue with the 2N/A * digest update operation. 2N/A * Decrement the session reference count. 2N/A * We hold the session lock, and SES_REFRELE() 2N/A * will release the session lock for us. 2N/A * We will not terminate the active digest operation flag, 2N/A * when the application-supplied buffer is too small, or 2N/A * the application asks for the length of buffer to hold 2N/A * the message digest. 2N/A * Decrement the session reference count. 2N/A * We do not hold the session lock. 2N/A * Terminates the active digest operation. 2N/A * Application needs to call C_DigestInit again for next 2N/A * Decrement the session reference count. 2N/A * We hold the session lock, and SES_REFRELE() 2N/A * will release the session lock for us. 2N/A * Obtain the session pointer. Also, increment the session 2N/A /* Acquire the session lock */ 2N/A * Application must call C_DigestInit before calling 2N/A * Decrement the session reference count. 2N/A * We hold the session lock, and SES_REFRELE() 2N/A * will release the session lock for us. 2N/A /* Set update flag to protect C_Digest */ 2N/A * Decrement the session reference count. 2N/A * We do not hold the session lock. 2N/A * After an error occurred, terminate the current digest 2N/A * operation by resetting the active and update flags. 2N/A * Decrement the session reference count. 2N/A * We hold the session lock, and SES_REFRELE() 2N/A * will release the session lock for us. 2N/A * Obtain the session pointer. Also, increment the session 2N/A /* Obtain the object pointer. */ 2N/A * Application must call C_DigestInit before calling 2N/A * Decrement the session reference count. 2N/A * We hold the session lock, and SES_REFRELE() 2N/A * will release the session lock for us. 2N/A * Remember the fact that a key was thrown into the mix, so that 2N/A * C_DigestFinal bzero()'s the digest context before freeing it. 2N/A * Decrement the session reference count. 2N/A * We do not hold the session lock. 2N/A * After an error occurred, terminate the current digest 2N/A * operation by resetting the active and update flags. 2N/A * Decrement the session reference count. 2N/A * We hold the session lock, and SES_REFRELE() 2N/A * will release the session lock for us. 2N/A * Obtain the session pointer. Also, increment the session 2N/A /* Acquire the session lock */ 2N/A * Application must call C_DigestInit before calling 2N/A * Decrement the session reference count. 2N/A * We hold the session lock, and SES_REFRELE() 2N/A * will release the session lock for us. 2N/A * We will not terminate the active digest operation flag, 2N/A * when the application-supplied buffer is too small, or 2N/A * the application asks for the length of buffer to hold 2N/A * the message digest. 2N/A * Decrement the session reference count. 2N/A * We do not hold the session lock. 2N/A /* Terminates the active digest operation */ 2N/A * Decrement the session reference count. 2N/A * We hold the session lock, and SES_REFRELE() 2N/A * will release the session lock for us.