Bug 6766 - Java.Security.KeyStore.Load wraps null streams
Summary: Java.Security.KeyStore.Load wraps null streams
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.1.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2012-08-30 17:28 UTC by Frank A. Krueger
Modified: 2012-09-06 17:13 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Frank A. Krueger 2012-08-30 17:28:32 UTC
The current wrapping of KeyStore.Load wraps a null stream argument into an empty stream.

But passing null is how you're supposed to init an empty keystore. http://developer.android.com/reference/java/security/KeyStore.html#load(java.io.InputStream, char[])

When you pass null, the KeyStore tries to load it and gets an IO exception. Instead, it should create an empty store.
Comment 1 Atsushi Eno 2012-09-06 06:19:56 UTC
I tried it with master, with Galaxy Note (runs 2.3) and Intel ICS emulator (API Level 15), and could not reproduce this issue. It could be already fixed after the version you tried.
Comment 2 Atsushi Eno 2012-09-06 12:56:40 UTC
I confirmed this reproduces in 4.2.5 (Mac/MD) as you reported. So... I take it as it got fixed in 4.4.

For reference, this is what I tested (replaced button.Click event content):

		var ks = KeyStore.GetInstance (KeyStore.DefaultType);
		ks.Load (null, "ABCDEFG".ToCharArray ());
Comment 3 Jonathan Pryor 2012-09-06 17:13:27 UTC
For reference, fixed in f3e317a5.