SSLEngine usage issue: handshake done, but unwrap returns 8 bytes from 32

Hello,
I'm trying to use SSLEngine API in order to secure Java/NIO based 3th party middle-ware platform. So far I've succeed with writing correct handshake code and on both server and client I get handshake successfully done, the problem starts when client sends server its message. It is 32 bytes long encrypted on the client side to 37 bytes. On the server side I see (while using -Djavax.net.debug=all) that during the SSLEngine.unwrap call the bytes are correctly decrypted into exact byte sequence as on the client side. However, the problem is that from SSLEngine.unwrap I get just 8 bytes instead of those 32. The debug messages looks:
[Raw read (bb)]: length = 37
0000: 17 03 01 00 20 56 68 6E 1F 56 C1 41 6E CD C0 A4 .... Vhn.V.An...
0010: F0 84 6A E9 C8 4F A9 AE 29 AF 87 D9 EA 61 09 15 ..j..O..)....a..
0020: EC 08 28 1E 60 ..(.`
Padded plaintext after DECRYPTION: len = 32
0000: 02 00 01 00 03 63 64 6F E3 06 78 5A D6 9C D4 D0 .....cdo..xZ....
0010: 68 B1 F7 B1 7F 34 88 AC 36 1C 7A 72 03 03 03 03 h....4..6.zr....
*** SERVER: peerNetBuf after unwrap: java.nio.HeapByteBuffer[pos=37 lim=37 cap=16665]
*** SERVER: res: Status = OK HandshakeStatus = NOT_HANDSHAKING
bytesConsumed = 37 bytesProduced = 8
Messages starting with *** SERVER are of my application. Everything other is emitted by Java while using -Djavax.net.debug=all. As you can see all data from peerNetBuf which is a buffer holding encrypted data got from network, so all those data are consumed well -- so I don't need to call unwrap second time like it sometimes happen during the handshake phase...
Now, my question is: how to convince SSLEngine.unwrap to correctly return me all those 32 bytes which I expect?
Thanks,
Karel

You will have to post some code. The SSLEngine tells you what it wants you to do next, all you really have to do is keep doing that: wrap, unwrap when needed, or write on an overflow and read on an underflow. Was there enough room in your app buffer for all 32 bytes? And what was the final result status?

Similar Messages

  • When I am in e-mail. I get the spinning color wheel. Then, when I check the activity montior, it notes high cpu usage (99%) for "Safari web content.". then I quit this process and cpu usage drops way done. but I have to log in again to my e-mail. what can

    When I am in e-mail, I sometimes get the spinning color wheel, which lock up everything. when it doesn't go away, I see on the activity monitor, that CPU usage is very high (99%), for a process calles " Safari web content'. When I click on the proccess and quite, the CPUusage goes way down. Problem is that I have to then log back in to e-mail. What can I do to eliminate this proble.  thanks

    How much FREE RAM do you have when this occurs. It's easy to tell, when it beach balls open Activity Monitor (Applications - Utilities - Activity Monitor) click the System Memory tab and note how much FREE RAM is listed. If it's 500MB or less it's time for a RAM upgrade.

  • I don't know exactly when this started, but Winamp became my default search and homepage.. The homepage issue was easy, but the search issue is bigger than I expected. It ALWAYS uses Winamp (Powered by AOL) as my default search. Please help. Thank you.

    I don't know exactly when this started, but Winamp became my default search and homepage.. The homepage issue was easy, but the search issue is bigger than I expected. It ALWAYS uses Winamp (Powered by AOL) as my default search. Please help. Thank you.

    reinstall it but make sure to uncheck the box next to "make winamp my default search engine"
    attached is screenshot from the part of installation proces where that checbox should be unchecked
    hope this helps

  • Athough there is not much usages in the CPU , but the Fan runs really hard and loud , and i've ready try to reset the SMC ! i don't know what to do !

    Athough there is not much usages in the CPU , but the Fan runs really hard and loud , and i've ready try to reset the SMC ! i don't know what to do and i'm very worried.

    Nguyen Phuc wrote:
    Athough there is not much usages in the CPU , but the Fan runs really hard and loud , and i've ready try to reset the SMC ! i don't know what to do and i'm very worried.
    I suspect you didn't reset it right.
    Turn off the machine, let it charge up and then try the SMC reset again.
    https://support.apple.com/kb/HT3964
    Run a Hardware Test
    https://support.apple.com/kb/ht1509

  • Service Call in SBO 2005 B PL 38 - Activity done but not added to call

    Hi All,
    I have updated PL 38, SBO 2005 B, I had created Service call, it was created successfully, now i have done activity of return but it dosent add to activity tab and gives us error -> "Generate SCActivity : A Service Call Activity dose not exist"
    Can any one has idea or solution of this please.
    With Warm Regards
    Chintesh Soni

    Hi
    I am not sure note :891809 is suitable for your issue or not.
    this note is about "The Activity exists but it seems that there is no link saved between
    Service Call and Activity."
    hope it could be helpful.

  • TS3623 Pressing play on purchased downloads and it starts to download  but then returns to the play button. This is for all the purchased items I have. However pressing play on previews works. Please advise.

    Pressing play on purchased downloads and it starts to download  but then returns to the play button. This is for all the purchased items I have. However pressing play on previews works. Please advise.

    Welcome to the Apple community.
    A number of people have reported similar issues recently, many appear to have found a discrepancy of some kind in their account settings and making changes to these settings or simply resetting them has resolved the matter.
    Check your account details are correct, check that you are using the correct details for Location, Region and Time Zone. You may want to change these settings and then change them back to see if that helps.
    Also check your payment details, make sure your details are exactly how they appear on your credit card statement, you might also try changing some of those details, saving them and changing them back again.
    You might also try logging out of and then back into your iTunes account (Settings > iTunes Store > Apple ID’s > Sign Out) and restarting your router. (Some have reported that after doing this, they need to check for rentals even though it may report that there aren’t any, after which rentals once again appear in the ‘movies’ feature)
    Rentals should appear under their own heading in the ‘Movies’ feature, you might also check at Settings > iTunes Store > Check For Rentals.
    At this point in time, I’m wondering if this could be related to (but not restricted to) the new feature that allows others to come into your home and use your Apple TV to download and play their content on your Apple TV without logging into their account on your Apple TV. The Terms of Use for iTunes Store content have always been to require you to only purchase and play the content from the store in the location where you live and to use a credit card registered in that location. Previously Apple seem to have been somewhat lenient on enforcing such restrictions, perhaps now they are not. However I don’t really have any evidence to support this suggestion, except that changes made to accounts in these areas do appear to be helping many.
    If you are successful in resolving your problem, perhaps you would let us know exactly which action resolved the problem for you. If you are having this problem to begin with, can you also tell us your location.

  • Since latest update to airport extreme im getting 10 unknown base station and time capsule items showing in airport utility as a network.  when able to "forget" them they initially drop off but soon return. how do i get them deleted and stay that way

    since latest update to airport extreme im getting 10 unknown base stations and time caps showing up as though they are a part of my network. sometimes i can "forget" them and they will disappear initially but soon return. i need and want only my connection inside my home . any ideas. i have done a factory reset and set up a new network but they continue to show up.

    I'm not convinced that the problem lies in Airport Utility. This same thing was happening to me, nearly exactly as you describe it. The thing is that with me, the problems clearly started when I updated the firmware in my Airport Express (n). That's when all the wacky stuff started happening. Sometimes it would show up in AU, sometimes it didn't and even if it didn't, I could still access the internet through it.
    But as you said, the problems got really bad when another Express (b/g) was put on the network with it. Even when it did work, the (b/g) would make it impossibly slow.
    You know more about this than me, and clearly have more patience if you've restarted the network fifty times. I gave up at about ten.
    In any case, your solution is more of a work around and if you're still having that slow connection problem, I'm not sure you've got it. But thanks for your reporting of this. At least I know I'm not crazy.

  • I Have a Mac 10.9.5 I have Photoshop CS 5.. Also have Photoshop CC. As of last month was able to edit any image with either program,as of today I can't edit images in either program. I can't see and editing I've done ,but when close the image both program

    I Have a Mac 10.9.5 I have Photoshop CS 5.. Also have Photoshop CC. As of last month was able to edit any image with either program,as of today I can't edit images in either program. I can't see and editing I've done ,but when close the image both program ask (do you want to save changes) I look at the image I don't see any changes to save. Please help Thanks for time in advance

    Please describe the steps involved in the issue exactly (with screenshots maybe).
    What have you done for trouble-shooting so far?
    http://blogs.adobe.com/crawlspace/2012/07/photoshop-basic-troubleshooting-steps-to-fix-mos t-issues.html

  • When I open my camera app, the camera doesn't open. I got told to restore my iPhone and I have done but it still doesn't work? What should I do?

    When I open my camera app it doesn't seem to open the actual camera. I went into an apple store and got told to restore it so I have done but it still doesn't open. What should I so about it?

    When you restored, did you restore as a "new" device or from backup? If you restored as new, and still have the same issue, you most likely have a hardware problem. Go back to the Apple store to confirm.

  • Adobe took early termination penalty   $ 764.30 from my account 10days ago insisting staff mistake but never returned  $ 764.30 back. I have chatted with two staffs for this and all I got was "please wait with patient"... 10 days already have passed since

    This is totally insane!! They took someone's money in a sec by 'MISTAKE' but haven't returned after 10days.
    I already have chatted with two staffs about this but different from what they promised, this still has not solved yet!
    My devoted time for this was totally wasted and I am still in suffering.
    I think this is theft!!!  What shall I do more?!

    I am really sorry to bring this issue to the forum but had no choice. Like I mentioned above, I already have contacted them but never returned me back. Sick of chatting with those staffs who act like answering machine and wasting my time because of their mistake. After I finally decided to post this last night, then they called me this morning that I have to wait 5days more.
    Sorry again, and thanks for your reply.
    J

  • I connect my iphone4-32gb with itunes via pc(windows pc-vista) sync. was done.but one message apper this message tell wifi disk crash.

    i connect my iphone4-32gb with itunes via pc(windows pc-vista) sync. was done.but one message apper this message tell wifi disk crash,i don't know about this error also iam not use wifi,how its come error.

    Hey joshuafromisr,
    If you resintall iTunes, it should fix the issue. The following document will go over how to remove iTunes fully and then reinstall. Depending on what version of Windows you're running you'll either follow the directions here:
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    http://support.apple.com/kb/HT1925
    or here:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/HT1923
    Best,
    David

  • Generate DELVRY  Idoc when Post goods issue is done in SAP

    I need to generate an Idoc when post goods issue is done in SAP (outbound to SAP) .I understood that I can do this using the message control .The message type DESADV with the process code DELV will support this.
    But I didn’t understand how to trigger the Idoc.In the current scenario our Company is doing the post goods issue in SAP for the in three different ways.
    1.Manually doing the post goods issue through the transaction VL02N
    2. an Inbound Interface (using Idoc)  which will do Post goods Issue in SAP
    3.Another Interface using BAPI, which will, do post goods issue in SAP
    I have to run my outbound interface when the post goods issue is done by all the above three ways.  Can any one help me out in this?

    You have to configure the output first .
    You can use output type LAVA ( avaialble in Std SAP ) .
    ( Tcode is NACE , Select Application V2 -> Outputtypes ).
    ( Create condition records suitable to generate an output)
    Next is ALE.
    Setup a distribution Model ( for DESADV ) and all other setup for ALE i.e. Distribute Dist. Model / Generate Partner Profile .
    In the Partner profile in WE20 select your partner system. Double CLick on Outbound Message DESADV ( this wd be there after you generate partner profile , if not add it here in outbound ) . On this screen goto tab MESSAGE CONTROL .
    Application - V2
    Message Type - LAVA
    Process Code - DELV.
    Now you are ready to go. The moment a PGI is done in any form an output LAVA would be proposed and processed using process code DELV.
    Cheers.

  • We've just bought 2 iPads and seen our home internet usage nearly treble! (But our browsing habits haven't changed) Coincidence or unrelated? Any help gratefully received

    We've just bought 2 iPads and seen our home internet usage nearly treble! (But our browsing habits haven't changed) Coincidence or unrelated? Any help gratefully received

    "Our browsing habits haven't changed" - with all due respect, unless you have kept a diary or other record of specific internet activity, you have no way of knowing that. And you make no mention of what was used prior to the iPads to do this, so it would be difficult to make any kind of comparison.
    Not only the browsers, but any number of apps on the iPads also access the internet.
    You might want to check location services, and potentially turn it off for any apps that really don't need it. Likewise check you mail set up and reduce reliance on Push (I have mine set to strictly manual, but more to reduce interruptions than reducing internet usage)

  • I want to resolve the payment issue still pending .But I do not understand what issue remains to be resolved by me ? Unless I know the details of it how shall I resolve it

    I want to resolve the payment issue still pending .But I don't know what issue remains to be resolved by me? Unless I know the details of the issue how shall I resolve it

    Apple is not here. Apple does not answer questions here. This is a user to user tech support forum, no ne here would have any knowledge of your personal account details or a financial dispute that you may have with Apple.
    Mac App Store Support -
    http://www.apple.com/support/mac/app-store/
    iTunes Support -
    http://www.apple.com/support/itunes/

  • G550 Laptop Horizontal Lines - Known Issue - On my 2nd After Returning First - Not Feeling Confident

    I recently purchased a G550 model laptop -- This laptop has everything I would want in this price range and was pleased to have found it on sale and after a test drive left Fry's Electronics with a smile. When I was walking out, I saw a man bringing back in the same model for a return - I tried my best to ignore that and think positive.
    The 2nd day I used it I began to see intermittent white horizontal flicker lines -- sometimes across the majority of screen, always from right to left and then in the very top portion of the screen. It then evolved into a line of white small dashes in the middle of the very top of the screen. Searching the internet, I found many many posts and videos with exactly the same problem or very similar on this same model and others from Lenovo.
    I took the time to capture the line flickers with my video camera and decided to return it as it was only used briefly in the 5 days I had it in use. Since the lines were intermittent/random in their appearance times - I had a hard time verifying the defect - luckily the videos and the store manager helped me and offered me a new G550 and extended the return time as if I had bought it on return date (as he should). The man at the return desk actually said "You know you are buying one of our cheaper laptops in the whole store - so what do you expect?" - This was not what I or anybody should hear. If I am spending 300.00 on electronics - it should work as described. I bit my tongue and did not reply as it would not have been a polite response from me.
    So now I am running the new G550 that they replaced it with -- funny as certain software is on this one like the Lenovo support software that was NOT on my original purchased laptop.
    At the moment, I have app. 10 days left to get a full refund if this machine starts to do the "screen line flickers". However, I am feeling very UNCONFIDENT as I read more and more about this known issue.
    Yes, I know the warranty covers this scenario for one year - but nobody wants to ship their laptop back to the manafacturer and wait for repair and or replacement parts.
    Is there any known "fixes" for this that will not involve voiding my warranty? --- I understand it is a hardware issue and am watching for the flickers to appear always. Last thing I need -- being on a very low set monthly income - is to lose my 15 day return window and have the flickers appear on day 20.
    Can anyone please offer any info/suggestions so that I am not "computing scared" the next 10 days before my return window at Fry's expires?
    Shouldnt be feeling nervous after buying new laptops. Other than this issue, I love the feel/size/keyboard and eevrything else on this G550. I dont want it to go bad on me --- but I simply cannot afford to have it turn defective on me 2 weeks from now.
    Thanks to all who have read this lengthy post. I would be most grateful to anyone who replies.
    Sincerely, FP

    hi FA,,
    You're issues might be similar to this article - G550 - red, blue, yellow lines appeared on screen.
    Sorry to hear about your trouble there at the store. AFAIK, flickering issues / vertical lines are commonly caused by either the LCD cable, lcd inverter, or the LCD itself. Not sure if it's a bad batch but kindly check the solutions that were provided on the article above to see what's the best course of action for the issue.
    For the warranty coverage, flickering issues are usually covered if it's caused by a faulty lcd part (the lcd cable,  inverter, or the lcd itself), I've seen this happen on my laptop (which is a different brand) and the problem lies with the LCD cable. I recommend you contact lenovo for more info on how to go about having the computer serviced under warranty.
    Best regards,
    neokenchi
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

Maybe you are looking for

  • Display drivers crash when calling

    Hello, recently i built a new gaming rig and had installed skype within a few days.  Problem is, whenever i start a call or receive one from another person, my display drivers crash.  At times it recovers, but sometimes it doesnt at all and requires

  • Best word processing app for i-mac?

    As a 'newie' to the wonderful world of i-mac's can anyone recommend a good word processing app. Currently going round and round in circles trying to find one thats compatible with i-mac. Don't want to go down the Microsoft word option due to compatab

  • I am trying to transfer my songs from my old computer to new one by usb drive how do i do it

    how do you import songs from a usb drive to itunes

  • SendAndLoad fails even though it is permitted (very weird)

    Hi! I have to deal with a very weird XML.sendAndLoad error. Maybe some of you guys know an answer! I implemented an AJAX adapter in Flash to allow crossdomain AJAX interaction - and it works fine in general! Except it is loaded from one special serve

  • Getting my network connection up

    ok so i need to install the madwifi driver in order to get my network connection up but the thing is i don't have a network connection to paco -A madwifi-blahblah so how do I go about installing the driver? I do have access to the net from another co