76

(3 replies, posted in wolfSSL)

What do you mean by 2 way SSL handshake, do you mean client certificate authentication?  What doesn't work when you try multiple clients?  Can you provide a description of the problem and any error codes that you're getting?  Is your server iterative or concurrent (if so by what design)?  Are you trying multiple clients simultaneously?  A simple example of the problem may prove beneficial.

77

(18 replies, posted in wolfSSL)

1) Yes, you need to implement GenerateSeed().  The output should be cryptographically secure random output.  Your hardware may offer that ability.

2) No, to get the server to send a certificate request you need to turn on peer verification on the server like this:

SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, 0);

The reason you're getting a verify error on the server for the client certificate is because you likely haven't loaded the client certificate as a verification certificate on the server side.  See the example server in server.c, specifically the line below the comment /* for client auth */.

3) The server should never it's private key.  The private key is meant to be private, otherwise you have no security at all.  The public key is sent in the certificate.

4)  TLS_RSA_WITH_AES_256_CBC_SHA is the default cipher suite that wolfSSL on both sides will negotiate so nothing needs to be done.

78

(18 replies, posted in wolfSSL)

How is it failing?  When and what error?  Are you the client or server?  Which version of TLS?  What SSL library is on the other end?  Can you provide a wireshark trace of the interaction?  You can send that to me, todd @ yassl.com .  Thanks.

79

(5 replies, posted in wolfSSL)

You can verify this chain with CyaSSL.  Simply load (2) and (3) instead of just (3), like Firefox does.  Currently, CyaSSL only trusts CAs to sign certificates that have been explicitly trusted to sign certificates.

80

(18 replies, posted in wolfSSL)

Four things:

1) Since you have a 64bit type available there's no reason to define MP_8BIT or MP_16BIT.  Try removing those.

2) But it sounds like the problem is with memory.  MakeSigner(), mp_init(), and mp_grow() all have one thing in common, dynamic memory use.

3) You could also try defining USE_FAST_MATH and compiling tfm.c in place of integer.c.  Recompile everything and see how that goes.  It removes dynamic memory use from the big integer library but if you truly have a dynamic memory problem it will likely just show up someplace else.

4) Try running the code on a "full" system where you can use a memory debugger to track down any potential problems.

Basically two functions:

1) Your Network Send function.
2) Your Network Receive function.

They are prototyped by CallbackIOSend and CallbackIORecv in ssl.h.  You then have to register these functions per SSL_CTX with CyaSSL_SetIOSend() and CyaSSL_SetIORecv().  It's probably easiest to put your functions at the bottom of cyassl_io.c.

Each SSL object can then register the actual context per session with CyaSSL_SetIOWriteCtx() and CyaSSL_SetIOReadCtx().  The default case, no user overrides, registers the socket as the context. 

You can use the default Send() and Receive() functions, EmbedSend() and EmbedRecv(), as templates when writing your own.  Look at the enum IOErrors for the error cases that may need to be returned, return IO_ERR_GENERAL when in doubt.

82

(5 replies, posted in wolfSSL)

Are you loading a trusted cert?  What is the depth of the chain?

I'm not positive CyaSSL's implementation is wrong.  The beginning of page 64 says "A particular certification path may not, however, be appropriate for all applications.  Therefore, an application MAY augment this algorithm to further limit the set of valid paths."

Though you're the 2nd person to request a less constrained augmented policy.  It's now on our list of repeated requests but nothing has been changed at the moment.  We'll probably add this feature as an option to CyaSSL 1.9.0.

83

(18 replies, posted in wolfSSL)

So is MP_8BIT working or not, I'm a little confused.

mp_word needs to be at least twice as big as mp_digit.  When MP_8BIT is defined mp_digit is char and mp_word is short.  Probably 8 and 16bits, but can you verify that?  How many bits is long, what about long long?

Are you defining SIZEOF_LONG or SIZEOF_LONG_LONG?  What compiler are you using?

Which function is causing the problem? MakeSigner() has nothing to do with mp_ints.  Is it possible you're running out of memory on the malloc call in MakeSigner() and that's causing the problem?

If you add those 3 function declarations to cyassl/include/openssl/ssl.h at the bottom and then blank implementations to the bottom of cyassl/src/ssl.c you should get past the ./configure process which will allow you see the total number of missing functions and what they are.  That will allow us to see how much work it is and the best way to proceed.

SSL_has_matching_session_id just checks to make sure that the user generated session id is unique.  The chance of collision is 2^256 so it should be.

Can you make a list of the missing functions?  If it's short and they're easy we can probably add them without trouble.

BTW, which proprietary core are you using?

86

(18 replies, posted in wolfSSL)

Are you compiling integer.c or tfm.c (with the USE_FAST_MATH option)?

If you are using fast math try defining TFM_TIMING_RESISTANT to reduce the runtime stack size.

