Monthly Archives: May 2014

The winding road to a code-signing certificate

Are you interested in software code signing? If so, here’s the twisting tale of my recent interaction with Symantec, in the hope that it is useful to someone.

Extending a valid certificate with the same credit card and still valid passport? Someone might be impersonating me, so a notary is required (again) to confirm my identity. Somewhat understandable.

The notarization (seal/stamp) is to be scanned and sent by email (upon hearing this, the notary was shocked – anyone could forge it). So the whole process is a farce known as “security theater”. So be it.

The notary’s commission expired the same day I came. Bad luck, but I made sure to send off the document that same day.

Symantec objects: when using a German passport for identification, the notary’s address must be in Germany. The case of an expat living aboard is only allowed if they use secondary ID documents issued by the current country (though no mention is made of this).

Symantec reconsiders: they can accept a Singaporean notary if I cancel the order and create a new one.

Symantec finds fault with the now-expired notary commission. Although it proved my existence on that day, the expired stamp is now considered worthless. Another notarization is needed. As a compromise, they offer to absorb the cost of the second notarization into the purchase price. This seems fair!

I re-notarize the document. Some days later, Symantec sends word that the order is “complicated” and their senior team is investigating.

A few days later, I am contacted by a Symantec employee who wishes to confirm my place of residence and whether all the data are correct.

Soon after, the certificate is issued and works!

However, the agreement has changed [Darth Vader style]. There will not be a further rebate because the discounted price of $173 is already much lower than their usual price.

If such Kafkaesque bureaucracy and flip-flopping is a regular occurrence, I can actually understand why they might want to charge > $400 per year to issue a certificate. After all, this odyssey involved no less than 5 Symantec employees.

However, Comodo seems to be able to do it for much less (around $80 per year). Under German law, there is a case to be made for Symantec’s full price being illegal price gouging, because its cost is “noticeably disproportionate to the services rendered”.

That very interesting point aside, perhaps there are more hassle-free alternatives (this undertaking cost several hours). If you’ve dealt with any other vendors for kernel-mode code signing certificates, I’d love to hear your story via email. If dealing with Symantec in future, beware of the country-of-residence issue. Hope that helps!

A wonderfully simple GUI for OpenGL

After casting a wide net, I found many C++ UIs, but they are generally bulky and often want to grab the main loop (big no-no).

  • Large: Qt, WxWidgets, cinder, CEGUI, ultimatepp, clutter, IUP, JUCE.
  • Medium: Agar, Fox, FLTK, GWEN (seemed the best of these).
  • Small but not terribly attractive: GLUI2, GLV, Turska, STB imgui, simgui.

Capturing the main loop is unacceptable. In the case of Qt, two QGraphicsScenes will each want to vsync, which halves the framerate. Instead, I have a very nice loop that never(!) blocks the main thread, wakes up immediately after a Windows message is received, and waits for vsync with <1% CPU use. (This is hidden behind the SDL interface for portability.)

The approach of AntTweakBar – providing controls that modify YOUR variables, rather than caching everything inside some deep class hierarchy, looked nice. Unfortunately the code is dense, surprisingly large and has had some scary bugs.

Further research pointed towards IMGUIs – conceptually very simple, easy to use, straightforward to integrate. Great! Most of the ones I found stumble in terms of text rendering (important for UIs) and/or were not portable or easy to integrate into an SDL/OpenGL app. The best one was Nvidia’s now discontinued imgui from their SDK.

I started with that and completely rewrote it with proper text rendering, much simpler and cleaner code, and support for vertex arrays so it will hopefully also run on GL ES 2.

Here’s a screenshot showing various controls (checkbox, slider,  list box, label, combo box, panel, radio button, pushbutton, line edit):

OpenGL UI v2
The best part: it’s all contained within a 340 KB executable with no external dependencies (apart from the usual kernel/user/gdi/opengl). The whole thing is only ~9 KLOC and builds in 2 seconds. This is the kind of simplicity I like – such a joy to develop 😀

