getlantern / keyman

Easy golang RSA key management
Apache License 2.0
16 stars 11 forks source link

Don't statically link to runtime #1

Open myleshorton opened 10 years ago

myleshorton commented 10 years ago

We don't need to statically link to the runtime here.

myleshorton commented 10 years ago

Hey @oxtoacart I just tweaked this a bit so we don't need to do all the static linking shenanigans. Makes the executable much smaller and just a bit cleaner.

teamlantern commented 10 years ago

nice! how small is it now?

On Fri, May 9, 2014 at 7:17 PM, myleshorton notifications@github.comwrote:

Hey @oxtoacart https://github.com/oxtoacart I just tweaked this a bit so we don't need to do all the static linking shenanigans. Makes the executable much smaller and just a bit cleaner.

— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/keyman/issues/1#issuecomment-42723269 .

myleshorton commented 10 years ago

22K I believe.

oxtoacart commented 10 years ago

Unfortunately, this binary doesn't work for me on Windows XP SP3. Instead of complaining about MSVCP120.dll, it's complaining about MSVCP100.dll now.

screen shot 2014-05-09 at 7 55 02 pm

oxtoacart commented 10 years ago

Note - if you tested this on the same system where it was built, that system would have had the necessary DLL installed along with Visual Studio.

myleshorton commented 10 years ago

Right yeah that's definitely the issue - thanks for testing!! I'll fiddle some more!

On Friday, May 9, 2014, oxtoacart notifications@github.com wrote:

Note - if you tested this on the same system where it was built, that system would have had the necessary DLL installed along with Visual Studio.

— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/keyman/issues/1#issuecomment-42727260 .

myleshorton commented 10 years ago

Forgot XP actually requires v90. The exe's down to 11K now though -- wow saved 11K =).

oxtoacart commented 10 years ago

Sorry, still not working for me. Per this so entry, looks like it might be missing a DLL.

screen shot 2014-05-11 at 7 27 46 am

myleshorton commented 10 years ago

Ugh that's too bad. Very odd. I'll give 'er a look but if it's something complicated I'll just revert.

On Sunday, May 11, 2014, oxtoacart notifications@github.com wrote:

Sorry, still not working for me. Per this so entryhttp://stackoverflow.com/questions/2279518/last-runtime-9020-returned-by-windows-scheduler, looks like it might be missing a DLL.

[image: screen shot 2014-05-11 at 7 27 46 am]https://cloud.githubusercontent.com/assets/5000654/2938387/ae50c5f2-d907-11e3-9e94-24f5d0aecd48.png

— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/keyman/issues/1#issuecomment-42769280 .

Adam pgp A998 2B6E EF1C 373E 723F A813 045D A255 901A FD89

myleshorton commented 10 years ago

This is pretty interesting -- it's having trouble parsing the ASN in the cert because it apparently doesn't support base64 encoded pem files but only the binary ASN format. I just converted a flashlight-generated pem to a der using:

openssl asn1parse -inform PEM -in cacert.pem -out cacert.der

Then back in windows land you see the following:

certimporter-pem-der

@oxtoacart I feel like the easiest tweak might just be to write the certs as der files, but I haven't identified the best approach. It feel like this type of thing is actually perfect for the code review, though, so I'll keep looking at it. Let's schedule the in-person code-review for sometime this week if you can!

myleshorton commented 10 years ago

I forgot to mention the actual error for that code is an ASN.1 parsing error...basically it's trying to read a binary-encoded ASN.1 file and gets a base64 encoded file.

oxtoacart commented 10 years ago

@myleshorton How about we do the code review right after our checking tomorrow?

Concerning the encoding issue you encountered, keyman already sends DER to certimporter.

Also, what does this have to do with my not being able to run certimporter on Windows XP? That failure happens before my main method even runs.

myleshorton commented 10 years ago

Sounds good on the code review front.

On the certimporter front, it looks like we're just seeing different things. Which service pack are you running? What happens if you run certimporter.exe with no arguments? The executable definitely runs fine for me on two different XPs, one Home SP2 and the other Pro SP3.

oxtoacart commented 10 years ago

