~nicohman/wyvern

3 2

Re: How do I download a game?

Timothy Allen
Details
Message ID
<b65b3296aa0b15a239dcc67c790a8bf653276f1e.camel@gmail.com>
Sender timestamp
1547714679
DKIM signature
missing
Download raw message
On Wed, 2019-01-16 at 23:22 -0800, Nico Hickman wrote:
> Hmm. That’s very unusual and should work just fine. I just tested my
> build of that ref with those exact arguments and it worked perfectly,
> downloading the installer to the current directory.

That's super-weird.

I notice the "gog" crate's download function says:

let temp_response = self.client_noredirect.borrow().get(&url).send();
if temp_response.is_ok() {
    // ...
} else {
    return None;
}

...so if there *is* any error returned, it's being silently ignored. I
tried busting out gdb to see if I could peek into the response value,
but my gdb skill is evidently not strong enough.

> Thanks for being so detailed, by the way. Have you tried downloading
> any other games, including other windows games? It’s pretty late
> here, so I’ll try and do some more detailed investigating in the
> morning. Thanks for the bug report, though!

I picked Tyrian 2000 because it's free, but I have this behaviour for
most of the games I've tried, including "X-Com: UFO Defense", Deponia,
Xenonauts, Anno 1602, Titan Quest, Sunless Sea... some of which have
Linux builds and some of which do not.

The one game where I *haven't* had this problem is the backer beta for
Bloodstained: Ritual of the Night. Apparently GOG Galaxy can have both
"release" and "beta" channels like Steam, and because Bloodstained is
not yet publicly available, its "release" channel contains no files.
The GOG website and lgogdownloader's normal mode say it has no files,
but via lgogdownloader's experimental "--galaxy-show-builds" option
finds it.

Wyvern crashes:

thread 'main' panicked at 'index out of bounds: the len is 0 but the
index is 0', libcore/slice/mod.rs:2454:14

The relevant part of the backtrace is:

gog::Gog::get_game_details at ./rustbud-env/registry/src/github.com-
1ecc6299db9ec823/gog-0.1.3/src/lib.rs:243

> > On Jan 16, 2019, at 11:09 PM, Timothy Allen <thristian@gmail.com>
> > wrote:
> > 
> > I cloned the Wyvern repo at commit
> > a2e12c41fda8ce93c175c9eaa1d54ffa0df891a8 (tag 1.0.1).
> > 
> > I ran "cargo build" to build a binary, then ran
> > "./target/debug/wyvern
> > ls". It prompted me to provide a login token, which I did, and it
> > worked very nicely.
> > 
> > Next I ran "./target/debug/wyvern down -f -w -s tyrian", and it
> > instantly produced the following output:
> > 
> > No linux version available. Downloading windows version.
> > Done downloading!
> > 
> > Tyrian 2000[1] is not a huge game (21MB, says the website), but I
> > would
> > expect it to take a little longer to download than "instant". Also,
> > I
> > have no idea where it thinks it's downloading *to*.
> > 
> > What am I missing?
> > 
> > 
> > [1]: https://www.gog.com/game/tyrian_2000
> 
> 

Re: How do I download a game?

Details
Message ID
<8f6bf6c94aa52a20b574691d42835275@demenses.net>
In-Reply-To
<b65b3296aa0b15a239dcc67c790a8bf653276f1e.camel@gmail.com> (view parent)
Sender timestamp
1547764356
DKIM signature
missing
Download raw message
Ok, this appears to be two separate issues, one of which is easily corrected, and the other which
is less so. The crashing issue originates from the gog crate, where evidently it's possibly for
game request to succeed but not return any information--I'll fix that pretty easily.

> The GOG website and lgogdownloader's normal mode say it has no files,
> but via lgogdownloader's experimental "--galaxy-show-builds" option
> finds it.

Right now, wyvern uses the same API as the website, so it's not going to be able to download that
game. I will see about adding an option similar to that, though.

