Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issue26: outdated FIRMWARE version #60

Merged

Conversation

frickler24
Copy link
Collaborator

The file FIRMWARE in the root directory of ckb-next is signed.
Therefore, updating the obsolete content was not possible by anyone.

A new key has been created, with which only signatures for this development
should be made (ckb-next@frickler24.de, BAF07C6B).
The key was self-signed and in addition signed with my personal key.
It should also be signed by mattanger and possibly others.
Caution: The key may not be exported as ASCII file, but only as a binary file!

The display of gpg -d FIRMWARE should do something like this:
Gpg: Signature from Sat 04 Feb 2017 11:59:11 CET using RSA key ID BAF07C6B
Gpg: Correct signature of »ckb-next (For signing development artefacts only!)
Ckb-next@frickler24.de«

To test the function, the signed FIRMWARE file was originally uploaded to a branch of mine:
https://raw.githubusercontent.com/frickler24/ckb-next/issues-26-Firmware-Incident/FIRMWARE
(in line 36, kbfirmware.cpp).

In order for the mechanism to go productive,
the FIRMWARE file of the MASTER branch must be updated!

To prepare the mechanism fpr production,
the link ist updated to the MASTER branch FIRMWARE file:
https://raw.githubusercontent.com/mattanger/ckb-next/master/FIRMWARE


  • Therefore this patch must first be used in master branch
  • so that the correct file and key can be loaded at runtime.
  • Then the patch can be added to the testing branch and others.

If the file or the key in the master branch is not up-to-date,
an error message is displayed when the ckb client is started
(as an example, here a possible error message):

Gpg: Signature from Thu Jun 30th 2016 09:15:49 CEST using RSA key ID 8DC8D309
Gpg: [do not know]: invalid packet (ctb = 2d)
Gpg: keydb_search failed: Invalid package
Gpg: Can not check signature: Public key not found

.gitignore is updated to ignore a directory containing tmp-files
and a script for signing the FIRMWARE-file.
If it is interesting for others, I can commit it also.

The file FIRMWARE in the root directory of ckb-next is signed.
Therefore, updating the obsolete content was not possible by anyone.

A new key has been created, with which only signatures for this development
should be made (ckb-next@frickler24.de, BAF07C6B).
  The key was self-signed and in addition signed with my personal key.
  It should also be signed by mattanger and possibly others.
Caution: The key may not be exported as ASCII file, but only as a binary file!

The display of gpg -d FIRMWARE should do something like this:
  Gpg: Signature from Sat 04 Feb 2017 11:59:11 CET using RSA key ID BAF07C6B
  Gpg: Correct signature of »ckb-next (For signing development artefacts only!)
       <Ckb-next@frickler24.de>«

To test the function, the signed FIRMWARE file was originally uploaded to a branch of mine:
 https://raw.githubusercontent.com/frickler24/ckb-next/issues-26-Firmware-Incident/FIRMWARE
 (in line 36, kbfirmware.cpp).

In order for the mechanism to go productive,
the FIRMWARE file of the MASTER branch must be updated!

To prepare the mechanism fpr production,
the link ist updated to the MASTER branch FIRMWARE file:
   https://raw.githubusercontent.com/mattanger/ckb-next/master/FIRMWARE

**********************
* Therefore this patch must first be used in master branch
* so that the correct file and key can be loaded at runtime.
* Then the patch can be added to the testing branch and others.
**********************

If the file or the key in the master branch is not up-to-date,
an error message is displayed when the ckb client is started
(as an example, here a possible error message):

  Gpg: Signature from Thu Jun 30th 2016 09:15:49 CEST using RSA key ID 8DC8D309
  Gpg: [do not know]: invalid packet (ctb = 2d)
  Gpg: keydb_search failed: Invalid package
  Gpg: Can not check signature: Public key not found

.gitignore is updated to ignore a directory containing tmp-files
and a script for signing the FIRMWARE-file.
If it is interesting for others, I can commit it also.
@tatokis
Copy link
Collaborator

tatokis commented Feb 4, 2017 via email

@frickler24
Copy link
Collaborator Author

OK, then take mattangers.

@frickler24 frickler24 closed this Feb 4, 2017
@ghost ghost reopened this Feb 4, 2017
@ghost
Copy link

ghost commented Feb 4, 2017

I hope @mattanger can clear things up.

FIRMWARE Outdated
# ckb-next does NOT read this file when flashing firmware manually. It will allow you to load any valid FW blob (at your own risk).
#
# -------->>>>>> for Scimitar is a 2.4 available, for Strafe 2.05 !
# -------->>>>>> What code is valid for K70 (non RGB)? Lastz code at corsair is 2.04
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in "Lastz"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Will be fixed with the additional K70 Infos.

@frickler24
Copy link
Collaborator Author

frickler24 commented Feb 4, 2017

Currently I'm still updating the information for the K70 variants.
@ Mattanger asked in the issue thread for my solution. If he has a new key, he can update the information most easily in the source code after merging the pullreq.
If he does not already have a new key, we should exchange the key generated by me. When I get his public key, I can send him my private key encrypted.

The current Information (all K70 except the K70 non-rgb) is here

