Re: Concerns with use of security enhanced stringfunctions

"Rony Shapiro" <[email protected]> Tue, 27 Feb 2007 09:06:01 +0200
Newsgroups gmane.comp.security.passwordsafe.devel
Message-ID <022e01c75a3d$bedce140$0100640a@Lydia>
 Hi,

Using the _s versions of library functions seems to me a Good Thing, not so
much because they're inherenly more secure (in the  PasswordSafe's threat
model, buffer overflows, say, in strcpy, aren't really a vulnerability so
much as a bug) - rather, they help eliminate classes of bugs by changing the
interface.

Therefore, I think they should be used where possible. It would be nice to
have some wrappers around them, though, to eliminate the #ifdefs sprinkled
throughout the code...

   Cheers,

          Rony

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
Steffen Ryll
Sent: Friday, February 23, 2007 12:17 AM
To: [email protected]
Subject: [Passwordsafe-devel] Concerns with use of security enhanced
stringfunctions

Hi,

recently I decided to dedicate myself to helping with porting pwsafe to
PocketPC.
So far, I managed to configure the build environment correctly (at least
I hope it is) for PocketPC compilation. The trouble is now, that only in
the corelib project 244 compile errors are raised, much of them
referring to security enhanced string functions introduced with CRT 8.0/
VS2005 (e.g. _stprintf_s is used instead of _stprintf earlier).
Though these function calls are in #ifdef blocks testing for VS2005 or
newer, this doesn't seem to be good enough. I suppose, these new
functions are available only in the native Win32 C library, not in the
PocketPC versions.

Additionally, there seem to be backwards compatibility issues with some
of these functions. According to, for instance
http://msdn2.microsoft.com/en-us/library/ce3zzk1k(VS.80).aspx ,
_stprintf_s is identical to swprintf_s, but this is not supported by Win9x.

Thus, I want to raise the question, whether it is a good idea to make
use of these security enhanced functions, in our opinion.
I can see two possible solutions for that:

1. Leave these new functions aside and stick to ANSI C string operations.

2. Use the new functions where ever possible. To improve code then, the
differentiation between old and new functions should be encapsulated in
one class. On the other hand, this wouldn't solve backwards
compatibility issues.

I'm personally more in favour of the first approach, because it makes
porting to other platforms and OSs easier.


One point concerning the port the PocketPC: Don't expect so much
progress soon, as I'm not so much familiar with C++ and with pwsafe's
source code. This forces to read a lot first :-)
However, I'm planning to post a few questions and ideas soon, continuing
the discussion Robert Altmann kicked off last year. But I'm not ready
with these yet.


Any comments?

Cheers,

Steffen

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Passwordsafe-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/passwordsafe-devel


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV