This patch has no functional changes, it fixes whitespace throughout the driver/ tests.
Signed-off-by: Kent Yoder <[email protected]> diff --git a/testcases/driver/des3_func.c b/testcases/driver/des3_func.c index 34ca553..19e8d4e 100755 --- a/testcases/driver/des3_func.c +++ b/testcases/driver/des3_func.c @@ -1699,7 +1699,7 @@ CK_RV des3_functions() { SYSTEMTIME t1, t2; CK_RV rc; - + GetSystemTime(&t1); rc = do_Encrypt3DES_ECB(); if (rc) { diff --git a/testcases/driver/dh_func.c b/testcases/driver/dh_func.c index 3242678..0192403 100644 --- a/testcases/driver/dh_func.c +++ b/testcases/driver/dh_func.c @@ -1,23 +1,23 @@ // /* Common Public License Version 0.5 - + THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - + 1. DEFINITIONS - + "Contribution" means: a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and - + b) in the case of each subsequent Contributor: i) changes to the Program, and ii) additions to the Program; - + where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' @@ -28,23 +28,23 @@ modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. - - + + "Contributor" means any person or entity that distributes the Program. - + "Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. - + "Program" means the Contributions distributed in accordance with this Agreement. "Recipient" means anyone who receives the Program under this Agreement, including all Contributors. - + 2. GRANT OF RIGHTS - + a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright @@ -53,7 +53,7 @@ sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. - + b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent @@ -69,7 +69,7 @@ not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. - + c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are @@ -89,20 +89,20 @@ Program, it is Recipient's responsibility to acquire that license before distributing the Program. - + d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. - + 3. REQUIREMENTS - + A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: a) it complies with the terms and conditions of this Agreement; and - + b) its license agreement: i) effectively disclaims on behalf of all Contributors all warranties and conditions, express @@ -110,16 +110,16 @@ title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; - + ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; - + iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and - + iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner @@ -131,18 +131,18 @@ and b) a copy of this Agreement must be included with each copy of the Program. - + Contributors may not remove or alter any copyright notices contained within the Program. - + Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. - - + + 4. COMMERCIAL DISTRIBUTION - + Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to @@ -182,10 +182,10 @@ warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. - - + + 5. NO WARRANTY - + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR @@ -199,7 +199,7 @@ costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. - + 6. DISCLAIMER OF LIABILITY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY @@ -213,7 +213,7 @@ POSSIBILITY OF SUCH DAMAGES. 7. GENERAL - + If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the @@ -221,8 +221,8 @@ parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. - - + + If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a @@ -237,7 +237,7 @@ patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. - + All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure @@ -248,7 +248,7 @@ practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. - + Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the @@ -272,14 +272,14 @@ under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. - + This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. - + */ /************************************************************************ @@ -464,7 +464,7 @@ CK_RV do_DeriveDHKey( void ) {CKA_CLASS, &priv_key_class, sizeof(priv_key_class) }, {CKA_KEY_TYPE, &priv_key_type, sizeof(priv_key_type) }, {CKA_MODIFIABLE, &true, sizeof(true) }, - {CKA_VALUE_BITS, &cka_value_bits, sizeof(cka_value_bits) } + {CKA_VALUE_BITS, &cka_value_bits, sizeof(cka_value_bits) } }; CK_ATTRIBUTE secret_tmpl[] = @@ -581,7 +581,7 @@ int main(int argc, char **argv) CK_C_INITIALIZE_ARGS cinit_args; int rc; CK_RV rv; - + rc = do_ParseArgs(argc, argv); if ( rc != 1) return rc; @@ -594,7 +594,7 @@ int main(int argc, char **argv) PRINT_ERR("ERROR do_GetFunctionList() Failed , rc = 0x%0x\n", rc); return rc; } - + memset( &cinit_args, 0x0, sizeof(cinit_args) ); cinit_args.flags = CKF_OS_LOCKING_OK; @@ -606,7 +606,7 @@ int main(int argc, char **argv) CK_SESSION_HANDLE hsess = 0; rc = funcs->C_GetFunctionStatus(hsess); - if (rc != CKR_FUNCTION_NOT_PARALLEL) + if (rc != CKR_FUNCTION_NOT_PARALLEL) return rc; rc = funcs->C_CancelFunction(hsess); diff --git a/testcases/driver/driver.c b/testcases/driver/driver.c index ed4a8a8..c318c5e 100755 --- a/testcases/driver/driver.c +++ b/testcases/driver/driver.c @@ -84,10 +84,10 @@ int main (int argc, char **argv) } else if (strcmp (argv[i], "-noinit") == 0) no_init = TRUE; - + else if (strcmp (argv[i], "-nostop") == 0) no_stop = TRUE; - + else { printf ("Invalid argument passed as option: %s\n", argv [i]); usage (argv [0]); @@ -113,7 +113,7 @@ int main (int argc, char **argv) CK_SESSION_HANDLE hsess = 0; rc = funcs->C_GetFunctionStatus(hsess); - if (rc != CKR_FUNCTION_NOT_PARALLEL) + if (rc != CKR_FUNCTION_NOT_PARALLEL) return rc; rc = funcs->C_CancelFunction(hsess); @@ -125,7 +125,7 @@ int main (int argc, char **argv) #if 0 fprintf (stderr, "\tMisc functions tests...\n"); - rc = misc_functions(); + rc = misc_functions(); if ( !rc && !no_stop) return rc; @@ -159,12 +159,12 @@ int main (int argc, char **argv) printf("Error executing DSA functions\n"); return rc; } - + fprintf (stderr, "\tDES3 functions tests...\n"); rc = des3_functions(); if ( !rc && !no_stop) return rc; - + fprintf (stderr, "\tAES functions tests...\n"); rc = aes_functions(); if ( !rc && !no_stop) { @@ -178,7 +178,7 @@ int main (int argc, char **argv) printf("Error executing Rijndael functions\n"); return rc; } - + fprintf (stderr, "\tDigest functions tests...\n"); rc = digest_functions(); if ( !rc && !no_stop) { @@ -204,7 +204,7 @@ int main (int argc, char **argv) fprintf (stderr, "\tSSL3 functions tests...\n"); rc = ssl3_functions(); - if ( !rc && !no_stop) { + if ( !rc && !no_stop) { printf("Error executing SSL3 functions\n"); return rc; } diff --git a/testcases/driver/dsa_func.c b/testcases/driver/dsa_func.c index 4e81e8b..f590c27 100755 --- a/testcases/driver/dsa_func.c +++ b/testcases/driver/dsa_func.c @@ -117,7 +117,7 @@ session_close: /* Close the session */ if( (loc_rc = funcs->C_CloseSession(session)) != CKR_OK ) show_error("C_CloseSession", loc_rc); - + return rc; } @@ -247,7 +247,7 @@ session_close: /* Close the session */ if( (loc_rc = funcs->C_CloseSession(session)) != CKR_OK ) show_error("C_CloseSession", loc_rc); - + return rc; } @@ -284,7 +284,7 @@ int main(int argc, char **argv) CK_C_INITIALIZE_ARGS cinit_args; int rc; CK_RV rv; - + rc = do_ParseArgs(argc, argv); if ( rc != 1) return rc; @@ -297,7 +297,7 @@ int main(int argc, char **argv) PRINT_ERR("ERROR do_GetFunctionList() Failed , rc = 0x%0x\n", rc); return rc; } - + memset( &cinit_args, 0x0, sizeof(cinit_args) ); cinit_args.flags = CKF_OS_LOCKING_OK; @@ -309,7 +309,7 @@ int main(int argc, char **argv) CK_SESSION_HANDLE hsess = 0; rc = funcs->C_GetFunctionStatus(hsess); - if (rc != CKR_FUNCTION_NOT_PARALLEL) + if (rc != CKR_FUNCTION_NOT_PARALLEL) return rc; rc = funcs->C_CancelFunction(hsess); diff --git a/testcases/driver/misc_func.c b/testcases/driver/misc_func.c index f8e22d4..45f2df2 100755 --- a/testcases/driver/misc_func.c +++ b/testcases/driver/misc_func.c @@ -37,7 +37,7 @@ // 15. Check that USER PIN LAST TRY set // 16. Login as USER with incorrect PIN // 17. Check that USER PIN LOCKED set -// +// #if 0 CK_RV do_Login( void ) { @@ -76,10 +76,10 @@ CK_RV do_Login( void ) /* 1. Open a session with the token */ - if( (rc = funcs->C_OpenSession(slot_id, - (CKF_SERIAL_SESSION|CKF_RW_SESSION), - NULL_PTR, - NULL_PTR, + if( (rc = funcs->C_OpenSession(slot_id, + (CKF_SERIAL_SESSION|CKF_RW_SESSION), + NULL_PTR, + NULL_PTR, &session_handle)) != CKR_OK ) { show_error("C_OpenSession #1", rc); goto done; @@ -91,8 +91,8 @@ CK_RV do_Login( void ) goto session_close; } - /* 2. Test the slot_id change. This used to be hard coded to 1. - * It should now be the slot number of the token we're using + /* 2. Test the slot_id change. This used to be hard coded to 1. + * It should now be the slot number of the token we're using */ if(si.slotID != slot_id) { PRINT_ERR("Test #2 failed. Slot ID was %ld, expected %ld\n", si.slotID, slot_id); diff --git a/testcases/driver/obj_mgmt.c b/testcases/driver/obj_mgmt.c index fc2e9c3..0989d7f 100755 --- a/testcases/driver/obj_mgmt.c +++ b/testcases/driver/obj_mgmt.c @@ -1257,7 +1257,7 @@ CK_RV do_CreateTokenObjects( void ) /* * do_HW_Feature_Seatch Test: - * + * * 1. Create 5 objects, 3 of which are HW_FEATURE objects. * 2. Search for objects using a template that does not have its * HW_FEATURE attribute set. @@ -1267,20 +1267,20 @@ CK_RV do_CreateTokenObjects( void ) * HW_FEATURE attribute set. * 5. Result should be that the 3 hardware feature objects are returned. * - */ + */ CK_RV do_HWFeatureSearch(void) { unsigned int i; - CK_RV rc, loc_rc; + CK_RV rc, loc_rc; CK_ULONG find_count; CK_SLOT_ID slot_id; CK_BBOOL false = FALSE; CK_BBOOL true = TRUE; - CK_SESSION_HANDLE h_session; - CK_BYTE user_pin[PKCS11_MAX_PIN_LEN]; - CK_ULONG user_pin_len; + CK_SESSION_HANDLE h_session; + CK_BYTE user_pin[PKCS11_MAX_PIN_LEN]; + CK_ULONG user_pin_len; // A counter object CK_OBJECT_CLASS counter1_class = CKO_HW_FEATURE; @@ -1345,8 +1345,8 @@ CK_RV do_HWFeatureSearch(void) CK_OBJECT_HANDLE h_counter1, h_counter2, h_clock, - h_obj1, - h_obj2, + h_obj1, + h_obj2, obj_list[10]; CK_ATTRIBUTE find_tmpl[] = { {CKA_CLASS, &counter1_class, sizeof(counter1_class)} @@ -1361,10 +1361,10 @@ CK_RV do_HWFeatureSearch(void) user_pin_len = (CK_ULONG)strlen((char *)user_pin); /* Open a session with the token */ - if( (rc = funcs->C_OpenSession(slot_id, - (CKF_SERIAL_SESSION|CKF_RW_SESSION), - NULL_PTR, - NULL_PTR, + if( (rc = funcs->C_OpenSession(slot_id, + (CKF_SERIAL_SESSION|CKF_RW_SESSION), + NULL_PTR, + NULL_PTR, &h_session)) != CKR_OK ) { show_error("C_OpenSession #1", rc); goto done; @@ -1482,7 +1482,7 @@ CK_RV do_HWFeatureSearch(void) for( i=0; i < find_count; i++) { if( obj_list[i] != h_counter1 && obj_list[i] != h_counter2 && - obj_list[i] != h_clock) + obj_list[i] != h_clock) { PRINT_ERR("%s:%d ERROR: C_FindObjects #2 found the wrong" @@ -1537,7 +1537,7 @@ CK_RV obj_mgmt_functions() SYSTEMTIME t1, t2; int rc; - + printf("Object Management tests...\n\n"); diff --git a/testcases/driver/rijndael_func.c b/testcases/driver/rijndael_func.c index 1023838..3a524f7 100755 --- a/testcases/driver/rijndael_func.c +++ b/testcases/driver/rijndael_func.c @@ -5,7 +5,7 @@ * * Mar 11, 2003 * Kent Yoder <[email protected]> - * + * */ #include <stdio.h> @@ -35,28 +35,28 @@ CK_FUNCTION_LIST *funcs; CK_SESSION_HANDLE sess; /* The known answers, from the Rijndael package */ -CK_BYTE KAT_128_ECB_KEY[] = { 0xDF,0x2F,0xC6,0x8C,0x50,0xA1,0xA6,0xEA, +CK_BYTE KAT_128_ECB_KEY[] = { 0xDF,0x2F,0xC6,0x8C,0x50,0xA1,0xA6,0xEA, 0x6E,0xBF,0x19,0xDD,0xFC,0xFA,0xC8,0x87 }; -CK_BYTE KAT_128_ECB_PT[] = { 0x2C,0x29,0x0A,0xE7,0xC6,0x5B,0x6E,0x5B, +CK_BYTE KAT_128_ECB_PT[] = { 0x2C,0x29,0x0A,0xE7,0xC6,0x5B,0x6E,0x5B, 0xBA,0xA3,0x2D,0xE5,0x77,0xDB,0xA3,0x43 }; -CK_BYTE KAT_128_ECB_CT[] = { 0xA0,0x43,0x77,0xAB,0xE2,0x59,0xB0,0xD0, +CK_BYTE KAT_128_ECB_CT[] = { 0xA0,0x43,0x77,0xAB,0xE2,0x59,0xB0,0xD0, 0xB5,0xBA,0x2D,0x40,0xA5,0x01,0x97,0x1B }; -CK_BYTE KAT_192_ECB_KEY[] = { 0xC9,0xDC,0x82,0xF0,0x00,0x18,0x77,0x21, +CK_BYTE KAT_192_ECB_KEY[] = { 0xC9,0xDC,0x82,0xF0,0x00,0x18,0x77,0x21, 0xD2,0xE4,0xB0,0xB8,0x72,0xCD,0x3A,0x43, 0x11,0xD9,0x67,0xC8,0x1E,0xEE,0xF9,0x00 }; -CK_BYTE KAT_192_ECB_PT[] = { 0xFF,0x62,0x6D,0x77,0xAE,0x14,0x4C,0x11, +CK_BYTE KAT_192_ECB_PT[] = { 0xFF,0x62,0x6D,0x77,0xAE,0x14,0x4C,0x11, 0x48,0x06,0x10,0xEC,0x1A,0xBB,0x50,0x28 }; -CK_BYTE KAT_192_ECB_CT[] = { 0x4E,0x46,0xF8,0xC5,0x09,0x2B,0x29,0xE2, +CK_BYTE KAT_192_ECB_CT[] = { 0x4E,0x46,0xF8,0xC5,0x09,0x2B,0x29,0xE2, 0x9A,0x97,0x1A,0x0C,0xD1,0xF6,0x10,0xFB }; -CK_BYTE KAT_256_ECB_KEY[] = { 0x98,0x2D,0x61,0x7A,0x0F,0x73,0x73,0x42, +CK_BYTE KAT_256_ECB_KEY[] = { 0x98,0x2D,0x61,0x7A,0x0F,0x73,0x73,0x42, 0xE9,0x91,0x23,0xA5,0xA5,0x73,0xD2,0x66, 0xF4,0x96,0x19,0x15,0xB3,0x2D,0xCA,0x41, 0x18,0xAD,0x5C,0xF1,0xDC,0xB6,0xED,0x00 }; -CK_BYTE KAT_256_ECB_PT[] = { 0x6F,0x86,0x06,0xBB,0xA6,0xCC,0x03,0xA5, +CK_BYTE KAT_256_ECB_PT[] = { 0x6F,0x86,0x06,0xBB,0xA6,0xCC,0x03,0xA5, 0xD0,0xA6,0x4F,0xE2,0x1E,0x27,0x7B,0x60 }; -CK_BYTE KAT_256_ECB_CT[] = { 0x1F,0x67,0x63,0xDF,0x80,0x7A,0x7E,0x70, +CK_BYTE KAT_256_ECB_CT[] = { 0x1F,0x67,0x63,0xDF,0x80,0x7A,0x7E,0x70, 0x96,0x0D,0x4C,0xD3,0x11,0x8E,0x60,0x1A }; CK_BYTE KAT_128_CBC_KEY[] = { 0x46,0xCD,0xD1,0xC7,0xC0,0x11,0xCE,0xE7, @@ -95,7 +95,7 @@ CK_RV do_AES_KAT_128_ECB(void) { int j; unsigned int i, k; - CK_RV rc; + CK_RV rc; CK_BYTE pt[AES_BLOCK_SIZE], ct[AES_BLOCK_SIZE], final_pt[AES_BLOCK_SIZE]; @@ -236,7 +236,7 @@ CK_RV do_AES_KAT_192_ECB(void) { int j; unsigned int i, k; - CK_RV rc; + CK_RV rc; CK_BYTE pt[AES_BLOCK_SIZE], ct[24], // larger to acct for trailing ciphertext final_pt[AES_BLOCK_SIZE]; @@ -366,7 +366,7 @@ CK_RV do_AES_KAT_256_ECB(void) { int j; unsigned int i, k; - CK_RV rc; + CK_RV rc; CK_BYTE pt[AES_BLOCK_SIZE], ct[32], // larger to acct for trailing ciphertext final_pt[AES_BLOCK_SIZE]; @@ -914,10 +914,10 @@ CK_RV rijndael_functions(void) /* Open a session with the token */ - if( (rc = funcs->C_OpenSession(slot_id, - (CKF_SERIAL_SESSION|CKF_RW_SESSION), - NULL_PTR, - NULL_PTR, + if( (rc = funcs->C_OpenSession(slot_id, + (CKF_SERIAL_SESSION|CKF_RW_SESSION), + NULL_PTR, + NULL_PTR, &sess)) != CKR_OK ) { show_error("C_OpenSession #1", rc); goto done; diff --git a/testcases/driver/ssl3_func.c b/testcases/driver/ssl3_func.c index 7978c9a..8b37351 100755 --- a/testcases/driver/ssl3_func.c +++ b/testcases/driver/ssl3_func.c @@ -506,11 +506,11 @@ int main(int argc, char **argv) CK_C_INITIALIZE_ARGS cinit_args; int rc; CK_RV rv; - + rc = do_ParseArgs(argc, argv); if ( rc != 1) return rc; - + printf("Using slot #%lu...\n\n", SLOT_ID ); printf("With option: no_init: %d\n", no_init); @@ -519,7 +519,7 @@ int main(int argc, char **argv) PRINT_ERR("ERROR do_GetFunctionList() Failed , rc = 0x%0x\n", rc); return rc; } - + memset( &cinit_args, 0x0, sizeof(cinit_args) ); cinit_args.flags = CKF_OS_LOCKING_OK; @@ -531,7 +531,7 @@ int main(int argc, char **argv) CK_SESSION_HANDLE hsess = 0; rc = funcs->C_GetFunctionStatus(hsess); - if (rc != CKR_FUNCTION_NOT_PARALLEL) + if (rc != CKR_FUNCTION_NOT_PARALLEL) return rc; rc = funcs->C_CancelFunction(hsess); ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Opencryptoki-tech mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opencryptoki-tech
