JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc
General

License Key Installation: Floating License Key

This section explains how to manage floating CodeSonar license keys.

Note that most CodeSonar license keys are not floating. If you do not have a floating license key, see Hub Setup: Hub License Key for information on setting up a license key.



Start Here

Do you already have a CodeSonar license key?

Before You Obtain A License Key

  1. Make sure CodeSonar is installed. If not, install it now.
  2. Decide where you want to run the CodeSonar hub. The Setting Up The Hub section describes the factors that may affect this decision. We will refer to this machine as runhost in the remainder of these instructions.
  3. Determine whether or not you require a floating license key. You need a floating license key if, and only if, you want to run a hub on a machine other than the one the license key is locked to. The Setting Up The Hub section describes the factors that may affect your choice of hub location.
  4. Decide where you want to run the CodeSonar license key server. The floating license key will be specific to this machine: it will not work with license key servers running on other computers. We will refer to this machine as serverhost in the remainder of these instructions.
  5. If CodeSonar is not installed on serverhost, install it now.
  6. Update the setting of your PATH environment to include $CSONAR/gtr/bin (if it is not already present).

Obtain and Set Up The License Key

Once you have determined a serverhost for running the CodeSonar license key server:

  1. Log into serverhost.
  2. Run
    codesonar generate-license
    This command collects a small set of information that will be used to construct your license key.
  3. Copy the output from codesonar generate-license. It will look (something) like the following.
    {
        "ip addresses" : [ "198.51.100.0" ],
        "lock mutex" : "Global\codesonar_license",
        "mac addresses" : [ "02:00:5e:fe:c6:33:64:00" ],
        "machine" : "alexmachine",
        "name" : "CodeSonar",
        "user" : "alex",
        "version" : 309,
        "volumes" : [ "A438-C3F3" ]
    }
    
  4. Open CodeSecure's license key request page.
  5. Paste the output from codesonar generate-license into the form field provided, and click Submit. CodeSecure will generate a license key based on the information you collected and on your licensing terms, then mail the license key text to you.

    The license key text will resemble an extended version of the codesonar generate-license output you submitted to CodeSecure. In particular, it will include a signature attribute.

  6. When you have received the license key text from CodeSecure, verify that it is a floating license key: it should contain an attribute of the form "floating":true.
  7. Decide whether you want to use server-side or client-side management for the new license key. Server-side management is generally more straightforward, but client-side license keys can be added or updated without restarting the license key server.
    Either:

Server-Side Setup

  1. Save the license key text you received from CodeSecure on serverhost, in a location where the license key server will be able to read it. We will refer to this location as <path>/<to>/<licensekeyfile>.
  2. On serverhost, start the license key server. (See the IPv4 note if your system does not support IPv6 loopback addresses.)
  3. Inform CodeSonar of the license key server location.
    1. Navigate to the hub's License Utilization page.
    2. Enter the following text into the Edit License(s) field, replacing any text that was previously present.
      { "server address":"<serverhost>:<serverport>",
        "server side" : true  }
      
      For example, if your license key server is running at [2001:db8::abcd]:7350:
      { "server address":"[2001:db8::abcd]:7350",
        "server side" : true }
      
    3. Click Save. The hub will attempt to connect to the license key server and obtain a license session.
      • On success, CodeSonar will display a "License successfully updated" message above the text field and update the utilization summary to reflect the current license key terms.
      • Otherwise, CodeSonar will display a "License Error" message above the text field, with details of the problem experienced.

Client-Side Setup

As an alternative to specifying server-side license keys with -f licensekeyfile at license key server startup, it is sometimes more convenient to use a client-side license key. Client-side licenses are still managed by the license key server, but are stored on the client machine.

To set up a client-side license key managed by the license key server at <serverhost>:<serverport>:

  1. On serverhost, start the license key server. (See the IPv4 note if your system does not support IPv6 loopback addresses.)
  2. Connect your hub to the license key server.
    1. Navigate to the hub's License Utilization page.
    2. Paste the license key text you received from CodeSecure into the Edit License(s) field, replacing any text that was previously present.
    3. If necessary, edit the file so that it conforms to client-side requirements:
      1. If attribute "server address":"<serverhost>:<serverport>" is not present, add it. Make sure there is a comma between this attribute and the one before it, and place a comma after the attribute if it is not the last one in the license key.
      2. Delete any conflicting "server address":"..." attributes.
      (Note that changes to these attributes are allowed for in the CodeSonar license key mechanism and will not affect license key validation.)
    4. Click Save. The hub will attempt to connect to the license key server and obtain a license session.
      • On success, CodeSonar will display a "License successfully updated" message above the text field and update the utilization summary to reflect the current license key terms.
      • Otherwise, CodeSonar will display a "License Error" message above the text field, with details of the problem experienced.

Updating Floating License Keys

If you receive an updated license key from CodeSecure, perhaps because you have purchased an amendment to allow additional licensed resources , you will need to apply the updates.

Updating Server-Side License Keys

