Re: bouncycastle pskserver error

kiranmayi boyapati <[email protected]> Fri, 3 May 2019 20:31:29 +0530
Newsgroups gmane.comp.encryption.bouncy-castle.devel
Message-ID <CAGuVNbsLHAzC0Gt3Y39t5hg=gsuLpdqQmsvym08aouiQoiLb2g@mail.gmail.com>
Hi,

Yes we changed the PSK identities to match on both sides. When i run it in
debug mode, i figured out that in "TlsBlockCipher" class "useExplicitIV"
flag is becoming true which should be false for TLS1.2 as i understand.

If i change that parameter to false in the class and run the test, client
is successfully connecting to the server.

When i dive deep to understand under what conditions the flag will be true
- found that for TLS 1.1 it should be true, but i am using TLS 1.2 still it
is set to true.

Can some one help me to verify if my understanding is correct?

kiran

On Fri, May 3, 2019 at 5:02 PM Peter Dettman <[email protected]>
wrote:

> Presumably you need to modify the psk_identity/psk in PSKTlsClientTest
> to match the (only) configured PSK for MockPSKTlsServer (see the inner
> class MyIdentityManager in MockPSKTlsServer).
>
> PSKTlsClientTest changes (lines 38-39):
>
>         String psk_identity = "client";
>         byte[] psk = new byte[16];
>
> Regards,
> Pete Dettman
>
> On 3/5/19 4:29 pm, Sukawanth psr wrote:
> > I am trying to write PSKServer to use PSK ciphers in bouncycastle.
> >
> > Attached is the PSK server we wrote. And we are using
> > org.bouncycastle.tls.test.PSKTlsClientTest as client for testing.
> >
> > I see below error while tls handshake.
> >
> > I am using 1.6.1 version.
> >
> > org.bouncycastle.tls.TlsFatalAlert: bad_record_mac(20)
>
>