For the K70 the known variants are added.
The only one still missing is the K70 non rgb.
FIRMWARE Outdated
Corsair K70RGB 2.05 https://www3.corsair.com/software/HID/K70RGB.zip 0.2.7 K70RGB_APP_V205.bin 3e43bdcc5077dc413fbdee7ff6e57a978f758599142eef6979a96e3b8c3a566a
Corsair K70LUX 2.04 https://www3.corsair.com/software/HID/K70LUX.zip 0.2.7 K70LUX_APP_V204.bin c2b5411e1dce391788eca294563801b32a14bf7802eb29688213f8f07e112966
Corsair K70LUXRGB 2.05 https://www3.corsair.com/software/HID/K70LUXRGB.zip 0.2.7 K70LUX_APP_V205.bin a1a0a4b2f74890eb708435b21ab197a301ea668269bca895f89f7301c354e83d
Corsair K70RAPIDFIRE 2.05 https://www3.corsair.com/software/HID/K70RAPIDFIRE.zip 0.2.7 K70RAPIDFIRE_APP_V205.bin 6b1d2bb962ffd987ce5eb25c46b02a9069c5f79ca05d7b2cc71c749fe9813536
Copy link

@ghost ghost Feb 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an rgb version too, I've updated the comment in #55.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@light2yellow add an RGB version for the rapidfire or another one?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, k70 rapidfire.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I found it. it is call K70RGBRAPIDFIRE with v2.05

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can update the FIRMWARE file, but anyone who owns that keyboards should give us the correct information from the model files. With this information, fwupgradedialog.cpp must be updated also (the KbId ids[] array).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, you can probably just comment it out for now. On irc I proposed creating a separate issue that would track the current support status of different keyboards (some of them are fully supported (I suppose), some of them are supported in an add-and-pray style with just the array of models being updated) just to keep track of everything (we already have k65-related info "somewhere"). Because I didn't follow the project for these two years I don't know what level of support is provided for the keyboards listed in Readme, I can only tell that my own keyboard (Strafe RGB) seems to be fully supported.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The automatic update (at least the search for it) should run with an updated FIRMWARE file.
As I mentioned in the recent commit, the line with the correct firmware download-site etc. is searched dynamically by other factors. The ids-array seems to be used in the manual update dialog only.
Because that dialog did not work for me when I last needed it for the mouse FW upgrade, I will have a look at it next. But first I need some testing for issue 48 :-)

There miight be an problem with this Firmware definition:
The filename at corsair doenload site is K70RGBRAPIDFIRE.
The standard rule used in ckb for creating the model names is
vendor + model-with-features + (RGB or nothing).
With this the name to look for in the FIRMWARE table should be
Corsair K70RAPIDFIRERGB
@mattanger
Copy link
Owner

Sorry I've been out. @frickler24 & @tatokis I do have this key. I'm going to merge the PR and update the source with the new key. Thanks for working on this! You're obviously contributing a lot, so hop on IRC or lemme know if you're interested in being a maintainer.

@tatokis
Copy link
Collaborator

tatokis commented Feb 5, 2017

@frickler24 Apologies if my reply came off as negative. That was not my intention, I was genuinely not sure what to do.

Also, suggestion, maybe use RFIRE instead of RAPIDFIRE to save characters, just like we do in usb.h?

@ghost
Copy link

ghost commented Feb 5, 2017

@frickler24 should the FIRMWARE file be gitignored?

@frickler24
Copy link
Collaborator Author

@light2yellow The FIRMWARE file is loaded by the ckb client when it checks for firmware upgrades directly from the github repo. If we gitignore it, it will outdate in the repo.
The client does not need a local FIRMWARE file, but is there a way in git to handle the file in github, but not in the clone-able repo?

@tatokis
Copy link
Collaborator

tatokis commented Feb 5, 2017

You should be able to unstage it before doing a commit.

If we gitignore it, then there won't be a way to update it on the repo, unless I am mistaken.

@frickler24
Copy link
Collaborator Author

@tatokis good idea to reduce the string length. I've done it in the last commit.
Thanks for your comment about your intention. No problem, I think we have enough to fix in this project and I wanted to avoid different solutions.
Another question: How should we track the other things which have to be done for the firmware-versions?
usb.h has a lot of good entries, but in usb.c, const char* product_str(short product) must be completed.
Open a new issue or track it here?
Is anyone working on this yet (@mattanger ?)

@frickler24
Copy link
Collaborator Author

@mattanger collaborator would be nice. I have good experience in C, some in C++ and a very little in git.
For my english translations google will help...

@mattanger
Copy link
Owner

@frickler24 Awesome, and yes I'm working on this. What I'm going to do is merge in your PR, then re-sign the FIRMWARE file with the new key and replace the binary key you've submitted.

The .firmware directory entry in the gitignore, aside from housing the script you mentioned, is there any reason for it existing other than for your personal use? It's not a big deal, but I think its somewhat bad practice to add extraneous entries.

Lastly, I don't really see an issue with tracking the FIRMWARE file in the repo, while the client may not need it locally, it does give us a simple and convenient way to keep it updated.

@frickler24
Copy link
Collaborator Author

@mattanger you are right, the .firmware directory contains the following:

  • the FIRMWARE file without signature infos
  • a simple one-liner to sign that file with output goes to ../FIRMWARE afterwards
  • the firmware files, downloaded from corsair. I needed this to get the sha256sum.
    I believe we are not allowed to publish these files, because they own corsair and I think they are copyright relevant. These files are the main reason why I gitignored the directory.

So you may delete the .firmware directory entry in .gitignore.
When I pull your master with the updated FIRMWARE, there is no need for it anymore and the commit is clean.

@mattanger
Copy link
Owner

Gotcha. I'm going to merge in what you have, then remove it on the next commit when I update the signed files. Thanks!

@frickler24
Copy link
Collaborator Author

Thank you for your work!

@mattanger mattanger merged commit 90febc3 into mattanger:master Feb 8, 2017
@frickler24 frickler24 deleted the master-issue-26-outdated-firmware-file branch February 8, 2017 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants