Have you tried the same code on some other platform like Linux or Windows? I don't have time to look over your code, but I did notice that the first 8 bytes of the output are not what you expected and the remaining data is decrypted correctly. Seems like maybe you need to initialise a salt/IV value. I'm running OpenSSL on a StrongARM (Windows CE) and haven't seen any problems like this.
Steven -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of bepsy paul Sent: Thursday, 21 November 2002 8:25 AM To: [EMAIL PROTECTED] Subject: Building openssl-0.9.7-beta4 Hi, I am trying to port openssl on vxWorks(Tornado 2.0 vxWorks 5.4) for StrongArm(ixp1200) platform. I have a problem here. The encryption is not working for me. My code is as given below. I am using 3DES encryption first. Then to verify the output I am doing a decryption for the encrypted output. I am not getting the original input after decryption. I am not enabling DES_PTR or DES_UNROLL or any other flags in particular. Does anyone know what is going wrong here? T_VOID DoCipher(T_VOID* pCipherCtx) { int i; T_UCHAR8 *OutputBuf = calloc(64,sizeof(T_UCHAR8)); T_UCHAR8 *OutputBuf2 = calloc(64,sizeof(T_UCHAR8)); T_UCHAR8 InputBuf[] = { 0x30 ,0x31 ,0x32 ,0x33 ,0x34 ,0x35 ,0x36 ,0x37, 0x38 ,0x39 ,0x0a ,0x61 ,0x62 ,0x63 ,0x64 ,0x65, 0x66 ,0x67 ,0x68 ,0x69 ,0x6a ,0x0a ,0x6b ,0x6c, 0x6d ,0x6e ,0x6f ,0x70 ,0x71 ,0x72 ,0x73 ,0x74, 0x0a ,0x75 ,0x76 ,0x77 ,0x78 ,0x79 ,0x7a ,0x2e, 0x2e ,0x2e ,0x2e ,0x0a ,0x41 ,0x42 ,0x43 ,0x44, 0x45 ,0x46 ,0x47 ,0x48 ,0x49 ,0x4a ,0x0a ,0x4b, 0x4c ,0x4d ,0x4e ,0x4f ,0x50 ,0x51 ,0x52 ,0x53 }; ((EVP_CIPHER_CTX*)pCipherCtx)->encrypt = 1; /* Encrypt data first */ printf("\n\r Calling Encryption, EncryptFlag =%d \n\r InputData = \n\r",((EVP_CIPHER_CTX*)pCipherCtx)->encrypt); for(i=0;i<64;i++) printf("%x ",*(InputBuf+i)); /* This 'do_cipher' invokes 'des_cbc_ede_cipher' from 'e_cbc_3d.c' file */ ((EVP_CIPHER_CTX*)pCipherCtx)->cipher->do_cipher((EVP_CIPHER_CTX*)pCipherCtx ,OutputBuf, InputBuf,64);/* Encryption function */ printf("\n\r Finished Encryption, EncryptFlag =%d \n\r OutputData = \n\r",((EVP_CIPHER_CTX*)pCipherCtx)->encrypt); for(i=0;i<64;i++) printf("%x ",*(OutputBuf+i)); ((EVP_CIPHER_CTX*)pCipherCtx)->encrypt = 0; /* Decrypt the output data */ printf("\n\r Calling Decryption, EncryptFlag =%d \n\r InputData = \n\r",((EVP_CIPHER_CTX*)pCipherCtx)->encrypt); for(i=0;i<64;i++) printf("%x ",*(OutputBuf+i)); /* This 'do_cipher' invokes 'des_cbc_ede_cipher' from 'e_cbc_3d.c' file */ ((EVP_CIPHER_CTX*)pCipherCtx)->cipher->do_cipher((EVP_CIPHER_CTX*)pCipherCtx ,OutputBuf2, OutputBuf,64); /* Decryption function */ printf("\n\r Finished Decryption, EncryptFlag =%d \n\r OutputData = \n\r",((EVP_CIPHER_CTX*)pCipherCtx)->encrypt); for(i=0;i<64;i++) printf("%x ",*(OutputBuf2+i)); return; } My printf results are as follows Calling Encryption, EncryptFlag =1 InputData = 30 31 32 33 34 35 36 37 38 39 a 61 62 63 64 65 66 67 68 69 6a a 6b 6c 6d 6e 6f 70 71 72 73 74 a 75 76 77 78 79 7a 2e 2e 2e 2e a 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 Finished Encryption, EncryptFlag =1 OutputData = fd cd 8 dc 9a 47 ea c3 d7 dc 12 4e d3 7a 4d 73 a7 ad 29 b7 d4 10 86 62 1f 9d b4 e3 a6 3a 1f 31 51 43 f5 19 af 98 6f 2c 23 c2 5c 9c c6 9a 30 34 c 59 d6 9f 2a 51 71 55 93 fb 9b a7 18 11 6c 4e Calling Decryption, EncryptFlag =0 InputData = fd cd 8 dc 9a 47 ea c3 d7 dc 12 4e d3 7a 4d 73 a7 ad 29 b7 d4 10 86 62 1f 9d b4 e3 a6 3a 1f 31 51 43 f5 19 af 98 6f 2c 23 c2 5c 9c c6 9a 30 34 c 59 d6 9f 2a 51 71 55 93 fb 9b a7 18 11 6c 4e Finished Decryption, EncryptFlag =0 OutputData = a6 1e 90 53 e5 b b7 84 38 39 a 61 62 63 64 65 66 67 68 69 6a a 6b 6c 6d 6e 6f 70 71 72 73 74 a 75 76 77 78 79 7a 2e 2e 2e 2e a 41 42 43 44 45 46 47 48 49 4a a 4 b 4c 4d 4e 4f 50 51 52 53 Does anyone has specific files- Configure/Makefile -for vxworks strongarm platform? Or anyone knows which all flags need to be enabled for vxWorks strongarm platform? Or where can I find the detailed procedure for vxWorks platform compilation/installation? Please help. I am new to openssl porting area. Thanks in advance, Best Regards, BPaul >From: "Chris Jarshant" <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: <[EMAIL PROTECTED]> >Subject: OCSP app bug >Date: Wed, 20 Nov 2002 14:46:19 -0500 > >The OCSP app seems to not handle the -rother option correctly. >Look at apps/ocsp.c. The 'rcertfile' variable in main() is >set when you give the app the -rother option, but then >it's not used in the load_certs() invocation. > >This effectively hangs the ocsp app when the -rother switch >is used, since it's trying to read certs from stdin. > >cj _________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED] ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]
