Skip to content

Commit

Permalink
[XrdCl] Fix: make sure signature is not reused for subsequent request.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichal committed Oct 26, 2016
1 parent 4747529 commit 97f899a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/XrdCl/XrdClAsyncSocketHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ namespace XrdCl
//------------------------------------------------------------------------
// Secure the message if necessary
//------------------------------------------------------------------------
delete pSignature; pSignature = 0;
XRootDStatus st = GetSignature( pOutgoing, pSignature );
if( !st.IsOK() )
{
Expand Down Expand Up @@ -521,7 +522,7 @@ namespace XrdCl
//----------------------------------------------------------------------------
// Write the message and its signature
//----------------------------------------------------------------------------
Status AsyncSocketHandler::WriteSignedMessage( Message *toWrite, Message *sign )
Status AsyncSocketHandler::WriteSignedMessage( Message *toWrite, Message *&sign )
{
if( !sign ) return WriteCurrentMessage( toWrite );

Expand Down
2 changes: 1 addition & 1 deletion src/XrdCl/XrdClAsyncSocketHandler.hh
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ namespace XrdCl
//------------------------------------------------------------------------
// Write the message and its signature
//------------------------------------------------------------------------
Status WriteSignedMessage( Message *toWrite, Message *sign );
Status WriteSignedMessage( Message *toWrite, Message *&sign );

//------------------------------------------------------------------------
// Got a read readiness event
Expand Down
9 changes: 0 additions & 9 deletions src/XrdCl/XrdClXRootDTransport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1206,15 +1206,6 @@ namespace XrdCl
if( pSecUnloadHandler->unloaded ) return Status( stError, errInvalidOp );

ClientRequest *thereq = reinterpret_cast<ClientRequest*>( toSign->GetBuffer() );
if( sign )
{
SecurityRequest *sec = reinterpret_cast<SecurityRequest*>( sign->GetBuffer() );
kXR_unt16 reqid = ntohs( thereq->header.requestid );
kXR_unt16 expid = ntohs( sec->sigver.expectrid );
if( expid == reqid ) return Status(); // it's the correct signature for the request
delete sign; sign = 0; // otherwise delete the signature
}

XRootDChannelInfo *info = 0;
channelData.Get( info );
if( !info ) return Status( stError, errInternal );
Expand Down

0 comments on commit 97f899a

Please sign in to comment.