Community discussions

 
sonyisda1
just joined
Topic Author
Posts: 6
Joined: Fri Aug 12, 2011 12:13 am

Still getting old API '=ret' on 6.45.1

Wed Jul 17, 2019 4:51 pm

Is it still expected to get the old API style of login challenge response on a 6.45.1? I am using 951G 2HnD. From all the documentation it seems that only new API method is supported so I would expect to not even get a response from old deprecated API login. Can someone please explain?
 
sonyisda1
just joined
Topic Author
Posts: 6
Joined: Fri Aug 12, 2011 12:13 am

Re: Still getting old API '=ret' on 6.45.1

Fri Jul 19, 2019 3:12 pm

Anyone else see this??

Here is excerpt from my output log:
2019/07/18 12:55:32 WriteWord       Word to write is /login
2019/07/18 12:55:32 WriteLen        length of word is 6
2019/07/18 12:55:32 WriteWord       Word to write is =name=admin
2019/07/18 12:55:32 WriteLen        length of word is 11
2019/07/18 12:55:32 WriteWord       Word to write is =passsword=8F0250DFD3A7FFEA2B3E2CD3D2E6F14865E973D3
2019/07/18 12:55:32 WriteLen        length of word is 51
2019/07/18 12:55:32 WriteWord       Word to write is .tag=logininitv2
2019/07/18 12:55:32 WriteLen        length of word is 16
2019/07/18 12:55:32 WriteWord       Word to write is 
2019/07/18 12:55:32 WriteLen        length of word is 0
2019/07/18 12:55:46 ReadLen         byte1 = 0x5
2019/07/18 12:55:46 ReadLen         1-byte encoded length
2019/07/18 12:55:46 AddWordToSentence return sentence contains !done
2019/07/18 12:55:46 ReadLen         byte1 = 0x10
2019/07/18 12:55:46 ReadLen         1-byte encoded length
2019/07/18 12:55:46 ReadLen         byte1 = 0x25
2019/07/18 12:55:46 ReadLen         1-byte encoded length
2019/07/18 12:55:46 ReadLen         byte1 = 0
2019/07/18 12:55:46 ReadLen         1-byte encoded length
2019/07/18 12:55:46 AddSentenceToBlock iNewLength=1
2019/07/18 12:55:46 AddSentenceToBlock stBlock->iLength = 1
2019/07/18 12:55:46 PrintSentence   Sentence iLength = 3
2019/07/18 12:55:46 PrintSentence   Sentence iReturnValue = 1
2019/07/18 12:55:46 PrintSentence   >>> !done
2019/07/18 12:55:46 PrintSentence   >>> .tag=logininitv2
2019/07/18 12:55:46 PrintSentence   >>> =ret=ea0c76b38f785c781e25802047a1ec91
You can see that I send
/login
along with
=name
and
=password
before an empty character, but in the return I get
=ret
. Note I have tried without the
.tag
and no difference.

This is C project loosely based from https://github.com/haakonnessjoen/librouteros-api and https://wiki.mikrotik.com/wiki/API_in_C

Again this is on 6.45.1 ROS. I have also tried on hEX lite with same results. Any help greatly appreciated!
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5910
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Still getting old API '=ret' on 6.45.1

Mon Jul 22, 2019 4:06 pm

I don't think that API is returning =ret, it looks more like a bug in that C code.
To verify what exactly RouterOS is sending back run a packet sniffer.
 
sonyisda1
just joined
Topic Author
Posts: 6
Joined: Fri Aug 12, 2011 12:13 am

Re: Still getting old API '=ret' on 6.45.1

Mon Jul 22, 2019 5:05 pm

Ran Wireshark, and can see the =ret data...
2019-07-22 09_04_01-Wireshark · Packet 76 · Inatek Ethernet.png
You do not have the required permissions to view the files attached to this post.
 
sonyisda1
just joined
Topic Author
Posts: 6
Joined: Fri Aug 12, 2011 12:13 am

Re: Still getting old API '=ret' on 6.45.1

Fri Aug 02, 2019 8:06 pm

Anyone else see this issue? I see many updated example API implementations support falling back to original login method when the `=ret` is found in the return data. For my case it would treat the login of my 6.45.1 ROS as legacy and then try to original login method which fails.

So why is legacy return data happening in ROS that deprecates that legacy login method?
 
sonyisda1
just joined
Topic Author
Posts: 6
Joined: Fri Aug 12, 2011 12:13 am

Re: Still getting old API '=ret' on 6.45.1  [SOLVED]

Wed Aug 14, 2019 10:48 pm

OK I feel really dumb :oops: It was a typo on my part and is even evident in my output log posting. I had one too many 's' in password
2019/07/18 12:55:32 WriteWord       Word to write is =passsword=8F0250DFD3A7FFEA2B3E2CD3D2E6F14865E973D3
2019/07/18 12:55:32 WriteLen        length of word is 51

But there is still the question why does a 6.45.1+ ROS still respond with the legacy login `=ret` when that has been deprecated?? I think it would alleviate future confusion to not give that response if not supported.

Who is online

Users browsing this forum: No registered users and 8 guests