BCM5820 driver

2003-02-14 Thread bepsy paul
Hi,

 I am working on BCM5820 driver for vxWorks on ixp1200 platform. Has anyone 
developed/ported this driver onto ixp1200? If anyone know how to port it, 
please reply.

Thanks in advance,
Bepsy




From:  via RT [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: [openssl.org #506] DES CBC Initial Vector Parameter Problem Date: 
Fri, 14 Feb 2003 21:22:39 +0100 (MET)

Hi,

I'm using the latest (0.9.7) Crypto lib to encrypt a string of clear
text, by using CBC mode with IV preset to 8 bytes of 0x00.
When the encrypted text was decrypted back to plain text, the first 8
bytes are bad text.  I believe there are something to do with the IV
parameter, or I call the functions incorrectly.  Please help!!

Here are the source code and the output:
=

#include iostream.h
#include stdio.h
#include openssl/des.h

#include HubUtil.h

int main() {

  char mKey[8];
  mKey[0] = 0xb1;
  mKey[1] = 0xa5;
  mKey[2] = 0x38;
  mKey[3] = 0x58;
  mKey[4] = 0xb2;
  mKey[5] = 0x60;
  mKey[6] = 0xd7;
  mKey[7] = 0x38;

  char myIV[8];
  myIV[0] = 0x00;
  myIV[1] = 0x00;
  myIV[2] = 0x00;
  myIV[3] = 0x00;
  myIV[4] = 0x00;
  myIV[5] = 0x00;
  myIV[6] = 0x00;
  myIV[7] = 0x00;

  DES_cblock cbKey;
  DES_cblock cbIV;
  DES_key_schedule kSchedule;

  char inS[] = Hello c++ World;
  unsigned char input[19];

  int i;
  for(i=0; istrlen(inS); i++) {
input[i] = (unsigned) inS[i];
  }

  char inHex[39];
  HubUtil::bytesToHex(input, inHex, 19);

  cout  Input hex:   inHex  endl;

  unsigned char output[24];

  DES_string_to_key(mKey, cbKey);
  DES_string_to_key(myIV, cbIV);
  DES_set_key_unchecked(cbKey, kSchedule);
  DES_ncbc_encrypt(input, output, 19, kSchedule, cbIV, 1);

  cout  In :   input  endl;

  unsigned char output2[19];
  DES_ncbc_encrypt(output, output2, 24, kSchedule, cbIV, 0);

  char outHex[39];
  HubUtil::bytesToHex(output2, outHex, 19);

  cout  Decrypted hex:   outHex  endl;

  return 0;
}
=
byteToHex - input char in decimal value: H
byteToHex - input char in decimal value: e
byteToHex - input char in decimal value: l
byteToHex - input char in decimal value: l
byteToHex - input char in decimal value: o
byteToHex - input char in decimal value:
byteToHex - input char in decimal value: c
byteToHex - input char in decimal value: +
byteToHex - input char in decimal value: +
byteToHex - input char in decimal value:
byteToHex - input char in decimal value: W
byteToHex - input char in decimal value: o
byteToHex - input char in decimal value: r
byteToHex - input char in decimal value: l
byteToHex - input char in decimal value: d
byteToHex - input char in decimal value: !
byteToHex - input char in decimal value: !
byteToHex - input char in decimal value: !
byteToHex - input char in decimal value: !
Input hex: 48656C6C6F20632B2B20576F726C6421212121
In : Hello c++ World
byteToHex - input char in decimal value: ¬
byteToHex - input char in decimal value: ¦
byteToHex - input char in decimal value: (
byteToHex - input char in decimal value: e
byteToHex - input char in decimal value: )
byteToHex - input char in decimal value: ^
byteToHex - input char in decimal value: E
byteToHex - input char in decimal value: ó
byteToHex - input char in decimal value: +
byteToHex - input char in decimal value:
byteToHex - input char in decimal value: W
byteToHex - input char in decimal value: o
byteToHex - input char in decimal value: r
byteToHex - input char in decimal value: l
byteToHex - input char in decimal value: d
byteToHex - input char in decimal value: !
byteToHex - input char in decimal value: !
byteToHex - input char in decimal value: !
byteToHex - input char in decimal value: !
Decrypted hex: ACA62865295E45F32B20576F726C6421212121
=


Ken Ho
__
OpenSSL Project http://www.openssl.org
Development Mailing List   [EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]


_
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]


RE: Building openssl-0.9.7-beta4

2002-11-20 Thread bepsy paul
Thanks a lot for your suggestion. I too noticed that the first 8 bytes only 
have problem. I will try on other platform and verify this.

Regards,
BPaul


From: Steven Reddie [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: Building openssl-0.9.7-beta4
Date: Thu, 21 Nov 2002 11:04:38 +1100

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;i64;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;i64;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;i64;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;i64;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