If you're using integer.c, which function in that file is causing the crash?

87

(18 replies, posted in wolfSSL)

wolfSSL tries to be flexible in this area.  If it didn't use any dynamic memory static buffers would have to be created at the max size for all possible uses.  32kB for input/output, 12kB per certificate per type (in case conversion is necessary), 4kB per key for all types, etc...  In the case where someone just wanted to use PreSharedKeys with small data buffers they'd be paying for 100kB of stack memory use, memory that might not be available.

I suppose wolfSSL could have a build option to use static buffers of reasonable size for keys and certificates.

But currently, your best bet is to implement XMALLOC and XFREE.  You could simply have several static buffers that you use for these functions.  Your compiler doesn't provide any dynamic memory use? I'm not sure I've seen that even without an OS.

88

(18 replies, posted in wolfSSL)

First off, I'd recommend using the latest version, 1.8.0.

wolfSSL does use pointers, it allows flexibility in the design and memory usage.

What do you mean by heavy memory management?  You can use the fast-math library to reduce all dynamic memory use for public key crypto, which is the main consumer of dynamic memory.

NO_FILESYSTEM is completely independent of dynamic memory.

If you want to write your own XMALLOC routine, by all means, write it.  The prototype is in types.h.  You can ignore the "extra" parameters if you wish, or use them however you like.

89

(4 replies, posted in wolfSSL)

Yes, long long is part of ANSI C99: http://en.wikipedia.org/wiki/C99 .

But it's okay if it doesn't work, it's only on one line.  As long as you ensure fp_word is twice the size of fp_digit (independent of actual types) you should be fine.

90

(4 replies, posted in wolfSSL)

fp_word needs to be at least twice as big as fp_digit.

So fp_word should be the biggest size the compiler allows (usually 64 bits, but can be 16, 32, or even 128).

Then fp_digit should be the type that is half that size, 32 bits in the normal case.

91

(5 replies, posted in General Inquiries)

Everything was included in the mbed build including test code except for SHA-512, DH, DSA, and HC-128.

AES is pretty large for an encryption cipher because of the tables is uses.  ARC4 is much, much smaller.  DH itself is pretty small but like DSA and RSA it needs a big integer library, and that's where the size comes from.

You'll need all the source files in wolfssl/src except for sniffer.c, these comprise the TLS/SSL layer.

You'll also need the files you identified from wolfssl/wolfcrypt/src as well as some others.  Which cipher suite are you planning on using?  You'll probably need RSA for authentication.  And you'll probably need asn.c for certificate parsing. You may also need hmac.c, md5.c, and sha.c depending on the cipher suite (and certificate types).

asm.c is only needed if you're using the fastmath library and want assembly optimizations with a supported compiler (GCC style assembly).

integer.o is going to be the biggest object file since it's the biggest source file.  You should optimize for size (-Os for GCC) and remove the frame pointer if possible (-fomit-frame-pointer for GCC).  Depending on your compiler, processor, options, and instruction set you'll probably see this object file anywhere from 20 to 100kB.

93

(4 replies, posted in wolfSSL)

Yes, that's correct.  We got rid of potential header name conflicts and now allow all the header files to be placed in one directory.  And none of the includes use a directory path.  We'll have to update the docs for the custom build section.  Sorry for the confusion.

94

(5 replies, posted in General Inquiries)

I don't.  We typically use what the client has already picked.  Usually the stack is from the OS, the compiler provider, or it's purchased.  I'll ask around though and let you know if I hear of a good one.

95

(5 replies, posted in General Inquiries)

Whatever TCP stack is included with mbed's cloud compiler.  I'm not sure what that is, will have to check.

The mbed build was complete, no features were left out of the build.  To only build certain parts would obviously make the build smaller.  The performance was about what I'd except from the specs of the processor, no surprises either way.  We'll try to get some more performance numbers with the CyaSSL release next week.

96

(2 replies, posted in wolfSSL)

It depends.  Some people say not to use a session more than 500 seconds in case the server's private key is compromised.  Some say not to send more than a certain amount of data, certainly not more than 4 GB.  If you control the server and know the private key is secure you don't really gain much by continually starting and stopping a session unless you're transferring large amounts of known plaintext data.

wolfSSL can create public or private keys.  Certificates are only public in the SSL domain.  And more than the public key is needed to create/sign a public certificate.  All of the common name elements and days valid are needed in addition at the minimum.  Maybe wolfSSL will add a cert ready for signing type structure that isn't x.509 request standard, that's a lot of ASN.1/X.509 code that doesn't add much to our embedded SSL product.  I'll keep that in mind.

97

(0 replies, posted in yaSSL (Deprecated) [READ ONLY])

Welcome to the yaSSL forums.  Any questions, comments, feature requests, or any other posts having to do with yaSSL go here.