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,854 other subscribers

Archive for the ‘Windows’ Category

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 »

Installing the PIXMA mini260 – Canon Europe drivers under Windows 8.1 x64 – trying to say goodbye to Windows XP

Posted by jpluimers on 2015/02/23

Ditching Windows XP meant finding drivers for some older devices.

One of them is a [Archive.is] Canon PIXMA mini260 Photo Inkjet Printer which prints marvellous photos in a borderless way (so no post processing needed).

Installing drivers on Windows 8.1 x64 turned out to be really easy despite the fact that the Canon site does not offer them:  just install the “Windows Vista (64-bit)” drivers from this Canon link: [Wayback] PIXMA mini260 – Canon Europe.

This works as the printer driver model hasn’t changed much since Vista and the Vista drivers do not contain limits on future version numbers (see [Wayback] Getting older Windows drivers to work in Windows 8 for another example).

Now I need to find a way to get my [Archive.is] Olympus Camedia P-400 Digital Color Photo Printer. That is a lot harder: the most recent Windows P-400 Printer > Software Downloads are for Windows XP.

If anyone knows a workaround for this, I might connect this to an XP VM in a walled garden:

Under Windows XP, often the P-400 driver installer didn’t even want to install the USB part of the drivers.

How can I work around this?

Might it be that only the parallel LPTENUM is included in the [Wayback] Windows XP P400N.inf file, unlike the [Wayback] Windows 2000 driver P400N.INF file that contains both [Wayback] LPTENUM and [Wayback] USBPRINT and the [Wayback] P-440 INF file only has USBPRINT?

Other vendors seem to include both in their .INF files like this [Wayback] Dell 3130cn INF file.

–jeroen

via:

Posted in Power User, Vista, Windows, Windows 7, Windows 8, Windows 8.1, Windows 9, Windows Vista, Windows XP | Leave a Comment »

“PC Decrapifier” – via: Machines Plus Minds: Regarding Lenovo preinstalling SSL-breaking MITM on their machines

Posted by jpluimers on 2015/02/21

I didn’t even know there was a “PC Decrapifier”, but it exists: “PC Decrapifier” – Google Search.

Anyway: never use OEM Windows installs ever.

Would the Dutch Microsoft Store offer the same service?

–jeroen

via: Machines Plus Minds: Regarding Lenovo preinstalling SSL-breaking MITM on their machines.

Posted in Power User, Security, Windows | Leave a Comment »

Binary builds of Win64 and Win32 OpenSSL (via: Shining Light Productions)

Posted by jpluimers on 2015/02/20

The quickest way to get Win64 and Win32 binary builds of the youngest OpenSSL, you should get them from Shining Light Productions – Win32 OpenSSL.

Despite the link name, you can get the Win64 binaries from there too..

Besides binaries, they also have the source to build them from, and any other redistributable you’d need.

They run on virtually any Windows version, though I only used them on NT based Windows versions of XP/2003 and younger.

Two notes:

  • you usually need the Visual C++ 2008 redistributables, of which there is both an x86 and an x64 version (the OpenSSL installer just tells you it is missing, and assumes you know if it is the x86 or x64 one).
  • unless you are a software developer wanting to link to OpenSSL, the “Light” versions of the installs suffice.

–jeroen

via: Shining Light Productions – Win32 OpenSSL.

Posted in OpenSSL, Power User, Security, 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 | 1 Comment »

Creating an ICO file from multiple PNG files: IcoFX versus ConvertICO.org

Posted by jpluimers on 2015/02/17

For Windows Vista and up, you need at least these icon resolutions:

  • 16×16
  • 32×32
  • 48×48
  • 256×256

For Windows XP / 2003 Server and earlier, you’d only need the 16×16, 32×32 and 48×48 resolutions, and if you support older video hardware, include them in 24-bit, 8-bit and 4-bit color depth.

For younger versions you might consider adding 20×20, 24×24, 40×40, 64×64 and 128×128 as well to support higher DPI modes.

You need to include and various other sizes for other operating systems.

Getting at them, I usually start with an EPS file, then downscale to the right resolution, and save the resulting files as PNG images, then assemble those together.

A while ago, I had some icons with nice long diagonal line, then I found out the hard way I should not have used ConvertICO.org. I often prefer on-line tools over off-line, especially for actions I rarely do (this is one of them). It saves you from installing software, and on-line sites usually get better over time.

In this case, I shouldn’t have gone online: Just look at the jagged edges in the 200% zoom below: the image on the right is from ConvertICO.org, on the left it is from IcoFX.

What you clearly see is that ConvertICO messes around with the 256×256 image (it doesn’t mess around with the other resolution), but IcoFX doesn’t mess around.

So now I switched to IcoFX. Not on-line, but a great free tool. Read the rest of this entry »

Posted in Development, Power User, 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 | 2 Comments »

Windows Alt Key Codes

Posted by jpluimers on 2015/02/16

Brillant!: Windows Alt Key Codes.

