NSS DTLS sample application codes - nss

Is there sample standalone "application" codes of utilizing NSS DTLS/SRTP features somewhere available?
There are sample application codes of cmd & tests that utilize SSL3/TLS features that come with NSS Mozilla releases, but none for DTLS features - though there is DTLS support in nss/lib/ssl/ codes, but those are to SSL3/DTLS internal working.
I have tried googling for days but to no avail. I've been trying for a couple of weeks to write codes to access those internal codes, which requires quite a lot hacking to create internal hooks in ssl/ directory, which I think is not the right approach and not going well. But I simply can't find a reasonable API, in dtlscon.c, ssl3con.c and etc., for application to use or a sample app to follow.
Could someone provide some hints or a sample standalone client/server application codes that actually utilize the NSS DTLS/SRTP features?
I'm doing the coding in C under NSS cmd/tests or JAVA under nss/jss/org/Mozilla/jss.
Thanks,

Related

Google Testing Framework and Qt

I want to start using the Google C++ Testing Framework, but I don't understand how it use with Qt?
What should I do to start? How to link GTF to my project and use it? If possible, I'd like a detailed guide.
There is nothing special about testing Qt in particular, just familiarize yourself with google testing and Qt, then write your test cases. You'd test Qt code like you'd test anything else.
Good places to start:
A quick introduction to the Google C++ Testing Framework courtesy of IBM
Getting Started with Qt
The one thing to keep in mind is that a significant part of Qt is event driven, which requires a running event loop.
Additional resources:
Running Autotests in Creator - setting up google test
the Qt Creator Google Test plugin
Edit:
To elaborate on Gluttton's comment, as evidently, other users share the sentiment:
The clarification about the design particularities of Qt should imply two things:
1 - in many cases, individual tests will require an above trivial setup, that is still standard Qt and C++, set up event loops and connections and whatnot - nothing special whatsoever.
2 - in some cases, there is only so much that unit testing can do. Some functionality requires larger and more complicated runtime setups, that are impractical or even impossible in the context of unit testing, thus falling outside of the scope of the google testing framework.

Haxe + real-time network

i try to find a good combination of libraries for managing a real-time communication (client/server) using Haxe (only Haxe, not openfl or other framework base on Haxe) targeting flash (swf) for the client and no preference for the server except don't use neko.
The goal is to make a simple tchat and put a display representation of all clients on an aera. Each client can move his representation in this area, and the other sees the movement.
I find some Lib to make this :
https://github.com/soywiz/haxe-ws
https://github.com/MattTuttle/hxnet
haxe-js-kit
But I'm not sure of the best way to adopt.
Do you have any suggestion/remarks/tips to choose the better way ?
Disclaimer: I wrote the library that I am sharing here.
My somewhat new library mphx may be able to help you. It can manage 'rooms' of connections, allows client to server and server to client messaging in the form of events, and best of all, is cross platform. It also works in the web with websockets.
It was originally an extention of HxNet, however I wanted it to be easier to use. Connecting and sending a 'message' with data just takes a few lines.
I have a few examples in the github repository, the simplest being the 'basic' example. One of your requests you have is that it doesn't rely on one of the big libraries (open fl, etc) and mphx doesn't. The basic example proves that, and only runs in terminal. That being said, it can be used with haxeflixel, for that you can see the other examples.
It sounds like your main goal is to have simple, graphic multiplayer. For that you can look at the 'movement' haxeflixel example.
Documentation is still a little skim, and the code is alpha, so it might change or break. That can probably be said for most of the library's you listed though. The best way to install it is like this
haxelib git mphx https://github.com/5Mixer/mphx.git
That will not install the examples though. To run them, either download the repository as a zip, or just git clone it, and go into the examples folder.
Library: https://github.com/5Mixer/mphx
Old video's I made. A little outdated, most likely.
Video 1: https://www.youtube.com/watch?v=07J0wLXwH0g
Video 2: https://www.youtube.com/watch?v=MUx2CUtsnTU

How to set DeviceIoControl (IOCTL)?

Have anyone experience using "DeviceIoControl", this functions seems to be a way an application can do IO control (IOCTL) which is generally set for Driver for example:
IOCTL_SERIAL_SET_QUEUE_SIZE
IOCTL_SERIAL_SET_LINE_CONTROL
IOCTL_SERIAL_SET_CHAR
I have a software communicating with modem, when I monitored with portmon(serial port monitoring tool), I saw that software is setting the above three parameter, I am writing that software of my own in c++, but I couldn't found any thing from where i can start. If any one having experience using this, please help me, if needed, i can brief more about this project.

Google Native Client - How to protect the source code?

With Google Native Client, can the source code be protected so that, unlike JavaScript, it is not visible in the client?
If so, how? Thanks!
As the name says, Google Native Client uses native code.
That means, your code is compiled, just like with your average executable binary on the desktop. It can be disassembled, but the source code can't be recovered.
Native client means that you are running native code on the client. In most cases, you'll be running i386 or amd64 machine language on your client. If you're using a compiled language, then your users cannot directly recover it. Users could disassemble your software to recover some information about your code, but they cannot recover the original source code (unless it is assembly language). Rewriting a piece of software from the disassembled binary is difficult, but given enough time, it can usually be done. It really depends on how paranoid you are about the people using your code.
Native Client's structural requirements to enable reliable disassembly so that it can perform static analysis can make some techniques for code obfuscation unusable. These are often the same techniques used by malware to make malware analysis difficult, i.e., have two valid interpretations of the instruction stream if decoded by different offsets. Native Client does, however, permit a form of self-modifying code since it has JIT support. Mono uses just-in-time code generation, for example, and the same interfaces can be used to create obfuscated code, as long as the JIT'ted code continue to conform to the NaCl security requirements.
Using the JIT interface would of course make your code non-portable to other CPU architectures.

Simulating a TWAIN Device

Our company is using some software that ONLY accepts input from an "Imaging Device" i.e. a TWAIN device (e.g. scanner).
The problem is that we are receiving our files digitally, so using an actual scanner would require us to print, scan, and shred documents that we already have on the computer, but not in the software.
I was curious if anybody has any idea of how we might be able to work around this problem in the meantime. My first thought was to find some way to trick the program into thinking we're using a scanner, via some new 'imaging device' that would just read in the file, and spit it out to the software, but I don't even know where to begin with that.
We put in a feature request, seeing as how this problem should obviously be addressed in the software itself, but the company is notorious for lagging pretty hard when it comes to updates.
The system used by scanners is called TWAIN, so you'd be looking for some sort of virtual twain driver.
A quick google search will produce several hits, I don't have any experience with the software myself so can't advise any further.
Two such providers I found via experts exchange:
http://www.twaintools.de
http://www.scanpoint-usa.com
OK, months late... but in case you are interested, I have a TWAIN driver framework/toolkit that might let you build this fairly easily, depending on just what your scanning app expects, and how hard it is to read images from your digital documents. It's a Microsoft Visual C++ project. No charge but you'd need our permission to redistribute a driver based on it: GenDS
The TWAIN Working Group also has a sample/skeleton driver, I think it's straight C - and used to have some rather bad bugs (Why I wrote mine ;-) but, it might have got better.
Look for the "sample data source and application" on their download page.
And of course I have a 'commercial' version of GenDS that I use to write TWAIN drivers on contract.

Resources