| OLD | NEW |
| 1 /* Written by Ben Laurie, 2001 */ | 1 /* Written by Ben Laurie, 2001 */ |
| 2 /* | 2 /* |
| 3 * Copyright (c) 2001 The OpenSSL Project. All rights reserved. | 3 * Copyright (c) 2001 The OpenSSL Project. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 printf("Testing cipher %s%s\n",EVP_CIPHER_name(c), | 146 printf("Testing cipher %s%s\n",EVP_CIPHER_name(c), |
| 147 (encdec == 1 ? "(encrypt)" : (encdec == 0 ? "(decrypt)" : "(encrypt/d
ecrypt)"))); | 147 (encdec == 1 ? "(encrypt)" : (encdec == 0 ? "(decrypt)" : "(encrypt/d
ecrypt)"))); |
| 148 hexdump(stdout,"Key",key,kn); | 148 hexdump(stdout,"Key",key,kn); |
| 149 if(in) | 149 if(in) |
| 150 hexdump(stdout,"IV",iv,in); | 150 hexdump(stdout,"IV",iv,in); |
| 151 hexdump(stdout,"Plaintext",plaintext,pn); | 151 hexdump(stdout,"Plaintext",plaintext,pn); |
| 152 hexdump(stdout,"Ciphertext",ciphertext,cn); | 152 hexdump(stdout,"Ciphertext",ciphertext,cn); |
| 153 | 153 |
| 154 if(kn != c->key_len) | 154 if(kn != c->key_len) |
| 155 { | 155 { |
| 156 » fprintf(stderr,"Key length doesn't match, got %d expected %d\n",kn, | 156 » fprintf(stderr,"Key length doesn't match, got %d expected %lu\n",kn, |
| 157 » » c->key_len); | 157 » » (unsigned long)c->key_len); |
| 158 test1_exit(5); | 158 test1_exit(5); |
| 159 } | 159 } |
| 160 EVP_CIPHER_CTX_init(&ctx); | 160 EVP_CIPHER_CTX_init(&ctx); |
| 161 if (encdec != 0) | 161 if (encdec != 0) |
| 162 { | 162 { |
| 163 if(!EVP_EncryptInit_ex(&ctx,c,NULL,key,iv)) | 163 if(!EVP_EncryptInit_ex(&ctx,c,NULL,key,iv)) |
| 164 { | 164 { |
| 165 fprintf(stderr,"EncryptInit failed\n"); | 165 fprintf(stderr,"EncryptInit failed\n"); |
| 166 ERR_print_errors_fp(stderr); | 166 ERR_print_errors_fp(stderr); |
| 167 test1_exit(10); | 167 test1_exit(10); |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 if (strstr(cipher, "SEED") == cipher) | 428 if (strstr(cipher, "SEED") == cipher) |
| 429 { | 429 { |
| 430 fprintf(stdout, "Cipher disabled, skipping %s\n", cipher); | 430 fprintf(stdout, "Cipher disabled, skipping %s\n", cipher); |
| 431 continue; | 431 continue; |
| 432 } | 432 } |
| 433 #endif | 433 #endif |
| 434 fprintf(stderr,"Can't find %s\n",cipher); | 434 fprintf(stderr,"Can't find %s\n",cipher); |
| 435 EXIT(3); | 435 EXIT(3); |
| 436 } | 436 } |
| 437 } | 437 } |
| 438 fclose(f); |
| 438 | 439 |
| 439 #ifndef OPENSSL_NO_ENGINE | 440 #ifndef OPENSSL_NO_ENGINE |
| 440 ENGINE_cleanup(); | 441 ENGINE_cleanup(); |
| 441 #endif | 442 #endif |
| 442 EVP_cleanup(); | 443 EVP_cleanup(); |
| 443 CRYPTO_cleanup_all_ex_data(); | 444 CRYPTO_cleanup_all_ex_data(); |
| 444 ERR_remove_state(0); | 445 ERR_remove_thread_state(NULL); |
| 445 ERR_free_strings(); | 446 ERR_free_strings(); |
| 446 CRYPTO_mem_leaks_fp(stderr); | 447 CRYPTO_mem_leaks_fp(stderr); |
| 447 | 448 |
| 448 return 0; | 449 return 0; |
| 449 } | 450 } |
| OLD | NEW |