Here's what I'm running. I'm running on VirtualBox - wonder if that has something to do with it. I've been wanting to switch to VMWare anyway, so I'll try that.

Just to confirm - the systems on which you're running don't have Visual Studio or the Visual C++ Redistributable installed, right?

myleshorton commented 10 years ago

The Pro SP3 has VS 2008 and VS 2010 installed, so it's a bit unreliable, but the Home SP2 is a clean VM. The v90 platform toolset is definitely available on XP (see https://github.com/getlantern/WinProxy4J as one example), though, so it's really odd it wouldn't run at all.

myleshorton commented 10 years ago

Oh and what service pack are you running with?

oxtoacart commented 10 years ago

Sorry, forgot the screenshot :)

screen shot 2014-05-12 at 4 07 54 pm

myleshorton commented 10 years ago

Cool thanks. I have no idea what Professional K is, but it theoretically shouldn't matter.

myleshorton commented 10 years ago

Looks like it's some special version for Korea! Shouldn't matter though.

oxtoacart commented 10 years ago

I just grabbed what was available on MSDN.

BTW, when I try to open the updated solution in Visual Studio 2013, I get the below error and the solution ends up reverting to platform toolset v120. Does this mean that I need to install an older (paid(?)) version of Visual Studio instead of the free one that I'm using?

screen shot 2014-05-12 at 4 20 16 pm

myleshorton commented 10 years ago

You need to install an earlier version, yeah, but they're all on MSDN and all free (2008 doesn't even require a key). This is one of the main reasons a lot of people don't upgrade VS until they really need to -- a lot of stuff tends to break.

MSDN also has all the more standard XP versions, but again shouldn't really matter.

oxtoacart commented 10 years ago

And as you noted in a separate thread, the express version of 2008 is free for everyone.

oxtoacart commented 10 years ago

I'm happy to report that when I run on VMWare Fusion, I no longer get the error about a missing DLL! So, no more Windows XP testing on Virtual Box.

Cheers, Ox


"I love people who harness themselves, an ox to a heavy cart, who pull like water buffalo, with massive patience, who strain in the mud and the muck to move things forward, who do what has to be done, again and again."

On Mon, May 12, 2014 at 4:25 PM, myleshorton notifications@github.comwrote:

You need to install an earlier version, yeah, but they're all on MSDN and all free (2008 doesn't even require a key). This is one of the main reasons a lot of people don't upgrade VS until they really need to -- a lot of stuff tends to break.

MSDN also has all the more standard XP versions, but again shouldn't really matter.

— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/keyman/issues/1#issuecomment-42890463 .

myleshorton commented 10 years ago

Oh sweet!! Makes me wish I had a bare metal XP machine kicking around to test with too, but theoretically I think this should just work.

This does bring up an interesting point though - how hard would it be to add loggly support to Flashlight?

On Monday, May 12, 2014, oxtoacart notifications@github.com wrote:

I'm happy to report that when I run on VMWare Fusion, I no longer get the error about a missing DLL! So, no more Windows XP testing on Virtual Box.

Cheers, Ox


"I love people who harness themselves, an ox to a heavy cart, who pull like water buffalo, with massive patience, who strain in the mud and the muck to move things forward, who do what has to be done, again and again."

  • Marge Piercy

On Mon, May 12, 2014 at 4:25 PM, myleshorton notifications@github.com<javascript:_e(%7B%7D,'cvml','notifications@github.com');>wrote:

You need to install an earlier version, yeah, but they're all on MSDN and all free (2008 doesn't even require a key). This is one of the main reasons a lot of people don't upgrade VS until they really need to -- a lot of stuff tends to break.

MSDN also has all the more standard XP versions, but again shouldn't really matter.

— Reply to this email directly or view it on GitHub< https://github.com/getlantern/keyman/issues/1#issuecomment-42890463> .

— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/keyman/issues/1#issuecomment-42893156 .

oxtoacart commented 10 years ago

Well, flashlight doesn't use a logging framework, it just writes to stdout. Since flashlight is running as a child, we could capture the stdout output and send it to Loggly.

Cheers, Ox