Let’s share in the fun. The headers are available here: ui [6 KB]

I’d love to hear your thoughts on the interface, whether anything important is missing, and welcome any discussion here or via email.

Tip #384: A simple fix for mosquito bites

I am grateful that mosquitoes are not much of a problem in downtown Singapore – perhaps they cannot fly high enough. Their vertical flight range is reported to exceed 21 stories above ground [http://www.nea.gov.sg/cms/sei/ehi1slides.pdf], but I have not seen any at 34 or above.

When traveling, though, it’s a different story! Despite repellent, we end up with all these itchy bumps. Perhaps we could view them as opportunities for mindfulness, but it would be much easier if they would just go away. Is that actually possible?

Long ago, I learned (through a slip of the soldering iron) that heat seems to make the bites disappear as if by magic. To understand why, let’s take a step back.

Blood from injuries generally clots, so the mosquito’s `needle’ would soon become clogged. To prevent that, they inject various proteins with several nasty effects:

– suppressing T-, B-cell and cytokines (immune response)
[http://onlinelibrary.wiley.com/doi/10.1111/j.0141-9838.2004.00712.x/abstract]

– interfering with platelets (blood clotting)
[http://www.jbc.org/content/282/37/26928.full]

– even increasing mortality from West Nile Virus
[http://www.ncbi.nlm.nih.gov/pubmed/23236530]

Yikes! The itching aside, it sure seems useful to undo these effects. We know from basic cooking that (e.g. fish) protein denatures at fairly low temperatures.

Indeed, someone recently asked on reddit [sic] “Can putting a hot spoon on a mesquito bite denature the protien to lessen the allergic reaction”? The replies there seem unnecessarily negative:

“immunoglobulins .. start to denature at around 60C”
Perhaps the ill-posed question led the responder astray, but we are not interested in denaturing the IgG. It suffices to attack the mosquito saliva itself, not our desirable immune reaction to them.

“it would take between less than one to 25 hours (depending on the temperature) to fully denature the antibodies”
In addition to focusing on the wrong protein, this view is overly pessimistic because we do not need to fully and irreversibly denature the protein. Perhaps it is enough to unfold them, which happens more quickly and at lower temperatures.

“alboserpin (the anticoagulant in mosquito saliva that our bodies react to).. are only sensitive to denaturation at temperatures above 60C”
Maybe so, but it actually comprises only 1% of the proteins in mosquito saliva. [https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3151045]

“Its remarkable the disinformation regarding this out there; if you think critically about heat-mediated mosquito protein denaturation being the mechanism for itch reduction, it just doesn’t make any sense.”
Sounds like ill-informed and closed-minded dismissal of a valid observation. It is more understandable if coming from a school that claims the only salvation lies in anti-histamines and other drugs. “It is hard to fill a cup which is already full.”

Let’s turn this around and look from the perspective of researchers who want to store mosquito saliva. Potency roughly halves when storing at 21C vs 4C. [http://www.parasitesandvectors.com/content/4/1/33] Sounds potentially useful!

Also, West Nile Virus “is thermolabile and .. inactivated rapidly by heat”. “At 28C the titer of the virus decreased by a factor of 10^3”. [http://www.karger.com/Article/FullText/353698] Very doable. These low temperature thresholds indicate we can measurably reduce mosquito effects at temperatures far short of really hurting our skin. Bring on the heat!

Apparently there is an FDA-approved gadget for the purpose: [http://gizmodo.com/5935350/therapik-bug-bite-relieving-gadget-review-we-cant-believe-this-actually-works] I’ve never tried it, the underside of a mug containing boiled water works well enough. Around 30 seconds seem to do the trick. I’d estimate that temperatures around 45-50C are required.

Please don’t go and get third-degree burns, but some pain is involved.

For completeness, let’s mention the theory that heat merely (temporarily) overloads the nerve that signals itching. That is still possible, but I offer anecdotal evidence that heat-treated mosquito bumps entirely disappear within a few hours, which is not the usual experience.

I hope this helps!