The page has both lists of four-digit ALT+#### codes, a how-to, and reference links:

  1. Letters with Accents – (e.g. ó, ò, ñ)
  2. Other Foreign Characters – (e.g. ç, ¿, ß)
  3. Currency Symbols – (e.g. ¢, £, ¥)
  4. Math Symbols – (e.g. ±, °, ÷)
  5. Other Punctuation – (e.g. &, ©, §)
  6. Using the Codes
  7. Other Accents and Symbols: Character Map Other Page
  8. Non-Numeric Accent Codes: Activate International Keyboard Other Page
  9. Links to Other References

–jeroen

Posted in Development, Encoding, Power User, Software Development, Unicode, 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 »

Finding your Windows files quickly: Everything Search engine

Posted by jpluimers on 2015/01/30

More than 4 years ago, I wrote about the Windows filename search replacement: Everything. Since then, Everything has even gotten better: though the “stable” 1.2 version dates back to 2009, a new series of 1.3.x betas has appeared since early 2013 that are just as stable, are faster and have far more features.

Some new features I like a lot:

  • Support for Recent Changes, for instance searching for rc:today gives you files that have changed today.
  • The extended search syntax now includes the ability to search for attributes (even compressed, offline or encrypted) and timestamps (even relative ones like dm:last10minutes) for datecreated (dc), datemodified (dm) or recentchanges (rc).
  • Allow for boolean operators ! (NOT), & (AND) and space (OR) and grouping them with < and >.
  • These search prefixes: Read the rest of this entry »

Posted in Everything by VoidTools, Power User, Windows, Windows 7, Windows 8, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista | Leave a Comment »

Interesting: minidump/kernel dump Instant Online Crash Analysis

Posted by jpluimers on 2015/01/28

Figured using Instant Online Crash Analysis that mfefirek.sys is causing a DRIVER_IRQL_NOT_LESS_OR_EQUAL BSOD.

Well done McAfee!

This is what I did:

  1. As admin, copy %windir%\Minidump\*.dmp %temp%
  2. Uploaded these to http://www.osronline.com/page.cfm?name=analyze
  3. Compare the results with Beyond Compare 4 for patterns.

The result for all *.dmp files is a pattern like this:

DRIVER_IRQL_NOT_LESS_OR_EQUAL (d1)
An attempt was made to access a pageable (or completely invalid) address at an
interrupt request level (IRQL) that is too high.  This is usually
caused by drivers using improper addresses.
If kernel debugger is available get stack backtrace.
Arguments:
Arg1: 000000000000000d, memory referenced
Arg2: 0000000000000002, IRQL
Arg3: 0000000000000000, value 0 = read operation, 1 = write operation
Arg4: fffff8800....d70, address which referenced memory

Debugging Details:
------------------

TRIAGER: Could not open triage file : e:\dump_analysis\program\triage\modclass.ini, error 2

READ_ADDRESS: GetPointerFromAddress: unable to read from fffff800032..100
GetUlongFromAddress: unable to read from fffff800032..1c0
 000000000000000d Nonpaged pool

CURRENT_IRQL:  2

FAULTING_IP: 
mfefirek+19d70
fffff880`0.....70 8a400d          mov     al,byte ptr [rax+0Dh]

–jeroen

via: Instant Online Crash Analysis.

Posted in Power User, Windows, Windows 7 | Leave a Comment »

windows – .Net WinForm System Beep on a 64 Bit OS – Stack Overflow

Posted by jpluimers on 2015/01/28

Thanks Shay Erlichmen for answering this on SO why the Beep function does not bell the speaker any more on x64 systems:

Beep has been removed as a native function from all x64 platforms (so no managed version of course), there is a connect issue that petition to return it.

We use a different trick to discover servers, we remote eject the dvd drive, and the drive with the tray open is the one were looking for :)

Larry Osterman has a great article about this: What’s up with the beep driver in Windows 7.

In the mean time, the connect issue has been removed as well.

The good news however (if your hardware still has an Intel 8254 compatible PIT in the South Bridge connected to a PC speaker):

Ludwig Ertl wrote the BEEPx / BeepXP driver that interfaces to the speaker through the 8254. Note it has a (German) changelog, but you can respond in English.

–jeroen

via: windows – .Net WinForm System Beep on a 64 Bit OS – Stack Overflow.

Posted in Development, Power User, Software Development, Windows, Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista | Leave a Comment »

NotePad++: Text Editor which shows \r\n (via: Stack Overflow)

Posted by jpluimers on 2015/01/26

I hadn’t monitored Notepad++ in a very long time, so I was glad that User Thomas Owens mentioned that it can show you the CR and LF codes:

With Notepad++, you can show end-of-line characters. It shows CR and LF, instead of “\r” and “\n”, but it gets the point across. […]

To use Notepad++ for this,

  1. open the View menu, open the Show Symbols slide out, and
  2. select either “Show all characters” or “Show end-of-line characters”.

I needed this because many development environments get confused when you have text files using a mix of line-break kinds (in my case LF, CR and CRLF).

–jeroen

via Text Editor which shows \r\n? – Stack Overflow.

Posted in *nix, Apple, Linux, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.7 Lion, OS X 10.8 Mountain Lion, Power User, SuSE Linux, Windows | Leave a Comment »