"I love people who harness themselves, an ox to a heavy cart, who pull like water buffalo, with massive patience, who strain in the mud and the muck to move things forward, who do what has to be done, again and again."

On Mon, May 12, 2014 at 5:35 PM, myleshorton notifications@github.comwrote:

Oh sweet!! Makes me wish I had a bare metal XP machine kicking around to test with too, but theoretically I think this should just work.

This does bring up an interesting point though - how hard would it be to add loggly support to Flashlight?

On Monday, May 12, 2014, oxtoacart notifications@github.com wrote:

I'm happy to report that when I run on VMWare Fusion, I no longer get the error about a missing DLL! So, no more Windows XP testing on Virtual Box.

Cheers, Ox


"I love people who harness themselves, an ox to a heavy cart, who pull like water buffalo, with massive patience, who strain in the mud and the muck to move things forward, who do what has to be done, again and again."

  • Marge Piercy

On Mon, May 12, 2014 at 4:25 PM, myleshorton <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');>wrote:

You need to install an earlier version, yeah, but they're all on MSDN and all free (2008 doesn't even require a key). This is one of the main reasons a lot of people don't upgrade VS until they really need to -- a lot of stuff tends to break.

MSDN also has all the more standard XP versions, but again shouldn't really matter.

— Reply to this email directly or view it on GitHub< https://github.com/getlantern/keyman/issues/1#issuecomment-42890463> .

— Reply to this email directly or view it on GitHub< https://github.com/getlantern/keyman/issues/1#issuecomment-42893156> .

— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/keyman/issues/1#issuecomment-42897216 .

oxtoacart commented 10 years ago

This is the general area where that would be done - https://github.com/getlantern/lantern/blob/flashlight/src/main/java/org/lantern/proxy/pt/BasePluggableTransport.java#L220

Cheers, Ox


"I love people who harness themselves, an ox to a heavy cart, who pull like water buffalo, with massive patience, who strain in the mud and the muck to move things forward, who do what has to be done, again and again."

On Mon, May 12, 2014 at 5:54 PM, Ox Cart ox@getlantern.org wrote:

Well, flashlight doesn't use a logging framework, it just writes to stdout. Since flashlight is running as a child, we could capture the stdout output and send it to Loggly.

Cheers, Ox


"I love people who harness themselves, an ox to a heavy cart, who pull like water buffalo, with massive patience, who strain in the mud and the muck to move things forward, who do what has to be done, again and again."

  • Marge Piercy

On Mon, May 12, 2014 at 5:35 PM, myleshorton notifications@github.comwrote:

Oh sweet!! Makes me wish I had a bare metal XP machine kicking around to test with too, but theoretically I think this should just work.

This does bring up an interesting point though - how hard would it be to add loggly support to Flashlight?

On Monday, May 12, 2014, oxtoacart notifications@github.com wrote:

I'm happy to report that when I run on VMWare Fusion, I no longer get the error about a missing DLL! So, no more Windows XP testing on Virtual Box.

Cheers, Ox


"I love people who harness themselves, an ox to a heavy cart, who pull like water buffalo, with massive patience, who strain in the mud and the muck to move things forward, who do what has to be done, again and again."

  • Marge Piercy

On Mon, May 12, 2014 at 4:25 PM, myleshorton <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');>wrote:

You need to install an earlier version, yeah, but they're all on MSDN and all free (2008 doesn't even require a key). This is one of the main reasons a lot of people don't upgrade VS until they really need to -- a lot of stuff tends to break.

MSDN also has all the more standard XP versions, but again shouldn't really matter.

— Reply to this email directly or view it on GitHub< https://github.com/getlantern/keyman/issues/1#issuecomment-42890463> .

— Reply to this email directly or view it on GitHub< https://github.com/getlantern/keyman/issues/1#issuecomment-42893156> .

— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/keyman/issues/1#issuecomment-42897216 .

myleshorton commented 10 years ago

Interesting. I guess we could define a simple format and scan for errors on the java side? Or we could add support for something similar internally as a separate go project in theory.

On Monday, May 12, 2014, oxtoacart notifications@github.com wrote:

Well, flashlight doesn't use a logging framework, it just writes to stdout. Since flashlight is running as a child, we could capture the stdout output and send it to Loggly.

