elipsitz / SteamTrade

Android Steam Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SteamKit fork login issue

n4bz0r opened this issue · comments

Hello. I'm using your fork of SteamKit-Java, but can't simply log in. I've described my problem here: SteamRE/SteamKit#105. Still can't figure out. I'm simply trying to do smth like this:

steamClient.connect();

and after getting connected callback:

steamUser.logOn("login", "passwd");

It seems there is problem with proto messages. Maybe you've changed something and did not commit in repository?

Are you working on Android?

Please see https://github.com/Top-Cat/ScrapBank.tf/blob/master/src/main/java/uk/co/thomasc/scrapbanktf/Bot.java#L151 for an example of a proper way to log in to the Steam network with SteamKit-Java.

Yes on Android. It was typo on first post. I'm doing exactly same thing as scrapbank.tf bot using LogOnDetails(). I've tried to do same thing on C# and it works. I think it's something with my steamkit build.

Have you tried it not on Android?

On Sun, Mar 15, 2015 at 10:19 AM, Newbie notifications@github.com wrote:

Yes on Android. It was typo on first post. I'm doing exactly same this as
scrapbank.tf bot using LogOnDetails(). I've tried to do same thing on C#
and it works. I think it's something with my steamkit build.


Reply to this email directly or view it on GitHub
#2 (comment).

Just made simple console application and tried TopCat's thing. Got same problem.

TcpConnection: Connecting to [208.64.200.201:27017]...
TcpConnection: Connected!
Bot #0: Bot started
CMClient: <- Recv'd EMsg: ChannelEncryptRequest (1303) (Proto: false)
CMClient: Got encryption request. Universe: Public Protocol ver: 1
CMClient: Sent -> EMsg: ChannelEncryptResponse (Proto: false)
CMClient: <- Recv'd EMsg: ChannelEncryptResult (1305) (Proto: false)
CMClient: Encryption result: OK
Bot #0: Connected. Trying to log on
CMClient: Sent -> EMsg: ClientLogon (Proto: true)
java.security.InvalidKeyException: Illegal key size or default parameters
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1011)
    at javax.crypto.Cipher.init(Cipher.java:1209)
    at javax.crypto.Cipher.init(Cipher.java:1153)
    at uk.co.thomasc.steamkit.util.crypto.CryptoHelper.SymmetricEncrypt(CryptoHelper.java:114)
    at uk.co.thomasc.steamkit.networking.steam3.NetFilterEncryption.processOutgoing(NetFilterEncryption.java:20)
    at uk.co.thomasc.steamkit.networking.steam3.TcpConnection.send(TcpConnection.java:112)
    at uk.co.thomasc.steamkit.steam3.CMClient.send(CMClient.java:263)
    at uk.co.thomasc.steamkit.steam3.handlers.steamuser.SteamUser.logOn(SteamUser.java:106)
    at com.n4bz0r.steambotconsole.Bot$1.call(Bot.java:68)
    at com.n4bz0r.steambotconsole.Bot$1.call(Bot.java:62)
    at uk.co.thomasc.steamkit.steam3.steamclient.callbackmgr.CallbackMsg.handle(CallbackMsg.java:40)
    at com.n4bz0r.steambotconsole.Bot.handleSteamMessage(Bot.java:62)
    at com.n4bz0r.steambotconsole.Bot.update(Bot.java:51)
    at com.n4bz0r.steambotconsole.Main$BotThread.run(Main.java:42)
    at java.lang.Thread.run(Thread.java:744)

It might be CryptoHelper class problem (SymmetricEncrypt/Decrypt methods). If it's working for you, you've might changed them a bit.

That error means you don't have your cryptography library properly set up.
Due to US export laws, you have to separately download the Java
Cryptography Extension (JCE).
On Mar 15, 2015 11:00 AM, "Newbie" notifications@github.com wrote:

Just made simple console application and tried TopCat's thing. Got same
problem.

TcpConnection: Connecting to [208.64.200.201:27017]...TcpConnection: Connected!Bot #0: Bot startedCMClient: <- Recv'd EMsg: ChannelEncryptRequest (1303) (Proto: false)CMClient: Got encryption request. Universe: Public Protocol ver: 1CMClient: Sent -> EMsg: ChannelEncryptResponse (Proto: false)CMClient: <- Recv'd EMsg: ChannelEncryptResult (1305) (Proto: false)CMClient: Encryption result: OKBot #0: Connected. Trying to log onCMClient: Sent -> EMsg: ClientLogon (Proto: true)java.security.InvalidKeyException: Illegal key size or default parameters
at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1011)
at javax.crypto.Cipher.init(Cipher.java:1209)
at javax.crypto.Cipher.init(Cipher.java:1153)
at uk.co.thomasc.steamkit.util.crypto.CryptoHelper.SymmetricEncrypt(CryptoHelper.java:114)
at uk.co.thomasc.steamkit.networking.steam3.NetFilterEncryption.processOutgoing(NetFilterEncryption.java:20)
at uk.co.thomasc.steamkit.networking.steam3.TcpConnection.send(TcpConnection.java:112)
at uk.co.thomasc.steamkit.steam3.CMClient.send(CMClient.java:263)
at uk.co.thomasc.steamkit.steam3.handlers.steamuser.SteamUser.logOn(SteamUser.java:106)
at com.n4bz0r.steambotconsole.Bot$1.call(Bot.java:68)
at com.n4bz0r.steambotconsole.Bot$1.call(Bot.java:62)
at uk.co.thomasc.steamkit.steam3.steamclient.callbackmgr.CallbackMsg.handle(CallbackMsg.java:40)
at com.n4bz0r.steambotconsole.Bot.handleSteamMessage(Bot.java:62)
at com.n4bz0r.steambotconsole.Bot.update(Bot.java:51)
at com.n4bz0r.steambotconsole.Main$BotThread.run(Main.java:42)
at java.lang.Thread.run(Thread.java:744)


