The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,839 other subscribers

Archive for the ‘Software Development’ Category

Some notes on OpenSSL, S/MIME, email, various RFC standards and their relations.

Posted by jpluimers on 2015/03/10

Stuff I found out myself:

Some links I found useful: Read the rest of this entry »

Posted in Delphi, Development, OpenSSL, Power User, Security, Software Development | 3 Comments »

Some GIT notes

Posted by jpluimers on 2015/03/09

Some links I found useful:

Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »

Brutal way to prevent memory errors in Delphi XE7: rename DLLs, loose part of the functionality, but less memory issues – via G+

Posted by jpluimers on 2015/03/05

When the suggestions from Out-of-Memory in RAD XE7 and -noparser from Tried to patch BDS.exe fails to, then this suggestion by Brian Hamilton on G+ might work:

From a post in the EMB forum, a work around for XE7 is

I follow the hint of Thomas Grusche renaming the following files:

  • Borland.Studio.Delphi.dll
  • Borland.Studio.Refactoring.dll
  • refactoride210.bpl

This makes the XE7 IDE usable again.

Just the refactoring feature aren’t available anymore.

Read the rest of this entry »

Posted in Delphi, Delphi XE6, Delphi XE7, Development, QC, Software Development | 6 Comments »

OpenSSL on Windows: fixing the “unable to write ‘random state'” (via: Stack Overflow)

Posted by jpluimers on 2015/03/05

If you are running OpenSSL as a regular user, or cannot perform “RunAs Administrator”, and you get this error message:

unable to write 'random state'

then make sure you have set your environment variables correctly before running OpenSSL:

RANDFILE=%LOCALAPPDATA%\.rnd

A full batch file front-end for OpenSSL.exe is this one:

Read the rest of this entry »

Posted in Batch-Files, Development, OpenSSL, Power User, Scripting, Security, Software Development, Windows | Leave a Comment »

Visual Studio: Find unused code? – Stack Overflow

Posted by jpluimers on 2015/03/04

Interesting answers to Visual Studio: Find unused code? – Stack Overflow.

  • Using Visual Studio 2008+ to remove unused using statements
  • Using the [Obsolete] attribute of code you suspect is not used.
  • Using ReSharper
  • Using NDepend
  • Using FxCop

–jeroen

Posted in .NET, Development, Software Development, Visual Studio 11, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | Leave a Comment »

Delphi anonymous method formatting thread going into the direction of functional programming – via: Markus Joos – Google+

Posted by jpluimers on 2015/03/03

Markus Joos started a nice G+ thread on anonymous method formatting which ended up into a discussion of functional programming and a peek into what Spring4D 1.3 can offer.

Note you might need to be part of the G+ Delphi Developers Community to read the thread.

–jeroen

Posted in Delphi, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Software Development, Spring4D | Leave a Comment »

RAD Studio 2015 Roadmap – Blogs

Posted by jpluimers on 2015/03/03

Odd that the RAD Studio 2015 Roadmap on the Embarcadero site got published by Brian Alexakis which is relatively unknown in the Delphi community.

I wish that ARC for Windows and Linux x86/x64 were on the list: the first since it makes it so much easier to solve ARC problems in libraries, the second since Kylix had a Linux x86 compiler and an RTL (yes, Kylix didn’t have Unicode nor Generics, but maybe the Linux and OS X targets might be too far apart).

I like that there is a roadmap for 2015. And glad with what is on it: 4K support (hopefully also done for the IDE), C++ LLVM compiler, IDE large memory (though I wonder how they do that), native HTTP (hopefully WinHTTP for SOAP and REST).

In the mean time, Kris Houser has indicated XE8 is in beta. Which is good know as well.

–jeroen

via: RAD Studio 2015 Roadmap

Posted in Delphi, Delphi XE8, Development, Software Development | 4 Comments »

Some links to version control system popularity articles and graphs (GIT, HG, SVN, etc)

Posted by jpluimers on 2015/03/02

So I won’t forget:

–jeroen

Posted in CVS, Development, DVCS - Distributed Version Control, git, Mercurial/Hg, Software Development, Source Code Management, Subversion/SVN, TFS (Team Foundation System) | Leave a Comment »

