EldoS | Feel safer!

Software components for data protection, secure storage and transfer

GetMessageSource returns a NULL string

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
Posted: 05/21/2009 08:22:59
by David Perkins (Standard support level)
Joined: 12/03/2008
Posts: 17

I've created a simple server and client to explore MsgConnect. When my server receives a message, calling GetMessageSource from ValidateCredentials returns an empty string. I'm using this in BCB2006 after creating the relevant files in Delphi.

void __stdcall TnMsgConnectServer::ValidateCredentials(TObject *Sender,
PMCMessage Message, PMCMessageCredentials Credentials, bool &Valid)
{ // Transport thread context

String Source = m_pMCMessenger->GetMessageSource( *Message );


Any idea what could cause this to fail?
Posted: 05/21/2009 09:46:00
by David Perkins (Standard support level)
Joined: 12/03/2008
Posts: 17

GetMessageSource works in the Queue UnhandledMessage event, but not in ValidateCredentials. Is this by design, or because ValidateCredentials is called from the transport thread?
Posted: 05/21/2009 10:10:35
by Eugene Mayevski (EldoS Corp.)

I assume that you want to link the message source handle with credential validation. This won't work. The reason is simple: the value returned by GetMessageSource is valid and should be used ONLY for sending something as a separate message. It must not be used to determine actual sender address or to identify the sender in any other way. You must use other authentication means (pass some identifiers in message data, for example) if MessageCredentials is not enough.

Sincerely yours
Eugene Mayevski



Topic viewed 2915 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!