News for hackers. Stuff that matters.
Re:D-Link publishes code-signing private keys by mistake by mindslight on Thursday September 17, 2015 @04:24PM (#10235840)
> the GPLv2 does not require that the modified code must be able to be installed back on the original hardware by the person doing the modification

Does not explicitly. From GPL2:

> Accompany it [executable code] with the complete corresponding machine-readable source code ... The source code for a work means the preferred form of the work for making modifications to it

So, you're telling me that the preferred form for making modifications to the source code of a router does not include the scripts which install onto the router to test those modifications?

> Not by any legal definition of "bad faith"

The GPL2 and the FSF are very explicit on what the GPL2 is supposed to engender. Accepting the license and trying to circumvent it on a possible technicality (assertion that a signed blob isn't a derivative work, when the only reason anyone is interested in the source code is to run it) looks pretty bad-faith to me.

IANAMOAG (I am not a member of a guild, and you probably aren't either). Even if we were, we could still disagree until it was actually litigated. I see no reason to prematurely capitulate Linux devices being non-Free.

Re:D-Link publishes code-signing private keys by mistake by DannyBee on Thursday September 17, 2015 @05:07PM (#10236077)
"So, you're telling me that the preferred form for making modifications to the source code of a router does not include the scripts which install onto the router to test those modifications? "

Yes. 100% yes. It is very explicit in what must be included and you are explicitly ignoring what it says about scripts:

" For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. "

Scripts used to control compilation and installation != signing keys. It means scripts used to control compilation and installation.

You may want it to include something more, but it doesn't. That's why GPLv3 was written.

Re:D-Link publishes code-signing private keys by mistake by thaumasiotes on Thursday September 17, 2015 @10:37PM (#10237242)
I have to imagine that the scripts controlling installation must sign the executable. (Assumption: unsigned executables can't be installed.) They can only do that by incorporating the signing keys. They might incorporate the keys by including the keys literally within the script proper, or by reading a file that contains them, but why are those situations different? Suppose the installation script defined a lisp interpreter and then read a data file which, when interpreted by the lisp interpreter defined in the script, installs the executable. Why isn't that data file also part of "the scripts used to control installation of the executable"?
Re:D-Link publishes code-signing private keys by mistake by DannyBee on Monday September 21, 2015 @02:18PM (#10254121)
"I have to imagine that the scripts controlling installation must sign the executable. "

This is a pretty big assumption, and in fact, is not actually true in a lot of cases :)

Let's assume it is here.

"Why isn't that data file also part of "the scripts used to control installation of the executable"?"

Because the data file literally isn't a script used to control installation of the executable? It's a data file.

At best, btw, you'll be able to argue that it would have to include the signing key, but not any password for it. So you are still pretty screwed :)

Your argument also swallows the definition. Where does it end? Do i have to include the interpreter for the script, and provide source? Why not, since it's required for the script to function. (Note, this would not be covered by the next exception in a lot of cases)

If i give you a bash script The installation script also almost certainly refers to the executable, but that's called out explicitly as something i have to give you source to. Why bother if it's included in the "scripts to control compilation/installation" part? (In general, courts are going to read definitions into things that make parts of enumerated lists differentiable from each other ) In general, i would say you can go down this path, but you won't get a court to come with you.

Scripts means scripts. Data files means data files.

If the key is literally part of the script, yes, you'd have to ship that. Not the password, mind you.

If they wanted something else, they should have written something else. Which they did, in gplv3 ;)

Re:D-Link publishes code-signing private keys by mistake by AnthonyMouse on Thursday September 17, 2015 @06:15PM (#10236404)
> Scripts used to control compilation and installation != signing keys.

You're referring to "scripts used to control compilation", but how are signing keys not part of the source code? GPLv2 uses a specific definition of source code, "the preferred form of the work for making modifications to it." Don't you have to be arguing that a form not allowing modifications to be used or tested is the "preferred form of the work for making modifications"?

Re:D-Link publishes code-signing private keys by mistake by DannyBee on Monday September 21, 2015 @02:11PM (#10254084)
"" Don't you have to be arguing that a form not allowing modifications to be used or tested is the "preferred form of the work for making modifications"?"

You are trying to take parts out and remove context from them.

I don't have to argue at all about the preferred form, because it very explicitly says what that is: "The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable."

The first two sentences go together. It defines, explicitly, what the preferred form of complete source code for an executable work includes.

So that isn't going to include signing keys unless you want to argue that one of the explicitly enumerated parts includes signing keys.

For years, people have argued back and forth about whether the scripts include data files. The general consensus is "no", because otherwise, it has no differentiable meaning from the other parts.

Re:D-Link publishes code-signing private keys by mistake by MaulingMonkey on Friday September 18, 2015 @12:51AM (#10237521)
Do you check your private GitHub keys into VCS? Your wide definition of "scripts used to control compliation" would seem to include them! My preferred form of making modifications to my software includes uploading them to my GitHub account for code reviews among other things.

I use my GitHub private keys way more often than final code signing keys - be those keys used for as "nefarious" a use as tivoization lock-in, or as benign a use as proving authorship so Windows can tell my executables apart from some asshole's malware better.

During standard development I'm either using temporary, machine-local certificates, or using unsigned code. If that means I need a devkit, or an emulator, or a dongle, or whatever else might be required to iterate that doesn't require the final "publishing" steps, in a well designed system it shouldn't require final publishing certs. Because for security's sake, you'd consider going to such lengths as keeping those code signing certs on a tightly controlled, air gapped machine, to reduce the chance of getting pwned and dealing with cert invalidation. Or worse.

Which makes it a very far cry from being part of your compilation phase in any capacity, nevermind a script used to control it.

Re:D-Link publishes code-signing private keys by mistake by AnthonyMouse on Friday September 18, 2015 @01:22AM (#10237600)
You haven't read what I wrote.

But the "preferred form of the work for making modifications" presumably involves each person using their own github keys (and/or repositories) etc. Anybody can create an account and use github. That is not true in the tivoization case because in that case the only keys that can be used are the original ones.

Re:D-Link publishes code-signing private keys by mistake by MaulingMonkey on Friday September 18, 2015 @03:31AM (#10237922)
> You haven't read what I wrote.

Are you sure? Based on what? I've managed to quote you without the use of copy and paste in that previous post - I'm not sure how I accomplished that if I didn't read what you wrote - so please be more specific.

This also begs the question: Did you read what I wrote?

> But the "preferred form of the work for making modifications" presumably involves each person using their own github keys (and/or repositories) etc.

And the "preferred form of the work for making modifications" also presumably involves each person using their own signing keys (and/or hardware that may not require them) etc.

> Anybody can create an account and use github.

Anyone can buy their own hardware, and compile for it, and install on it. Just don't pick tivoized hardware.

> That is not true in the tivoization case because in that case the only keys that can be used are the original ones.

The source code is not tivoized - hardware is. So don't pick tivoized hardware.

Re:D-Link publishes code-signing private keys by mistake by AnthonyMouse on Friday September 18, 2015 @08:56AM (#10238877)
> Are you sure? Based on what? I've managed to quote you without the use of copy and paste in that previous post - I'm not sure how I accomplished that if I didn't read what you wrote - so please be more specific.

You're still talking about "scripts used to control compliation" when my point was that it doesn't need to be that if it falls under the definition of source code proper.

> And the "preferred form of the work for making modifications" also presumably involves each person using their own signing keys (and/or hardware that may not require them) etc.

Which works perfectly well up to exactly the point where the person distributing the software delivers it on hardware that does require signing keys and doesn't allow the user/owner to use their own keys. Then they need yours because you prevented them from using their own.

> The source code is not tivoized - hardware is. So don't pick tivoized hardware.

The hardware is being chosen by the person distributing it with GPL software.

Re:D-Link publishes code-signing private keys by mistake by MaulingMonkey on Saturday September 19, 2015 @02:43AM (#10243524)
> You're still talking about "scripts used to control compliation" when my point was that it doesn't need to be that if it falls under the definition of source code proper.

Ahh. Expanding the definition of source code enough to include code signing keys would have also put them into the (sub)category of "scripts used to control compilation and installation" in my mind, making the distinction moot.

It's not moot in the context of the specific point you intended, of course, and which you've now provided, which I thank you for.

> Which works perfectly well up to exactly the point where the person distributing the software delivers it on hardware that does require signing keys and doesn't allow the user/owner to use their own keys.

Which works perfectly well up to exactly the point where the person distributing the software delivers it on hardware (my VCS server) that does require VCS keys and doesn't allow the user/owner to use their own keys.

> The hardware is being chosen by the person distributing it with GPL software.

...and by the person purchasing the product that has the GPL software in it, by choosing to buy that product.

Re:D-Link publishes code-signing private keys by mistake by AnthonyMouse on Saturday September 19, 2015 @03:28PM (#10245294)
> Which works perfectly well up to exactly the point where the person distributing the software delivers it on hardware (my VCS server) that does require VCS keys and doesn't allow the user/owner to use their own keys.

You distribute your software by conveying the VCS server hardware to the customer?

> ...and by the person purchasing the product that has the GPL software in it, by choosing to buy that product.

All GPL licensees have the rights the license grants them, not just the ones who buy or don't buy specific hardware. What good is the license at all if distributors can just say "I'm not doing that part, if you don't like it buy from somebody else"? And what if they all do that, or nobody else makes equivalent hardware?

Re:D-Link publishes code-signing private keys by mistake by tptacek on Friday September 18, 2015 @08:11AM (#10238686)
In actual fact, on many (perhaps most) platforms for which code must be signed, the developers on those platforms don't have to bother with code signing to develop and test their own code; it's stubbed out in the development environment.

So even a reaching definition of "preferred form for modifications" doesn't hit signing keys, just like "preferred form" of a Rails app doesn't include your EC2 credentials.

Re:D-Link publishes code-signing private keys by mistake by mindslight on Friday September 18, 2015 @03:37PM (#10241569)
"modification" applies specifically to the code as is installed and shipped.

Picture the scenario at the manufacturer where one developer is being tasked with creating a new feature using a consumer unit fresh off the line, for a business demo. What resources do they utilize in the course of doing this? This is the company's "preferred form" of the source tree for modifying an as-shipped device, and is what needs to be made public.

The company could supply a firmware update to overwrite the bootloader and stub out signature checking, if that is what makes sense. Or a well-specified description to use JTAG to do the same. Or perhaps they don't actually care about security and 'make dist' creates an installable image.

The thing is, all of these arguments ("preferred form for modification", the key being part of the installation script, code+signature being the executable work) seem like uphill battles when trying to show the manufacturer is violating them in an informal forum like HN.

But the intent and spirit of the license is straightforward and even spelled out in the preamble! "Our General Public Licenses are designed to make sure ... you can change the software". Fulling these goals is the entire point of the contract and only consideration for receiving a license. So the manufacturer is actually the party that must work to show how what they're releasing actually fulfills the specific terms.

Re:D-Link publishes code-signing private keys by mistake by AnthonyMouse on Friday September 18, 2015 @08:46AM (#10238819)
> In actual fact, on many (perhaps most) platforms for which code must be signed, the developers on those platforms don't have to bother with code signing to develop and test their own code; it's stubbed out in the development environment.

What is the relevance of that supposed to be? You can put any part of the development process on any number of different computers or distribute the work between different developers however you like. And the relevant "preferred form for modifications" is presumably the form the user uses to make modifications to the device delivered to the user in any event.

> So even a reaching definition of "preferred form for modifications" doesn't hit signing keys, just like "preferred form" of a Rails app doesn't include your EC2 credentials.

Why wouldn't it include your EC2 credentials (or other root access to the instance) if conveying an EC2 instance to the customer is how the customer receives the software from you? But now you're wading into the SaaS vs. software distribution ambiguity which has nothing to do with the case where you've bought a physical device with the software on it.

Re:D-Link publishes code-signing private keys by mistake by dtparr on Thursday September 17, 2015 @04:55PM (#10236000)
I'm not sure how this is premature. The reason the practice is called tivoization is because we went through all this years ago when Tivo did it. The FSF acknowledges that releasing the source but locking you out from installing your self-built version of it does comply with the GPL2, which is why there's a GPL3.

See https://www.gnu.org/licenses/gpl-faq.html#Tivoization

Re:D-Link publishes code-signing private keys by mistake by mindslight on Thursday September 17, 2015 @05:17PM (#10236134)
IMHO, poor wording in a FAQ by the FSF. The company considers themselves complying with the GPL2 by releasing a scrubbed tree. The FSF looks the other way, having limited resources.

I'm having a hard time digging it up, but I swore I have seen a video where RMS lays out the exact same theory I'm saying here.

It's not a terribly outlandish theory. I'm just getting a lot of flak for bucking the status quo from people who grew up with DRM kool aid and see Free software in terms of the corporations that lock it down.

Re:D-Link publishes code-signing private keys by mistake by dtparr on Thursday September 17, 2015 @05:56PM (#10236321)
So, I don't think people have 'drunk the DRM kool aid' so much as everyone has generally agreed for the last decade or so that GPLv2 doesn't prevent tivoization and GPLv3 does.

That everyone includes RMS, by the way. Here's a transcript[0] from 2006 where he's talking about it and says:

>For instance, the Tivo itself is the prototype of tivoisation. The Tivo contains a small GNU/Linux operating system, thus, several programs under the GNU GPL. And, as far as I know, the Tivo company does obey GPL version 2. They provide the users with source code and the users can then modify it and compile it and then install it in the Tivo. That's where the trouble begins because the Tivo will not run modified versions, the Tivo contains hardware designed to detect that the software has been changed and shuts down. So, regardless of the details of your modification, your modified version will not run in your Tivo.

So while you may be correct that it's never been litigated, it would seem that if the strongest software freedom advocates like RMS and the FSF thought that it did violate GPLv2, surely rather than telling people they should upgrade to V3 because it blocks tivoization [1], they would have just litigated against tivo and set the precedent.

[0] http://fsfe.org/campaigns/gplv3/tokyo-rms-transcript#tivoisa...

[1] https://www.gnu.org/licenses/rms-why-gplv3.html

Re:D-Link publishes code-signing private keys by mistake by mindslight on Thursday September 17, 2015 @07:24PM (#10236680)
I'm not one to change my mind just because "everybody" believes something.

RMS was likely wrong about at least one thing in that clip - I would think signature checking, especially an early incarnation of it, would be done by the bootloader (ie software/firmware) rather than a specific piece of hardware.

This could be minor (thinking of embedded firmware as hardware isn't wrong in the freedom sense), or that framework could have misguided his thinking. He didn't use a specific term for the compiled source code, only "it". The GPL2 speaks in terms of "executable", but an unsigned or missigned binary is not actually executable. The "executable" would consist of the machine code and header, which would necessarily include a correct signature to be "executable".

Re:D-Link publishes code-signing private keys by mistake by Robin_Message on Friday September 18, 2015 @02:28AM (#10237762)
It is executable - just not on the device it was supplied with. But you could quite legitimately run it on some other device or an emulator.

For comparison, say you had some GPL software which checked in with a dongle or license server, and refused to run if there was no license/dongle. Then you'd be within your rights to edit it to remove the license check.

But here, the device itself refuses to load the program because it isn't blessed. Consider another implementation: in the factory, the hash of the GPL firmware is burnt into a ROM, and the bootloader checks that before running the code. Clearly you can build a modified executable, and you still can't run it on the device. But crucially, there is no header that you're missing; the device just can't run that exe. Or suppose the modified executable is too big to fit in memory - are they obliged to come upgrade the device? The point is, the license covers the software, not the loading of that software.

IANAL, while this may appear against the spirit of the license, it's hard to see how the license prohibits it. The existence of GPLv3 implies the FSF thinks so too.

To put it bluntly: an ought does not imply an is.

Re:D-Link publishes code-signing private keys by mistake by mindslight on Friday September 18, 2015 @02:06PM (#10240960)
The license itself doesn't explicitly "prohibit" your roundabout contraption that's been designed solely to defeat the license. But this is exactly the type of sham that courts tends to see through.

Please find me any real-world device that actually has a symmetric checksum burnt into OTP or mask _ROM_ while the code itself resides in flash.

Re:D-Link publishes code-signing private keys by mistake by uxp on Thursday September 17, 2015 @04:49PM (#10235975)
> So, you're telling me that the preferred form for making modifications to the source code of a router does not include the scripts which install onto the router to test those modifications?

No. Not really. GPLv2 requires that the modifier of source code release the tools to build/compile that source code into an executable. Whether or not the source code can be run directly (ex. Ruby, Python) or requires a compile/assemble/link process (ex. C, Java) is irrelevant. The GPLv2 also does not entitle or give anyone rights to any method to execute that recontributed and rebuilt code, for example if the code was ported to a proprietary hardware or some closed sourced ISA. However, IANAL and could very well be wrong because the GPL is such an unwieldy beast of unknowns.

Re:D-Link publishes code-signing private keys by mistake by eli on Thursday September 17, 2015 @04:44PM (#10235937)
> So, you're telling me that the preferred form for making modifications to the source code of a router does not include the scripts which install onto the router to test those modifications?

In short: yes.

Being able to access and modify and redistribute source code isn't the same as having the ability to deploy it to a particular piece of hardware.

Likewise, if I open source a .NET project that doesn't mean it has to include Visual Studio even though VS is the preferred way to build it.

Re:D-Link publishes code-signing private keys by mistake by mindslight on Thursday September 17, 2015 @05:06PM (#10236070)
> Being able to access and modify and redistribute source code isn't the same as having the ability to deploy it to a particular piece of hardware

But the preferred form for modification includes being able to test your changes. Source without installation scripts is most likely not the preferred form - ie what do engineers at the company use?

> if I open source a .NET project that doesn't mean it has to include Visual Studio, which is the preferred way to build it

Yes, because having been designed in the era of expensive compilers, GPL2 explicitly covers this:

> However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable

Re:D-Link publishes code-signing private keys by mistake by mynameisvlad on Thursday September 17, 2015 @05:19PM (#10236150)
Visual Studio is not a "major [component] ... of the operating system on which the executable runs". It's not any component, in fact; it's a completely separate application from the OS, and in no way bundled together.
Re:D-Link publishes code-signing private keys by mistake by AnthonyMouse on Thursday September 17, 2015 @06:41PM (#10236531)
You're arguing that a compiler is not a major operating system component when the license explicitly enumerates it as a major operating system component. Nobody says you have to get all your operating system components from the same disc.
Re:D-Link publishes code-signing private keys by mistake by mynameisvlad on Thursday September 17, 2015 @08:27PM (#10236897)
The compiler is part of VS though, not part of the Windows. You don't get VS if you have Windows, and you don't get Windows if you have VS. They're completely separate products. So if it isn't actually included with the OS, and you need to acquire (either through a free or paid license) a completely different product to get it, then I don't see how it could be considered a major component of the OS, regardless of what the license text says. It's not a matter of it being on another disk, it's a matter of it being a completely different product in the Microsoft world.
Re:D-Link publishes code-signing private keys by mistake by AnthonyMouse on Friday September 18, 2015 @01:01AM (#10237543)
It doesn't say anything about products. It doesn't say that major components can't be optional components. It does say that a compiler is a major component of the operating system.

You're trying to draw a box around "Windows" and define operating system as everything in that box. But minesweeper is not an operating system component, it's just something that comes with Windows. A hypervisor is an operating system component, even though not all versions of Windows have one.

So is a compiler.

I imagine there exist developer-oriented PC OEMs that offer PCs with Windows and Visual Studio already installed. So then it is included with the OS by the OEM. The fact that that would change the outcome in your interpretation implies that there is something wrong with it.

Re:D-Link publishes code-signing private keys by mistake by ccrush on Friday September 18, 2015 @09:07AM (#10238933)
The Windows SDK comes with the c++ and c# compilers, all headers and libraries needed to build windows software. It doesn't come with the fancy text editor or tools in Visual Studio, but it definitely comes with the compilers you need.
Re:D-Link publishes code-signing private keys by mistake by dfox on Thursday September 17, 2015 @08:01PM (#10236811)
IIRC FSF's position on this is that the original author has to include inlude explicit GPL exemption for things like MFC, VCL or even OpenSSL, if the program depends on them, in order for anyone to be legally able to distribute binaries. I would assume that something similar comes into play when building the program requires proprietary compiler that is not "component of the operating system" (although in that case it might very well be implied).

That in practice nobody except FSF and Debian cares is another thing.

Re:D-Link publishes code-signing private keys by mistake by devit on Thursday September 17, 2015 @05:06PM (#10236064)
If you consider signed blobs derivative works (which means hashing and producing a signature creates a derivative work), then any signed statement referring to an hash of the source code (or including the source itself) is also a derivative work.

This means that someone sending a PGP signed e-mail saying "I audited that the source code of GNU Foo with hash 0xdeadbeef... is free of backdoors" is violating GNU Foo's copyrights unless he releases his private keys.

This is obviously a very undesirable outcome, and so it's resonable to hope that hashing does not create derivative works, and thus signing doesn't either.

Including the scripts to install in the "preferred form" also seems very problematic because then you might also be forced to include a full copy of the hard drive of your development machine since that's an even more "preferred form" under that theory.

This is also a very undesirable outcome, so it's again reasonable to hope that "preferred form" does not necessarily include things that were absent in the original work and that aren't essential for reproducing the binary derived work itself.

Re:D-Link publishes code-signing private keys by mistake by mindslight on Thursday September 17, 2015 @05:13PM (#10236114)
It's not the hashing of the object code that makes the signature a derivative work. It's the appending the signature and object code that creates one whole work.
Re:D-Link publishes code-signing private keys by mistake by tzs on Thursday September 17, 2015 @05:06PM (#10236068)
Yet in GPLv3, where they could have explicitly made it so that the modified code must be able to be installed back on the original hardware, they declined to do so in the general case. The anti-tivoization clause instead was written narrowly to only apply when the object code was conveyed "as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized)".

Note that this means that I could sell a device that only runs signed code and could separately sell signed apps for that device that the user can buy and install later, and as long as the code that ships with the device is not GPLv3, I could use GPLv3 code in the signed apps and would NOT be required to release signing keys under GPLv3.

(The Apple App store incompatibility with GPLv3 has nothing to do with the app signing requirements. It is due to the terms of service that users are required to agree to in order to access the store. These impose what the GPL considers to be additional, incompatible conditions).

It seems odd, if they felt the way you think they do, that they would have written this so narrowly.