1

(6 replies, posted in wolfSSL)

I found the reason..
It was quite odd.
the server key was changed after calling wc_AesSetKey or wc_AesCbcDecrypt function.
So I just mem copied the server key to store it  before calling those functions, and restored after calling them.
Then it worked fine.
I could use openssl s_client to show my webpage..
Maybe it is a bug or my system is faulty.
Were you able to reproduce the bug I described?

With some more research, I found that those functions are making some overflow on Aes struct.
wc_AesCbcDecrypt(&aes, --> I think this function write 4 more byte of 0s after aes structure.
I added some array to give some space for overflow after the Aes struct.
Aes aes;
char c[32];
like this.
Then encoding and decoding was fine. Both openssl, wolfssl client program worked fine.
Is this my special case or is this bug in wolfssl?
I wonder ..
And why there is no more reply?...
I wonder..

2

(6 replies, posted in wolfSSL)

I sent email like below but there is no answer..
I don't think I can trust email. Can you just post here?
Or google hangout(talk) will be fine.

Sent email :
I am sorry, but I don't have a phone and am traveling right now.
I don't think any hostel will allow lengthy international phone call.
How about using IRC or chat at PM 5:00 UTC-3.
I can use google talk my id is zezeon1@gmail.com
I will be waiting..

3

(6 replies, posted in wolfSSL)

How much will it cost to consult a debugging?
I do not want to remove all the bugs, I just want to remove one bug.
Not even solution, but I just want to know the reason of the bug.
It will not be a hard problem for you.

I am working on a tls project and having some difficulties.
I asked a lot here, and had much help from you.
I tried for some time and concluded to consult you if the cost is not too much.

Github page of my project is https://github.com/ParkSeungwon/http2.
You should use the tls branch not the master branch.

you should install these libraries.
mysqlcppconn, jsoncpp, gmp(gnu multiprecision library), gmpxx(gmp for c++), catch2

On a linux machine, you can compile my project just by using make command on a root directory.
Just delete incltouch line in the root Makefile.

When compile is done, run ./https.x.(a tls server program) and run openssl s_client.
Then openssl will send bad record mac(20) alert.(after server finished message)
I want to know why this is happening.
I think you need to see tls.h, tls.cc, https.h and https.cc in tls directory.
Especially encode function of tls/tls.cc.

My program works fine with my own client. tls-cl.x. But not with openssl or wolfssl.
I post two pics to help you understand my problem.
First picture shows my https.x receiving bad record mac from openssl s_client.
But in server side the mac is verified well as you can see.
It decrypted the alert message well and MAC was also verified.
But client side, it says bad record mac..

The second picture shows that error is occured during decryption.
This is wolfssl example client. I added some logging lines to debug my program.
But all I added was just printf syntaxes.
From upper picture I could see that finished message content is well generated.(prf result 12)
I could verify it with prf result of my server.
Also hmac key was fine. But the hmac jumped some other lines I don't know about.
Because Hmac_update is not called. I added logging lines to every functions in hmac.c.

How can I compile wolfssl source with -g debugging option? (linux)
I looked at the Makefile.
It was 5000 lines and there was no FLAG definition.
I don't know where to look at and where to touch.
And when I run command 'gdb client'(client in the example directory) , it says file format not recognized.
But still I can run the program in the command line but not in gdb.

5

(5 replies, posted in wolfSSL)

resuming....

Though I got an answer about this sequence number.
https://crypto.stackexchange.com/questi … -generated
Is this right?

I have another question.
https://stackoverflow.com/questions/525 … ke-message
This is about encrypted handshake message.

Yes, I am currently thinking about cousulting formally.
But I will try by myself for some more time because I am now travelling.

Thanks for making such a good functioned, well documented and easy to understand library.
And making it a GPL license.
My framework is also GPL. It maybe clumsy and simple. I think it has good ideas.
If you have time, please visit my github site http2-tls branch.
If you are willing to see my program and find out what's wrong it will be a great honor to me.
It wouldn't take long for a specialists like wolfssl programmers.

6

(5 replies, posted in wolfSSL)

I didn't see this message for a long time.
Apology for late answer.
I made some C++ web development framework with state.
From my point of view, it is quite easy to develop a new site with my framework.(https://github.com/ParkSeungwon/http2)-branch tls
It handles connections in its own way to give programmers an environment with state.(web services are basically stateless)
So I decided to make a simple tls library that is decoupled from file descriptor and only deals with memory structure upon wolfssl crypto base.
I currently finished making normal http middle server.
But it lacks tls function.

So I tried some tls libraries and thought wolfssl was best.
I didn't know at that time that these will be such a long journey.
If I knew that these informations are so scattered and RFC document are so maze-like and abstract, I would not have decided that way.
It took 10 times more time to collect standard info than to code.
I made my own version of server and client program easily, but making a program that can communicate with real world site or browser was so time consuming.

I also posted questions to other sites like stack overflow.
But usually there is no answer. I think these informations are over normal programmers.
So I thought specialists like wolfssl could help me.

7

(5 replies, posted in wolfSSL)

Thanks for attention.
I am using wolfssl library as crypt base.
And implementing basic TLS library of my own.
Is this a delicate infomation?
I thought it was an open infomation.
It is very hard to find well described document.
Even RFC5246 does not say a thing about this and some other details.
Could you kindly explain how to count the sequence number?

8

(5 replies, posted in wolfSSL)

In the other ciphers supported by TLS 1.2, namely stream cipher and CBC block cipher mode, the sequence number is implicitly in the MAC (RFC5246, 6.2.3.1):

MAC = HMAC(MAC_write_key, seq_num +
                          TLSCompressed.type +
                          TLSCompressed.version +
                          TLSCompressed.length +
                          TLSCompressed.fragment);

How many bytes are seq_num? and how to count it? And is IV included in fragment?
I think fragment = IV + message.(padding is not included) if not compressed.

Thank you very much.
It did work.
Thank you again.
May I ask some general informations about TLS here?

I mean the server example that comes with source code. Not the echoserver, but the root/examples/server/server file.
I tried to use -l option.
It didn't work.
How can I set a cipher suite to use in server example.
I want to use DHE-RSA-AES-128-SHA.