usr/src/lib/openssl/Patches/pkcs11-engine/hw_pk11.c
changeset 46 9c200dad5ecc
parent 13 971008b98b79
child 52 dba7d4610209
equal deleted inserted replaced
45:4fd8c15fddcf 46:9c200dad5ecc
     1 /*
     1 /*
     2  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
     3  */
     3  */
     4 
     4 
     5 #pragma ident	"@(#)hw_pk11.c	1.4	10/04/14 SMI"
     5 #pragma ident	"@(#)hw_pk11.c	1.5	10/09/01 SMI"
     6 
     6 
     7 /* crypto/engine/hw_pk11.c */
     7 /* crypto/engine/hw_pk11.c */
     8 /*
     8 /*
     9  * This product includes software developed by the OpenSSL Project for
     9  * This product includes software developed by the OpenSSL Project for
    10  * use in the OpenSSL Toolkit (http://www.openssl.org/).
    10  * use in the OpenSSL Toolkit (http://www.openssl.org/).
  1370 	 * may have side-effects.
  1370 	 * may have side-effects.
  1371 	 */
  1371 	 */
  1372 #if 0
  1372 #if 0
  1373 	pFuncList->C_Finalize(NULL);
  1373 	pFuncList->C_Finalize(NULL);
  1374 #endif
  1374 #endif
       
  1375 #ifdef	SOLARIS_AES_CTR
       
  1376 	{
       
  1377 		ASN1_OBJECT *ob = NULL;
       
  1378 		if (NID_aes_128_ctr != NID_undef) {
       
  1379 			ob = OBJ_nid2obj(NID_aes_128_ctr);
       
  1380 			if (ob != NULL)
       
  1381 				ASN1_OBJECT_free(ob);
       
  1382 		}
       
  1383 		if (NID_aes_192_ctr != NID_undef) {
       
  1384 			ob = OBJ_nid2obj(NID_aes_192_ctr);
       
  1385 			if (ob != NULL)
       
  1386 				ASN1_OBJECT_free(ob);
       
  1387 		}
       
  1388 		if (NID_aes_256_ctr != NID_undef) {
       
  1389 			ob = OBJ_nid2obj(NID_aes_256_ctr);
       
  1390 			if (ob != NULL)
       
  1391 				ASN1_OBJECT_free(ob);
       
  1392 		}
       
  1393 	}
       
  1394 #endif
  1375 
  1395 
  1376 	if (!DSO_free(pk11_dso))
  1396 	if (!DSO_free(pk11_dso))
  1377 		{
  1397 		{
  1378 		PK11err(PK11_F_FINISH, PK11_R_DSO_FAILURE);
  1398 		PK11err(PK11_F_FINISH, PK11_R_DSO_FAILURE);
  1379 		goto err;
  1399 		goto err;
  3617 	CK_TOKEN_INFO token_info;
  3637 	CK_TOKEN_INFO token_info;
  3618 	CK_ULONG ulSlotCount = 0;
  3638 	CK_ULONG ulSlotCount = 0;
  3619 	int n_cipher = 0, n_digest = 0;
  3639 	int n_cipher = 0, n_digest = 0;
  3620 	CK_FUNCTION_LIST_PTR pflist = NULL;
  3640 	CK_FUNCTION_LIST_PTR pflist = NULL;
  3621 	CK_SLOT_ID_PTR pSlotList = NULL_PTR;
  3641 	CK_SLOT_ID_PTR pSlotList = NULL_PTR;
  3622 	int *tmp_hw_cnids, *tmp_hw_dnids;
  3642 	int *tmp_hw_cnids = NULL, *tmp_hw_dnids = NULL;
  3623 	int hw_ctable_size, hw_dtable_size;
  3643 	int hw_ctable_size, hw_dtable_size;
  3624 
  3644 
  3625 #ifdef	DEBUG_SLOT_SELECTION
  3645 #ifdef	DEBUG_SLOT_SELECTION
  3626 	fprintf(stderr, "%s: SOLARIS_HW_SLOT_SELECTION code running\n",
  3646 	fprintf(stderr, "%s: SOLARIS_HW_SLOT_SELECTION code running\n",
  3627 	    PK11_DBG);
  3647 	    PK11_DBG);