The second issue is the whole not finding any files to download thing. It appears like for some
reason every request being made through the no-redirect client is failing, though I don't know why.
If it's not too much trouble, could I ask you to try building wyvern with a version of the gog
crate patched to print those errors? Just change the gog line in Cargo.toml to

gog = {path = "gog" }

Clone the gog crate from https://git.sr.ht/~nicohman/gogapi-rs, and add a line at line # 272 that
says

println!("{:?}", temp_response);

Then try compiling wyvern and testing it. It's a bit annoying, but it should print out the exact
error that's occurring. I almost think that it has something to do with your openssl version, but
if it's correctly signing in then that's probably not it. Sorry for the issues and thanks for your
cooperation!

Re: How do I download a game?

Details
Message ID
<34183c3162b84c681eeefb02aae13b03@demenses.net>
In-Reply-To
<8f6bf6c94aa52a20b574691d42835275@demenses.net> (view parent)
Sender timestamp
1547774809
DKIM signature
missing
Download raw message
> The crashing issue originates from the gog crate, where evidently it's possibly for
> game request to succeed but not return any information--I'll fix that pretty easily.

Semi-fixed this issue. Wyvern will still crash, but will crash with a more informative error message, once gog is updated.

Re: How do I download a game?

Timothy Allen
Details
Message ID
<809eb181d4b6edfd1f685c6374eaa3f04b775f10.camel@gmail.com>
In-Reply-To
<8f6bf6c94aa52a20b574691d42835275@demenses.net> (view parent)
Sender timestamp
1547777589
DKIM signature
missing
Download raw message
On Thu, 2019-01-17 at 22:32 +0000, nicohman wrote:
> Then try compiling wyvern and testing it. It's a bit annoying, but it
> should print out the exact
> error that's occurring. I almost think that it has something to do
> with your openssl version, but
> if it's correctly signing in then that's probably not it.

Turns out, you guessed correctly!

I added the println!() (turns out I couldn't use the handy new dbg!()
macro because it consumes its argument), and got the following output:

Err(Error { kind: Hyper(Error { kind: Connect, cause: Custom { kind:
Other, error: Ssl(Error { code: ErrorCode(1), cause:
Some(Ssl(ErrorStack([Error { code: 336908658, library: "SSL routines",
function: "tls12_check_peer_sigalg", reason: "wrong signature type",
file: "../ssl/t1_lib.c", line: 1110 }]))) }, X509VerifyResult { code:
0, error: "ok" }) } }), url: Some("
https://gog.com/downloads/tyrian_2000/en1installer1") })

A few web-searches later and I discovered a similar error report:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=912759

...which links to OpenSSL's issue tracker:

https://github.com/openssl/openssl/issues/7126

My understanding of the problem is:

- when a TLS client connects to a server, it says what signature
algorithms it supports
- up until recently, everybody almost always asked for SHA1, since it
was pretty secure and widely available
- now SHA1 is known to be insecure, so clients request stronger
signatures
- some badly-written servers respond with SHA1 *anyway* (at least for
the first response packet?), even though they support the stronger
signatures the client requests
- recently Debian updated its openssl to actually complain about such
servers instead of silently ignoring the problem
- probably this will continue to be a problem until Chrome makes the
same change

Based on an example from the github issue, I ran:

openssl s_client -connect gog.com:443 -cipher DEFAULT@SECLEVEL=2

...and although it connected and obtained a certificate, etc. the
openssl tool failed to negotiate a cipher and exited.

I then tried changing "SECLEVEL=2" to "SECLEVEL=1" and it worked
perfectly. I commented out the corresponding line in
/etc/ssl/openssl.cnf and now Wyvern can download Tyrian 2000
successfully.

Interestingly, "www.gog.com" does not have this problem, since that
name is hosted by Akamai, who have their TLS configured correctly.
Also, apparently this problem isn't one of the ones that SSL Labs tests
for, and gog.com gets an "A" score.

In summary: not a bug in Wyvern, but maybe Wyvern could be a bit more
verbose about logging what it's doing, to make errors easier to
diagnose. Should I file an issue about that?
Reply to thread Export thread (mbox)