Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Bad Record Mac
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Roy Donaldson  
View profile  
 More options Dec 19 2008, 3:27 pm
Newsgroups: mozilla.dev.security
From: "Roy Donaldson" <makae...@gmail.com>
Date: Fri, 19 Dec 2008 15:27:59 -0500
Local: Fri, Dec 19 2008 3:27 pm
Subject: Bad Record Mac
I'm trying to create a FIPS 140-2 compliant SSL connection using the Sun
JSSE (SunPKCS11) and NSS.  I set up the CA DB and Server DB as per the
instructions on this page:

http://www.mozilla.org/projects/security/pki/nss/ref/ssl/gtstd.html

In my code, I'm able to create a keystore that can pull my certificate (for
127.0.0.1) from the NSS db and display it's information. However, when I try
to connect a client socket and a server socket, I receive this exception:

javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:136)
    at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:165 7)
    at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:93 2)
    at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocke tImpl.java:1096)
    at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.jav a:1123)
    at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.jav a:1107)
...

javax.net.ssl.SSLHandshakeException: bad handshake record MAC
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
    at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1591)
    at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1549)
    at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:84 7)
    at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocke tImpl.java:1096)
    at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.jav a:744)
    at
com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
    at java.io.InputStreamReader.read(InputStreamReader.java:167)
    at java.io.BufferedReader.fill(BufferedReader.java:136)
    at java.io.BufferedReader.readLine(BufferedReader.java:299)
    at java.io.LineNumberReader.readLine(LineNumberReader.java:182)
...

I'm not sure what "Bad Record MAC" means, or how to go about fixing it. I
thought that perhaps it was a hint that my certificate was corrupt, but
running

certutil -V -d server_db -u V -n 127.0.0.1

shows that the certificate is valid. Does anyone have any suggestions on
where to start looking? Is this a sign that I have NSS or certificates
configured incorrectly, or should I be talking with the Sun gurus about my
implementation?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nelson Bolyard  
View profile  
 More options Dec 21 2008, 5:15 pm
Newsgroups: mozilla.dev.security, mozilla.dev.tech.crypto
Followup-To: mozilla.dev.tech.crypto
From: Nelson Bolyard <NOnelsonS...@NObolyardSPAM.me>
Date: Sun, 21 Dec 2008 14:15:40 -0800
Local: Sun, Dec 21 2008 5:15 pm
Subject: Re: Bad Record Mac
Roy Donaldson wrote, On 2008-12-19 12:27 PST:

> I'm trying to create a FIPS 140-2 compliant SSL connection using the Sun
> JSSE (SunPKCS11) and NSS.  

I suppose you mean a FIPS compliant TLS connection.  TLS is SSL version 3.1
(or newer).  FIPS 140 compliance requires the use of TLS.

Crypto questions are best asked in mozilla.dev.tech.crypto rather than
in mozilla.dev.security.  I have redirected followups to m.d.t.crypto.

It usually means that, at the end of the handshake, the client and the
server ended up with different keys, and the attempt to decrypt an encrypted
record received from the remote peer party produced a decrypted result that
is unintelligible.

> I thought that perhaps it was a hint that my certificate was corrupt,

No, there are different errors that occur when a cert is bad.
It might mean that your server is using the wrong private key,
not the one that corresponds to the public key in the cert.

> Does anyone have any suggestions on where to start looking? Is this a
> sign that I have NSS or certificates configured incorrectly, or should I
> be talking with the Sun gurus about my implementation?

Your message may get help from others in the mozilla.dev.tech.crypto
newsgroup (which is also the dev-tech-crypto AT lists.mozilla.org mailing
list).  Sun Java gurus who best know the internals of the class
com.sun.net.ssl.internal.ssl.SSLSocketImpl may be able to provide more help.

Are you sure that your client and server are actually using NSS's PKCS#11
module?  The exception stacks shown above provide no evidence that proves
or disproves that they do.  Still, a common problem is that the software
is not using the provider that the developer imagines it is using.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »