51

(2 replies, posted in wolfSSL)

That is already on my list of tasks for next week.

52

(12 replies, posted in wolfSSL)

And you are using commit 87eb3ad from the GitHub repository?

53

(12 replies, posted in wolfSSL)

Marco:

The peerWindowSz value is increased when the peer sends a Channel Window Adjust message. Which client are you using, it sounds to me like it is misbehaving.

--John

54

(2 replies, posted in wolfSSL)

Correct, you only need the root CA. The other intermediate signers should be in the certificate chain with the peer certificate.

For OCSP stapling, the client should be getting the OCSP response record, signed by the root CA (or its delegate), during the handshake. The OCSP response should be for the server's certificate. (And the response should be the same blob of data you would get if you requested the status directly from the OCSP service listed in the peer's certificate.)

55

(1 replies, posted in wolfSSL)

Which version of wolfSSL are you using? Have you captured the exchange with Wireshark?

56

(1 replies, posted in wolfSSL)

You'll need to supply a custom verify callback function. The verify callback is passed the error type and it gives you a chance to force a success or failure depending. See our API manual for the functions wolfSSL_set_verify() or wolfSSL_CTX_set_verify().

Which version of wolfSSL are you using?

58

(3 replies, posted in wolfSSL)

This was due to a misreading of RFC 6347 section 4.2.2. This has been recently fixed in our GitHub repository, commit 6d520e0.

wolfSSL as Server

What I meant is that the OpenSSL s_client processes the certificates, but doesn't fail the connect if the certificate isn't good. It is printing the result

Verify return code: 21 (unable to verify the first certificate)

but not erroring out. Our example code fails the connect() or accept().

It looks like the certificates in cert_test.h are not the same as the certificates in the certs directory. I get different behavior between using the code version of the server certificate and the one in the directory. I see errors in OpenSSL like you do when I use the array version. The file version verifies as OK. (Note, the array version of the CA certificate will verify the array version of the server certificate.)

I have logged an issue into our GitHub issue tracker for updating the certs_test.h file.


wolfSSL as Client

Do you have a Wireshark capture of this transaction? Also, which options are you configuring with? This might be related to the issue above, as well, with the incorrect certificates.

For the first case with the wolfSSL based server and OpenSSL s_client, this is exactly what I expect to happen. The OpenSSL client is telling you that it doesn't like the certificate the server gave it, but since it is a test client it continues with the connection. Note the verify errors:

depth=0 /C=US/ST=Montana/L=Bozeman/O=wolfSSL/OU=Support/CN=ww.wolfssl.com/emailAddress=info@wolfssl.com
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 /C=US/ST=Montana/L=Bozeman/O=wolfSSL/OU=Support/CN=ww.wolfssl.com/emailAddress=info@wolfssl.com
verify error:num=27:certificate not trusted
verify return:1
depth=0 /C=US/ST=Montana/L=Bozeman/O=wolfSSL/OU=Support/CN=ww.wolfssl.com/emailAddress=info@wolfssl.com
verify error:num=21:unable to verify the first certificate
verify return:1

As to the second case with the wolfSSL based client and OpenSSL s_server: According to Note 1 in our README file, "wolfSSL also no longer supports static key cipher suites with PSK, RSA, or ECDH." In your example, you are using the cipher suite AES128-SHA, which is a static RSA cipher suite. To get it to work you need to "#define WOLFSSL_STATIC_RSA" in your build.

1. It is calling AesGcmDecrypt_fips only when FIPS mode is enabled. We do not provide the implementation of any of the _fips() functions in the open source download.

2. You are encrypting 24 bytes of plaintext and storing the 24 bytes of cipher text into a 32 byte array and then are decrypting the 32 byte array. The first thing the decrypt function does is calculate and checks the authTag, which is failing with error -180.

Billy Bob:

In your callback for pcap_loop() are you accounting for the size of the ethernet header?

Our sniffer test code main function we have a variable called frame. It is normally set to 14, which is the size of the Ethernet frame header. (Or 4 if using a no-link interface.) The first thing that happens after receiving a packet from pcap_next() is the test adjusts the packet pointer past the ethernet frame header to the IP header (and adjusts the packet size accordingly) and then calls ssl_DecodePacket().

If the header isn't skipped, then the IP version number will be wrong as it is looking at part of the ethernet hardware address.

Are you using VLAN IDs?

Billy Bob:

It kind of looks like the filter isn't working on the PCAP loop. Since it is working with pcap_next(). The sniffer is assuming that the data passed to it starts with the IP frame, not with any link local headers.

Can I ask about your project? How are you using the sniffer?

--John

Which CA certificate are you using for Google? Make sure in your CA bolus you have the "Equifax Secure Certificate Authority" CA certificate.

As for 4096-bit RSA certificates, since I'm assuming you are using fast math, you need to "#define FP_MAX_BITS 8192" in wolfSSL. By default, the max bits setting is good for doing 2048-bit RSA keys.

66

(1 replies, posted in wolfSSL)

Deepti:

I see that you also sent in a message to support@wolfssl.com. My colleague is helping you via that message chain.

Commonly, when we see and error -188, it is because the correct CA certificate for the peer wasn't loaded. For example, you can't use our CA certificate that is included with USE_CERT_BUFFERS_2048 to contact Google's server. (And I've seen a couple different certificate chains from Google that required different CA certificates.)

You would need to create your own logging function. The easiest place to add this logging would be at the I/O callback. You can dump out the bytes as they are read or transmit from the socket.

You can also add the data dump for the send side in the function SendBuffered(). On the receive side, you could add the logging to the function ProcessReply() right below the statement "WOLFSSL_MSG("received record layer msg");" The input buffer would have the complete message at that point.

wolfSSL has two PRNG functions that can be selected at build time: ARC4 using the entropy source (GenerateSeed() function) to provide a key or a SHA-256 Hash_DRBG (described in NIST SP 900-80A) seeded with the entropy source. If you are using "configure" to set up your build, the Hash_DRBG is enabled by default. If you are building through Visual Studio, the ARC4 PRNG is used.

The entropy seed for either PRNG is obtained with the GenerateSeed() function. There are several GenerateSeed() example functions in file random.c, most of which can be used depending on your environment. On Linux or Mac OS X, "/dev/urandom" is read for the seeding. On Windows, the equivalent source is read. Some of the embedded processors have their own built in hardware entropy sources and we call their API. If we don't have an example that suits your needs you have to provide your own GenerateSeed(), and we can help with that.

For QNX you could set the flag "HAVE_HASHDRBG" and use the Linux-style GenerateSeed() reading from /dev/urandom.

I hope this helps.

69

(3 replies, posted in wolfSSL)

--enable-openssl also defines KEEP_PEER_CERT.

I'm glad to see that it is working for you now.

70

(3 replies, posted in wolfSSL)

First, the jabber.se certificate expired on May 1st.

Which version of wolfSSL embedded SSL are you using? I'm connecting with the latest commit from GitHub and the altName is not getting ignored. (By the way, add -g to your client command. It'll do an HTTP "GET /" message to the server.)

How are you configuring the library? There was an issue where the altNames were getting lost when you had KEEP_PEER_CERT enabled. (I believe the fix was released in version 3.4.8. It was commit 50e829e.)

71

(1 replies, posted in wolfSSL)

Are you using configure to set up your build first? Did you try:

./configure C_EXTRA_FLAGS=-DCYASSL_AES_DIRECT
make
./ctaocrypt/test/testctaocrypt

One other question, why are you using such an old copy of CyaSSL embedded SSL? v2.8.0 is from late 2013. I'd recommend upgrading to the current version of wolfSSL. (We changed the name of the library recently. Same code, different name.)

Sorry about the delay in responding. That's a good suggestion. Please see commit fe303c97 in our GitHub repository.

73

(36 replies, posted in wolfSSL)

I'm glad to see you found a work-around for the problem. I have a colleague looking into this right now as well. We will investigate a more permanent solution for this.

Thanks!

74

(36 replies, posted in wolfSSL)

On your platform, we're depending on the compiler to make the 64-bit data operations work using its 32-bit registers/math. I'm wondering if it is messing up. I made a little test application that did a couple rotations on my Mac.

#include "wolfssl/wolfcrypt/types.h"
#include "wolfcrypt/src/misc.c"
#include <stdio.h>

int main(void)
{
    word64 test;

    test = 1;
    printf("test = %lu\n", test);
    test = rotlFixed64(test, 33);
    printf("test = %lX\n", test);

    test = 1;
    printf("test = %lu\n", test);
    test = rotrFixed64(test, 5);
    printf("test = %lX\n", test);
}

The output was:

test = 1
test = 200000000
test = 1
test = 800000000000000

Can you try it out, or something like it, on your device?

ECDSA uses a random number as part of the signature process. If you call ecc_sign_hash() multiple times with the same data, you will get a different signature every time. But, all the signatures will verify correctly with ecc_verify_hash().  Do they provide the secret number in a PEM or DER wrapper?