To update a server-side license key managed by a license key server running on <serverhost>:<serverport>:

  1. Shut down the hub.
  2. Stop the license key server on <serverhost>. (See the IPv4 note if your system does not support IPv6 loopback addresses.)
  3. Replace your old license key file path/to/licensekeyfile with the new license key file.
    cp updatedlicensekey path/to/licensekeyfile
  4. Restart the license key server. Include any <other_flags> that your license key server requires. In particular, use -f directives to specify any other server-side license keys to be managed by the server.
  5. Restart the hub.

Updating Client-Side License Keys

To update a client-side license key:

  1. Prepare the updated license key file as described above.
  2. Navigate to the hub's License Utilization page.
  3. Paste the contents of your edited file into the Edit License(s) field, replacing any text that was previously present.
  4. Click Save.

License Key Server Commands

This section contains detailed information about starting and stopping the license key server.

Starting the License Key Server

Start the license key server in the following situations:

To start a license key server as a background process:

stifflm start [-a <host>:<port>] [-m <max_sockets>] [-f <licensekey_file>]

where:

-a <host>:<port>: specifies the location at which the license key server will run. Default is [::]:7350.
-m <max_sockets>: specifies the maximum number of connections ( hub to license key server) permitted. Default is 62.
-f <licensekey_file>: specifies a license key file that should be managed by the server. The license keys specified in this way are referred to as server-side license keys.
The stifflm start command can specify multiple -f values. There is no default value.

To start a license key server in the foreground use stifflm server, which has the same set of options as stifflm start.

Stopping the License Key Server

Stop the license key server in the following situations:

To stop a license key server:

stifflm stop [-a <serverhost>:<serverport>]

where <serverhost>:<serverport> is the location at which the license key server is running (default id localhost:7350).

Note that stopping the license key server will usually cause any hubs licensed through that server to shut down.

Troubleshooting

If CodeSonar encounters problems in processing your license key, it will display an error message.

The following are some common error message types.

[...]
Found network interface {...} with hardware address 02:00:5e:fe:c6:33:64:00. Not present in license.
None of the MAC addresses in the license were present on this computer.
None of the MAC (hardware) addresses of the NICs (network interface controllers) on the machine correspond to any of the addresses listed in the license key.
Connecting to <serverhost>:<serverport> for license download.
Resolved to <IPaddress>:<serverport>.
Connection to <IPaddress>:<serverport> failed: Connection timed out.
First, check that the license key server machine (serverhost) is running and is connected to your network.

If serverhost is available on the network and you are still seeing this problem, access to serverhost:serverport may be blocked by a firewall or other network security measure. Resolution will depend on your platform and on your network policies: you may need to consult your system administrator to determine the best approach, which in general will involve either:

License does not parse: CS_INVALID_DATA_FORMAT
Perhaps the license was not transcribed accurately.
The text you have provided does not have correct license key syntax.
License verification failed.
Perhaps the license was not transcribed accurately.
Note that licenses are case sensitive.
Some attribute of the license key is inconsistent with its signature.

Almost all of the license key text is validated against the signature: "server address" is the only attribute that can be added, removed, or edited.

License verification failed.
The license is not signed.
The license key does not contain a signature attribute.

You may have accidentally used the output from codesonar generate-license rather than the signed license key you received from CodeSecure.

[...]
License already in use by another process (Global\codesonar_license is locked).
or
License already in use by process with PID pid (/tmp/codesonar_license.lock is locked).
The maximum number of CodeSonar hubs permitted by the license key are already running, so the current hub cannot be licensed. This can occur with both server-side and client-side license keys.

Navigating to the License Utilization Page

For a hub located at <hostname>:<port>, navigate to the License Utilization page as follows.

  1. Set up and start the hub, if necessary.
  2. If the CodeSonar Web GUI is not already open, open it now.
    http://<hostname>:<port>/
  3. If you are not already signed in as Administrator, sign in now.
    1. Click the Sign In link (at the top right of the page).
      CodeSonar will open a page for you to enter credentials.
    2. Enter Administrator in the Username field.
    3. Enter the Administrator password in the Password field.
      (If you have just started a new hub, you will have set a password for Administrator as part of that process.)
    4. Click Sign In.
    If this is the first time the Administrator account has been used, you will be asked to specify an email address for the account.
  4. Click the see licensing details link in the GUI footer.
    The License Utilization page will open. Directly under the page heading will be a text field labeled Edit License(s).

If You Don't Use the GUI

If you don't use the CodeSonar GUI, you can specify a license key server for your hub by saving the relevant license key information in a file on the hub machine (runhost).

We do not recommend using this approach if you have the option of using the GUI.

  1. Decide whether you want to use server-side or client-side license key management.
  2. Create a text file with contents as described above (server-side | client-side).
  3. Save the file in an appropriate location on runhost. There are two options.
    • Save it as license.txt in your CodeSonar installation directory: $CSONAR/license.txt
    • Save it in an arbitrary location path/to/licensekeyfile and set environment variable STIFFLM_FILE=path/to/licensekeyfile.

IPv4 Note

If your system does not support IPv6 loopback addresses, use IPv4 to specify and identify addresses instead. For example:

If you have not yet configured the hub, go on to Hub Setup: Hub Configuration.
Otherwise, go on to Installation: Finishing Up.

 

To report problems with this documentation, please visit https://support.codesecure.com/.