Creating PAS in ADC

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

Locked
ullner
Forum Moderator
Posts: 333
Joined: 2004-09-10 11:00
Contact:

Creating PAS in ADC

Post by ullner » 2006-05-23 09:25

I've been trying to do PAS but failing miserably. Here's my current code;

Code: Select all

Tiger myTiger = new Tiger();
myTiger.engineReset();
myTiger.init();	

byte[] randomDataByte = Base32Decoder.decode(randomData);

myTiger.engineUpdate(Identification.getCid().getBytes(), 0, Identification.getCid().length());   // the CID is in Base32
myTiger.engineUpdate(password.getBytes(), 0, password.length());
myTiger.engineUpdate(randomDataByte, 0, randomData.length()*5/8);

byte[] finalTiger = myTiger.engineDigest();
line = "HPAS " + Base32Encoder.encode(finalTiger);
Can anyone see what is wrong? I've been looking at DC++'s PAS generation but I can't find anything obvious...

TheParanoidOne
Forum Moderator
Posts: 1420
Joined: 2003-04-22 14:37

Post by TheParanoidOne » 2006-05-23 09:38

Without knowing what the code is supposed to be doing, the first question I would ask is, what exactly is failing?
The world is coming to an end. Please log off.

DC++ Guide | Words

ullner
Forum Moderator
Posts: 333
Joined: 2004-09-10 11:00
Contact:

Post by ullner » 2006-05-23 09:45

I'm failing to get accepted by the hub. (Getting a STA223 [Invalid password] back.)

ullner
Forum Moderator
Posts: 333
Joined: 2004-09-10 11:00
Contact:

Post by ullner » 2006-05-23 18:43

Snatched some new code concerning the Base32 decoder/encoder fron Bitzi... Seemed to have done the trick. No idea why it didn't work before...

I still seem to get decode(encode(x)) != x... But I'll live with it. No other part in the protocol require a decode on the client side, so I'm going to ignore it. Ignorance is bliss, eh?

Locked