Some command-line tips for OpenSSL and file format (pfx, p12, cer, crt, key, etc.) conversion of certificates, keys

Posted by jpluimers on 2015/02/27

OpenSSL is really nice, but remembering all these command-line switches is difficult, especially when you do not use them often enough.

I don’t, and when I do there are a few common tasks I perform, and I was glad to find a few links with great information:

I’ve converted them to batch files that run fine when copied to the directory where you put the x86 or x64 Windows version of OpenSSL (they assume %~dp0openssl.exe for the location of the OpenSSL.exe binary, just in case it is not on the path, or you have various tools that scattered around incompatible copies of OpenSSL binaries).

OpenSSL defaults to PEM format (that has text base64 strings), so if you get DER format (binary) you need to convert them.

A few errors I got and what they mean

Error decrypting PKCS#7 structure

Error decrypting PKCS#7 structure
5216:error:21070073:PKCS7 routines:PKCS7_dataDecode:no recipient matches certificate:.\crypto\pkcs7\pk7_doit.c:538:
5216:error:21072077:PKCS7 routines:PKCS7_decrypt:decrypt error:.\crypto\pkcs7\pk7_smime.c:557:

This error means that the recipient of the email does not match the certificate you pass in. What happens is that OpenSSL tries to decrypt the mail, it cannot match the certificate to the mail, and barfs. It usually happens when you have From/To reversed by accident.

Error decrypting PKCS#7 structure

Error decrypting PKCS#7 structure
4948:error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch:.\crypto\x509\x509_cmp.c:330:
4948:error:2107207F:PKCS7 routines:PKCS7_decrypt:private key does not match certificate:.\crypto\pkcs7\pk7_smime.c:552:

This means somewhere you mixed up a private and public key in the certificate files.

Use something like the OpenSSL wrapper verify-private-key-matches-certificate-x509-pem-cer.bat to verify them.

Error reading S/MIME message

Error reading S/MIME message
6900:error:0D06B08E:asn1 encoding routines:ASN1_D2I_READ_BIO:not enough data:.\crypto\asn1\a_d2i_fp.c:251:
6900:error:0D0D106E:asn1 encoding routines:B64_READ_ASN1:decode error:.\crypto\asn1\asn_mime.c:193:
6900:error:0D0D40CB:asn1 encoding routines:SMIME_read_ASN1:asn1 parse error:.\crypto\asn1\asn_mime.c:528:

OpenSSL does not like .EML files to end with a period (. which SMTP needs to process when sending an .EML file).
See https://gist.github.com/anonymous/7233372 and https://gist.github.com/anonymous/7233329
The former throws this error, the latter not. This is not caused the width of the base64 encoding (not yet archived at the WayBack machine), which I initially thought, but the terminating period.

Verification failure

Verification failure
8228:error:21075075:PKCS7 routines:PKCS7_verify:certificate verify error:.\crypto\pkcs7\pk7_smime.c:342:Verify error:self signed certificate in certificate chai
n

–jeroen

Posted in base64, Development, Encoding, MIME, OpenSSL, Power User, Security, Software Development, Windows, Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | Leave a Comment »

Fake/Mock SMTP servers and services for use during development

Posted by jpluimers on 2015/02/26

When developing mail sending software, you don’t want all your test mails to proliferate in the world.

Luckily there are some SMTP servers and services that allow incoming mail, but don’t forward them:

I got two of them from the interesting Stack Overflow question How to Debug/Monitor SMTP Communications? and later I also found about development smtp server for windows.

Note that I also like smtp-cli that Tripp Lilley suggested in his answer: though not a server, it is a nice command-line tool for testing SMTP servers (for instance to see if you got the above servers/services configured right on your client side, or if you have configured your own SMTP server correctly).

The cross platform monitoring tools tcpdump and wireshark (formerly etherreal) are great tools, they are usually way too deep for most of the SMTP problems I encountered. But when the going gets tough they are invaluable, especially Wireshark as it has a great feature Following TCP streams.

I wish there were similar servers and services for POP3, that would have helped a lot with a Delphi Indy project I developed a while ago (:

–jeroen

Posted in Communications Development, Delphi, Development, Internet protocol suite, SMTP, Software Development | 6 Comments »