Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353845
b: refs/heads/master
c: 2d33309
h: refs/heads/master
i:
  353843: 0580a41
v: v3
  • Loading branch information
Johan Meiring authored and Greg Kroah-Hartman committed Jan 7, 2013
1 parent 338e009 commit f242961
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9413127a92f7f2607b9b0df13bce3698943413d9
refs/heads/master: 2d33309ef901156b0ad8e2185bec3c06d46976ef
46 changes: 23 additions & 23 deletions trunk/drivers/staging/wlags49_h2/wl_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ extern dbg_info_t *DbgInfo;
* OK
*
******************************************************************************/
int wl_wep_code( char *szCrypt, char *szDest, void *Data, int nLen )
int wl_wep_code(char *szCrypt, char *szDest, void *Data, int nLen)
{
int i;
int t;
Expand All @@ -115,16 +115,16 @@ int wl_wep_code( char *szCrypt, char *szDest, void *Data, int nLen )
/*------------------------------------------------------------------------*/


for( i = bits = 0 ; i < MACADDRESS_STR_LEN; i++ ) {
for (i = bits = 0; i < MACADDRESS_STR_LEN; i++) {
bits ^= szCrypt[i];
bits += szCrypt[i];
}

for( i = t = *szDest = 0; i < nLen; i++, t++ ) {
k = szData[i] ^ ( bits + i );
for (i = t = *szDest = 0; i < nLen; i++, t++) {
k = szData[i] ^ (bits + i);


switch( i % 3 ) {
switch (i % 3) {

case 0 :

Expand All @@ -137,25 +137,25 @@ int wl_wep_code( char *szCrypt, char *szDest, void *Data, int nLen )

case 1 :

szDest[t] += (( k & 0xF0 ) >> 4 );
szDest[t+1] = (( k & 0x0F ) << 2 ) + CH_START ;
szDest[t] += ((k & 0xF0) >> 4);
szDest[t+1] = ((k & 0x0F) << 2) + CH_START ;
szDest[t+2] = '\0';

break;


case 2 :

szDest[t] += (( k & 0xC0 ) >> 6 );
szDest[t+1] = ( k & 0x3F ) + CH_START ;
szDest[t] += ((k & 0xC0) >> 6);
szDest[t+1] = (k & 0x3F) + CH_START ;
szDest[t+2] = '\0';
t++;

break;
}
}

return( strlen( szDest )) ;
return(strlen(szDest)) ;

}
/*============================================================================*/
Expand All @@ -182,7 +182,7 @@ int wl_wep_code( char *szCrypt, char *szDest, void *Data, int nLen )
* OK
*
******************************************************************************/
int wl_wep_decode( char *szCrypt, void *Dest, char *szData )
int wl_wep_decode(char *szCrypt, void *Dest, char *szData)
{
int i;
int t;
Expand All @@ -192,40 +192,40 @@ int wl_wep_decode( char *szCrypt, void *Dest, char *szData )
/*------------------------------------------------------------------------*/


for( i = bits = 0 ; i < 12; i++ ) {
for (i = bits = 0; i < 12; i++) {
bits ^= szCrypt[i] ;
bits += szCrypt[i] ;
}

nLen = ( strlen( szData ) * 3) / 4 ;
nLen = (strlen(szData) * 3) / 4 ;

for( i = t = 0; i < nLen; i++, t++ ) {
switch( i % 3 ) {
for (i = t = 0; i < nLen; i++, t++) {
switch (i % 3) {
case 0 :

szDest[i] = ((( szData[t]-CH_START ) & 0x3f ) << 2 ) +
((( szData[t+1]-CH_START ) & 0x30 ) >> 4 );
szDest[i] = (((szData[t] - CH_START) & 0x3f) << 2) +
(((szData[t+1] - CH_START) & 0x30) >> 4);
break;


case 1 :
szDest[i] = ((( szData[t]-CH_START ) & 0x0f ) << 4 ) +
((( szData[t+1]-CH_START ) & 0x3c ) >> 2 );
szDest[i] = (((szData[t] - CH_START) & 0x0f) << 4) +
(((szData[t+1] - CH_START) & 0x3c) >> 2);
break;


case 2 :
szDest[i] = ((( szData[t]-CH_START ) & 0x03 ) << 6 ) +
(( szData[t+1]-CH_START ) & 0x3f );
szDest[i] = (((szData[t] - CH_START) & 0x03) << 6) +
((szData[t+1] - CH_START) & 0x3f);
t++;
break;
}

szDest[i] ^= ( bits + i ) ;
szDest[i] ^= (bits + i);

}

return( i ) ;
return(i) ;

}
/*============================================================================*/
Expand Down

0 comments on commit f242961

Please sign in to comment.