Jump to content




Need help with authentication controller.

networking peripheral api

2 replies to this topic

#1 CitadelCore

  • Members
  • 8 posts
  • LocationSouth Australia

Posted 09 October 2016 - 07:11 AM

Hello,
I'm currently writing two programs, one to run on a computer which sits next to a BioLock from Gopher's Peripherals. The other program serves as the authentication server. All communications are public-key encrypted with keys being generated and negotiated on-the-fly with the Advanced Cipher Block from Computronics.

However, when I try to authenticate myself, the script on the authentication server crashes with this error:

textutils:295: attempt to concatentate string and table

I've been over the code numerous times and tried a lot of different fixes. None work. If you were wondering, no, it's not a problem with the encryption, that has already been confirmed as working. The crash occurs sometime between when the server receives the biolock's data from the client and tries to authenticate it against the database, although I can't work out where.

I'm not very experienced with Lua, so some assistance would be great.

Here are the two programs (receive and access keys redacted for obvious reasons)

Server:

Spoiler

Client:

Spoiler

Thanks,
CitadelCore

Edited by CitadelCore, 09 October 2016 - 07:38 PM.


#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 09 October 2016 - 09:52 AM

The error is being generated by this line (you can also find the ComputerCraft API Lua source files if you extract out the mod archive), which'd put you inside a textutils.unserialise() call, and implies you called that function with a table as an argument.

There are three places where your server script calls textutils.unserialise(); lines 105, 148, and 167. The latter two have you attempting to unserialise what recieveSecureRednet() returned, which, due to line 105 sitting within that function, should indeed already be a table.

Edited by Bomb Bloke, 09 October 2016 - 09:55 AM.


#3 CitadelCore

  • Members
  • 8 posts
  • LocationSouth Australia

Posted 09 October 2016 - 07:37 PM

Thank you! The program's running fine now :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users