Cheers, Ox


"I love people who harness themselves, an ox to a heavy cart, who pull like water buffalo, with massive patience, who strain in the mud and the muck to move things forward, who do what has to be done, again and again."

  • Marge Piercy

On Mon, May 12, 2014 at 5:35 PM, myleshorton notifications@github.com<javascript:_e(%7B%7D,'cvml','notifications@github.com');>wrote:

Oh sweet!! Makes me wish I had a bare metal XP machine kicking around to test with too, but theoretically I think this should just work.

This does bring up an interesting point though - how hard would it be to add loggly support to Flashlight?

On Monday, May 12, 2014, oxtoacart notifications@github.com<javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

I'm happy to report that when I run on VMWare Fusion, I no longer get the error about a missing DLL! So, no more Windows XP testing on Virtual Box.

Cheers, Ox


"I love people who harness themselves, an ox to a heavy cart, who pull like water buffalo, with massive patience, who strain in the mud and the muck to move things forward, who do what has to be done, again and again."

  • Marge Piercy

On Mon, May 12, 2014 at 4:25 PM, myleshorton notifications@github.com<javascript:_e(%7B%7D,'cvml','notifications@github.com'); javascript:_e(%7B%7D,'cvml','notifications@github.com<javascript:_e(%7B%7D,'cvml','notifications@github.com');');>>wrote:

You need to install an earlier version, yeah, but they're all on MSDN and all free (2008 doesn't even require a key). This is one of the main reasons a lot of people don't upgrade VS until they really need to -- a lot of stuff tends to break.

MSDN also has all the more standard XP versions, but again shouldn't really matter.

— Reply to this email directly or view it on GitHub< https://github.com/getlantern/keyman/issues/1#issuecomment-42890463> .

— Reply to this email directly or view it on GitHub< https://github.com/getlantern/keyman/issues/1#issuecomment-42893156> .

— Reply to this email directly or view it on GitHub< https://github.com/getlantern/keyman/issues/1#issuecomment-42897216> .

— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/keyman/issues/1#issuecomment-42898815 .

oxtoacart commented 10 years ago

Even easier, I can fairly quickly modify flashlight to only log errors to stderr and log everything else to stdout. Then we can just send stderr to loggly.

As a side note, none of the libraries that flashlight uses do logging. This is a Go convention - libraries return errors, only programs log.

Cheers, Ox


"I love people who harness themselves, an ox to a heavy cart, who pull like water buffalo, with massive patience, who strain in the mud and the muck to move things forward, who do what has to be done, again and again."

On Mon, May 12, 2014 at 6:19 PM, myleshorton notifications@github.comwrote:

Interesting. I guess we could define a simple format and scan for errors on the java side? Or we could add support for something similar internally as a separate go project in theory.

On Monday, May 12, 2014, oxtoacart notifications@github.com wrote:

Well, flashlight doesn't use a logging framework, it just writes to stdout. Since flashlight is running as a child, we could capture the stdout output and send it to Loggly.

Cheers, Ox


"I love people who harness themselves, an ox to a heavy cart, who pull like water buffalo, with massive patience, who strain in the mud and the muck to move things forward, who do what has to be done, again and again."

  • Marge Piercy

On Mon, May 12, 2014 at 5:35 PM, myleshorton <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');>wrote:

Oh sweet!! Makes me wish I had a bare metal XP machine kicking around to test with too, but theoretically I think this should just work.

This does bring up an interesting point though - how hard would it be to add loggly support to Flashlight?

On Monday, May 12, 2014, oxtoacart <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

I'm happy to report that when I run on VMWare Fusion, I no longer get the error about a missing DLL! So, no more Windows XP testing on Virtual Box.

Cheers, Ox


"I love people who harness themselves, an ox to a heavy cart, who pull like water buffalo, with massive patience, who strain in the mud and the muck to move things forward, who do what has to be done, again and again."

  • Marge Piercy

On Mon, May 12, 2014 at 4:25 PM, myleshorton < notifications@github.com<javascript:_e(%7B%7D,'cvml',' notifications@github.com');> <javascript:_e(%7B%7D,'cvml','notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');');>>wrote:

