Now the Tandem is, shall we say, unusual. Basically you are restricted to a volume/directory/file structure, where file names cannot be longer than 8 bytes. The volume is a synonym for a physical disk - although in a burst of modernism we actually have virtual disks on some systems these days - but not on this one. Mind you, this is only 1 personality - their is another personality called OSS, which is an implementation of a UNIX like structure on top of the standard file system. So it's a single layer file system - it makes for interesting naming conventions...
So, the task. Basically it's a software implementation of DES, working out the CBC MAC of an input file. Now before some smarty says something like "Use EAYs DES lib or Gutmann's cryptlib" - refer to above. So I'm stuck with this thing. Even worse is that it is reading the file in 64 byte blocks, so it is slow as a wet week. Anyway, the thing works fine on small files, but breaks on larger files - so it's wade through someone elses butchered software DES implementation - great.
It quickly becomes obvious that the same person who wrote the scaffolding code did not write the DES stuff. The DES stuff is neat and concise - the scaffold code is pretty crap. Anyway I finally track it down to the following:
unsigned char acc_mac;
unsigned char bposmac;
/* Check length of restdata in chaningvector */
/*int_lgd = atoi( memcpy(str_lgd,chaning_vector,2) ); */
int_lgd = atoi( str_lgd );
/* if ( (int_lgd <0) || (int_lgd> 7) )
retc = 3;
Of course the problem is that str_lgd is only 2 bytes for a 2 digit number - so atoi keeps going if the first byte of acc_mac is an ascii digit. I don't know if I was more pissed at stupid C, spastic atoi or retard programmer. The weird thing is this exact code runs fine on my loonix PC - a difference in the atoi implementations I guess. The fact that it broke in differing places for different files made me chase the illusion that it was a size issue, not the classic missing null thing.
This program is about 3000 lines long, and pretty dense - I implemented it in Python using cryptlib in about 30. The best thing is that the cryptlib imp you can just change the algorithm via a parameter. it's just a shame that there is no snake on the Tandem. Even worse is that there is no C compiler on our machine in the OSS personality, so I could not even attempt to try and build cryptlib. The C compiler on the guardian personality is that old that it does not even recognise // comments. Before I get flamed by all the C people I think my biggest beef is the really crap C implementation I was working with - it almost made C look good on HPUX - heh, HP now owns Tandem, conincidence? I think not.
Just briefly - had a great time in Scotchlandia, did the usual drive through the lochs and highland country. Drove through Rannoch Moor in the evening with pissing down rain and mist - the only thing missing was a bunch of clansmen with claymores.
The boss is over here on Thursday - he warned me to have my beer hat ready for Thursday night - not a bad way to spend your birthday, drinking the bosses piss.
Just weird stuff you pick up on the net:
This one brought back a few memories.
I liked this one - just for our US friends...
I think the effect would be better if the guy had rimless glasses and a leather overcoat, with a black Merc in the background, but it's good enough...
|< Just another trip on the short bus... | BBC White season: 'Rivers of Blood' >|