Bug 692615

Summary: Allow customers to specify a serial number
Product: Ghostscript Reporter: Ken Sharp <ken.sharp>
Component: Client APIAssignee: Ray Johnston <ray.johnston>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: P4    
Version: master   
Hardware: All   
OS: All   
Customer: Word Size: ---

Description Ken Sharp 2011-10-18 16:24:03 UTC
Various font foundries use the rip serial number to secure installed fonts. Currently Ghostscript has the serial number hard-coded at build time, which is obviously inconvenient as each installation would require a custom build with a different hard-coded serial number.

Proposed; implement a gp_serialnumber method in the API and have zserialnumber call it. This allows the possibility for custom serial numbers using a Digital Rights Mechanism of choice, which many customers will already have.
Comment 1 Ray Johnston 2011-10-28 05:34:48 UTC
I had thought this was requested by a customer, but no customer ID is in
the bug. Ken, please notify the original submitter.

As of commit 7b2b1f7 I have added a gp_serialnumber as a platform specific
function. The default for most platforms returns the same "magic" serial
number as defined with GS_SERIALNUMBER as a C #define or the default "42"
(see base.gscdefs.c)

The Windows implementation returns a 32-bit value derived from the Registry
key "HKEY_LOCAL_MACHINE\Software\Microsoft\MSLicensing\HardwareID\ClientHWID".
The algorithm used to derive the serialnumber value is secret (just kidding,
see the source -- really just arbitrary). I am NOT at all sure that this is
unique across Windows systems, or even supported. If there are any errors
from the registry query, we just return the GS_SERIALNUMBER (42).

Other ways of implementing this would be to write a key in the registry or
in a file that would be used for the DRM.

If anyone wants to tackle getting something working for Mac OS/X or linux or
other systems, please feel free. We'd welcome the contribution.
Comment 2 Ken Sharp 2011-10-28 07:25:49 UTC
(In reply to comment #1)

> I had thought this was requested by a customer, but no customer ID is in
> the bug. Ken, please notify the original submitter.

The customer only requested information, but we thought it was useful enough to add more generally so I didn't put a customer ID. The customer was #661 and I've sent them an email to let them know.