You need to install an earlier version, yeah, but they're all on MSDN and all free (2008 doesn't even require a key). This is one of the main reasons a lot of people don't upgrade VS until they really need to -- a lot of stuff tends to break.

MSDN also has all the more standard XP versions, but again shouldn't really matter.

— Reply to this email directly or view it on GitHub< https://github.com/getlantern/keyman/issues/1#issuecomment-42890463>

.

— Reply to this email directly or view it on GitHub< https://github.com/getlantern/keyman/issues/1#issuecomment-42893156> .

— Reply to this email directly or view it on GitHub< https://github.com/getlantern/keyman/issues/1#issuecomment-42897216> .

— Reply to this email directly or view it on GitHub< https://github.com/getlantern/keyman/issues/1#issuecomment-42898815> .

— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/keyman/issues/1#issuecomment-42900666 .

myleshorton commented 10 years ago

Sweet! I like it.

On Mon, May 12, 2014 at 4:53 PM, oxtoacart notifications@github.com wrote:

Even easier, I can fairly quickly modify flashlight to only log errors to stderr and log everything else to stdout. Then we can just send stderr to loggly.

As a side note, none of the libraries that flashlight uses do logging. This is a Go convention - libraries return errors, only programs log.

Cheers, Ox


"I love people who harness themselves, an ox to a heavy cart, who pull like water buffalo, with massive patience, who strain in the mud and the muck to move things forward, who do what has to be done, again and again."

  • Marge Piercy

On Mon, May 12, 2014 at 6:19 PM, myleshorton notifications@github.comwrote:

Interesting. I guess we could define a simple format and scan for errors on the java side? Or we could add support for something similar internally as a separate go project in theory.

On Monday, May 12, 2014, oxtoacart notifications@github.com wrote:

Well, flashlight doesn't use a logging framework, it just writes to stdout. Since flashlight is running as a child, we could capture the stdout output and send it to Loggly.

Cheers, Ox


"I love people who harness themselves, an ox to a heavy cart, who pull like water buffalo, with massive patience, who strain in the mud and the muck to move things forward, who do what has to be done, again and again."

  • Marge Piercy

On Mon, May 12, 2014 at 5:35 PM, myleshorton <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');>wrote:

Oh sweet!! Makes me wish I had a bare metal XP machine kicking around to test with too, but theoretically I think this should just work.

This does bring up an interesting point though - how hard would it be to add loggly support to Flashlight?

On Monday, May 12, 2014, oxtoacart <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

I'm happy to report that when I run on VMWare Fusion, I no longer get the error about a missing DLL! So, no more Windows XP testing on Virtual Box.

Cheers, Ox


"I love people who harness themselves, an ox to a heavy cart, who pull like water buffalo, with massive patience, who strain in the mud and the muck to move things forward, who do what has to be done, again and again."

  • Marge Piercy

On Mon, May 12, 2014 at 4:25 PM, myleshorton < notifications@github.com<javascript:_e(%7B%7D,'cvml',' notifications@github.com');> <javascript:_e(%7B%7D,'cvml','notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');');>>wrote:

You need to install an earlier version, yeah, but they're all on MSDN and all free (2008 doesn't even require a key). This is one of the main reasons a lot of people don't upgrade VS until they really need to -- a lot of stuff tends to break.

MSDN also has all the more standard XP versions, but again shouldn't really matter.

— Reply to this email directly or view it on GitHub<

https://github.com/getlantern/keyman/issues/1#issuecomment-42890463>

.

— Reply to this email directly or view it on GitHub< https://github.com/getlantern/keyman/issues/1#issuecomment-42893156>

.

— Reply to this email directly or view it on GitHub< https://github.com/getlantern/keyman/issues/1#issuecomment-42897216> .

— Reply to this email directly or view it on GitHub< https://github.com/getlantern/keyman/issues/1#issuecomment-42898815> .

— Reply to this email directly or view it on GitHub< https://github.com/getlantern/keyman/issues/1#issuecomment-42900666> .

— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/keyman/issues/1#issuecomment-42902867 .

oxtoacart commented 10 years ago

Logging enhancement logged.