Reply to this email directly or view it on GitHub
#2 (comment).

It works as console app but there is exactly same problem as before on android.

You need to make sure bouncy/spongycastle and JCE are properly configured.
On Mar 15, 2015 12:06 PM, "Newbie" notifications@github.com wrote:

It works as console app but there is same error as before on android.


Reply to this email directly or view it on GitHub
#2 (comment).

I can install this policies on local machine but how do I configure android the same way? I mean all things like Security.insertProviderAt(new org.spongycastle.jce.provider.BouncyCastleProvider(), 1); and getInstance("sumshit", "SC"); are done.
BTW If you'll clone your project and try to compile, will it pass all the tests "from the box"?

I'm getting this output after building the project:

-------------------------------------------------------------------------------
Test set: org.spout.steamkit.util.crypto.CryptoHelperTest
-------------------------------------------------------------------------------
Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.219 sec <<< FAILURE!
testSymetric(org.spout.steamkit.util.crypto.CryptoHelperTest)  Time elapsed: 0.216 sec  <<< ERROR!
java.lang.SecurityException: JCE cannot authenticate the provider SC
    at javax.crypto.Cipher.getInstance(Cipher.java:642)
    at javax.crypto.Cipher.getInstance(Cipher.java:580)
    at uk.co.thomasc.steamkit.util.crypto.CryptoHelper.SymmetricDecrypt(CryptoHelper.java:160)
    at org.spout.steamkit.util.crypto.CryptoHelperTest.testSymetric(CryptoHelperTest.java:49)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        <...>
Caused by: java.util.jar.JarException: file:/C:/Users/newbie/.m2/repository/com/madgag/scprov-jdk15on/1.47.0.2/scprov-jdk15on-1.47.0.2.jar has unsigned entries - org/spongycastle/i18n/LocalizedMessage$FilteredArguments.class
    at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:462)
    at javax.crypto.JarVerifier.verifyJars(JarVerifier.java:322)
    at javax.crypto.JarVerifier.verify(JarVerifier.java:250)
    at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:161)
    at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:187)
    at javax.crypto.Cipher.getInstance(Cipher.java:638)
    ... 32 more

There is something wrong with your spongycastle jar. I don't know what
exactly... Make sure you're downloading the correct jar.
On Mar 21, 2015 5:26 PM, "Newbie" notifications@github.com wrote:

I'm getting this output after building the project:

-------------------------------------------------------------------------------Test set: org.spout.steamkit.util.crypto.CryptoHelperTest-------------------------------------------------------------------------------Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.219 sec <<< FAILURE!
testSymetric(org.spout.steamkit.util.crypto.CryptoHelperTest) Time elapsed: 0.216 sec <<< ERROR!java.lang.SecurityException: JCE cannot authenticate the provider SC
at javax.crypto.Cipher.getInstance(Cipher.java:642)
at javax.crypto.Cipher.getInstance(Cipher.java:580)
at uk.co.thomasc.steamkit.util.crypto.CryptoHelper.SymmetricDecrypt(CryptoHelper.java:160)
at org.spout.steamkit.util.crypto.CryptoHelperTest.testSymetric(CryptoHelperTest.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
<...>Caused by: java.util.jar.JarException: file:/C:/Users/newbie/.m2/repository/com/madgag/scprov-jdk15on/1.47.0.2/scprov-jdk15on-1.47.0.2.jar has unsigned entries - org/spongycastle/i18n/LocalizedMessage$FilteredArguments.class
at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:462)
at javax.crypto.JarVerifier.verifyJars(JarVerifier.java:322)
at javax.crypto.JarVerifier.verify(JarVerifier.java:250)
at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:161)
at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:187)
at javax.crypto.Cipher.getInstance(Cipher.java:638)
... 32 more


Reply to this email directly or view it on GitHub
#2 (comment).

I'm using one you've specified in pom.xml

<dependency>
    <groupId>com.madgag</groupId>
    <artifactId>scpg-jdk15on</artifactId>
    <version>1.47.0.2</version>
</dependency>

I've tried different versions from repo you've specified, different versions from here https://rtyley.github.io/spongycastle/. Can you just upload somewhere your spongycastle jars to make sure?

write this in your gradle file:

compile 'com.madgag.spongycastle:core:1.51.0.0'
compile 'com.madgag.spongycastle:prov:1.51.0.0'

the provider needs the core.