Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Add "Digest algorithm SHA256" to support encryption of karaf user passwords #2700

Closed
EliasGabrielsson opened this issue Dec 23, 2016 · 4 comments

Comments

@EliasGabrielsson
Copy link

Goal:

Enable encryption of karaf users passwords according to documentation. Karaf already have a method implemented. Today all user passwords are stored in clear text in etc/users.properties file.

Problem:

Eclipse smarthome does currently NOT include a package for SHA256 calculations.
Errorlog:

2016-12-23 19:45:51.671 [ERROR] [s.modules.encryption.BasicEncryption] - Initialization failed. Digest algorithm SHA256 is not available.
java.security.NoSuchAlgorithmException: SHA256 MessageDigest not available
	at sun.security.jca.GetInstance.getInstance(GetInstance.java:159)[:1.8.0_111]
	at java.security.Security.getImpl(Security.java:695)[:1.8.0_111]
	at java.security.MessageDigest.getInstance(MessageDigest.java:167)[:1.8.0_111]
	at org.apache.karaf.jaas.modules.encryption.BasicEncryption.<init>(BasicEncryption.java:51)
	at org.apache.karaf.jaas.modules.encryption.BasicEncryptionService.createEncryption(BasicEncryptionService.java:25)
...

Solution:

Add package to solve above problem and verify the solution according to above documentation.

@kaikreuzer
Copy link
Contributor

Eclipse smarthome does currently NOT include a package for SHA256 calculations.

I don't assume to ask that this should be implemented in ESH? I would think there are such bundles available for Karaf / JAAS already, right?

So I would think this issue is a matter of the solution that uses Karaf to package what is needed and no change is required in ESH itself. Feel free to reopen, if I miss anything.

@EliasGabrielsson
Copy link
Author

I think I was unclear. I wonder if the build of ESH could include correct karaf / JAAS package in the base release to enable this feature. Or is it easy to add them later on using karaf directly?

Excuse for my lack of knowledge how this frameworks package manage work.

@kaikreuzer
Copy link
Contributor

The ESH build builds the source code if ESH, there is no such thing as a Karaf distro of ESH.

What you might be looking for is https://github.com/openhab/openhab-distro.

@EliasGabrielsson
Copy link
Author

EliasGabrielsson commented Dec 23, 2016

Aa. of course. Wrong repo.
Will recreate it over there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants