1

(10 replies, posted in wolfSSL)

Hi Jacob.
WE DID IT!!  Yes it was always giving an error in the same spot.
My problem was with my method of the reading of the socket.  It was closing the connection for receiving but leaving it open for writing.  Hence the socket was not completely disposed and creating a headache for debugging.

I am writing some instructions about how to implement everything on the Pi.  As I retrace my steps I remembered something dodgy I had to do earlier.
In order to compile I had to edit random.c in the wolfssl.

int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
{
    if(!CryptAcquireContext(&os->handle, 0, 0, PROV_RSA_FULL,
                            CRYPT_VERIFYCONTEXT))
        return WINCRYPT_E;
    if (!CryptGenRandom(os->handle, sz, output))
        return CRYPTGEN_E;
    CryptReleaseContext(os->handle, 0);
    return 0;
}

Can you think of any methods that doesn't use this API as it does not appear to be available in platform 10.0.10240.0.

Thanks again for all your help.  Hopefully my instructions will save others a lot of time.

Regards

2

(10 replies, posted in wolfSSL)

Hi Jacob,
I feel like a pioneer. lol.  I am attempting to make a basic https server.

I also have wolfSSLCbIOSend working now.

The strange behaviour I was finding with the Stream.Socket was that it would not let me break up the stream into byte chunks as needed by wolfSSLCbIORecv.  Any request of this manner resulted in 0 data received (all 0's).
Instead I accept the whole stream and store in a global variable (I know, I know) then break it into smaller chunks for the subsequent calls of wolfSSLCbIORecv until the buffer is empty.

So far from my wireshark logs I see.
Client Hello
Server Hello
Certificate
Server Hello Done
Client Key Exchange <--  This is where it currently dies.

From what I can tell I never try to receive the client key exchange. wolfSSLCbIORecv is called but I am getting a dispose error that I cant quite tell what is disposed or when?.
The socket looks like its not disposed and con is passing through.
Would those commands help me in this case??  It seem as though things are working in relation to wolfSSL I think its some garbage collection occurring but I just haven't manage to track it down yet.

Weekend is coming I shall try more.  I am so close.  I will post my code once I tidy it up to save others heart ache.

Thanks for your time
Duckula.

3

(10 replies, posted in wolfSSL)

Hi Jacob,

You are quite right, I did not build the dll from the CSharp folder and hence did not have the desired extra settings.
This fix my wolfSSL_new issue and I have started doing exactly what you said using wolfSSLCbIOSend and wolfSSLCbIORecv.

I have a successfully implemented wolfSSLCbIORecv which was interesting by itself, just finished testing.
Seems StreamSockets behaves strangely.

I am now working out a way of implementing wolfSSLCbIOSend. 
My simple method I was trying before is not able to complete. 
I will stick with it as I am happy with my progress and learning all the ways not to do things.

Thanks for the reply and all the effort from the team in creating this library. 
The examples are excellent and easy to understand.  I just needed to stare at them a couple days to get my head around it.

Regards

4

(10 replies, posted in wolfSSL)

Apologies for double post but I can only attach one file at a time.
Attached is the debug window

5

(10 replies, posted in wolfSSL)

I wont edit my previous post in case others they follow the same path as I did.
I have progressed a little bit and have edited the Wolf_CSharp wrapper that was provided as best I can for the moment.
I will continue to update this as I learn more. 

Feel free to review the attached file and assist if anyone can as I feel I have addressed some incompatibilities with the Universal Windows Platform (UWP).  It is poorly written as it has little error checking and needs more work.

Currently I am getting stuck at.
ssl = wolfssl.new_ssl(ctx);

From my debug I am not getting a IO(ctx). 

I will continue on my won but any help would be appreciated.

Thanks in advance

6

(10 replies, posted in wolfSSL)

I am attempting to implement WolfSsl into Windows IOT on the Raspberry Pi.
I have had success in in compiling and deploying wolfssl.dll on the pi.

I am using the CSharp wrapper and am having success with with a lot of the functions.
I am using the wolfssl-tls-server as the example of code to implement.

My problem arises with the fact that microsoft does not implement the System.Net.Sockets.TcpListener.AcceptSockets

So this code fails.
    fd = tcp.AcceptSocket();

I can accept connections using StreamSocketListener() however this does not expose the socket
and so this API is not possible, AFAIK.
if (wolfssl.set_fd(ssl, fd) != wolfssl.SUCCESS)

I know I am missing something trivial but so far have not managed to work it out.

Any help would be appreciated.  Thanks in advance.
Happy New Year