Hi All!!
I'm working with OSGi security API under Felix.
I wanted to test 4 bundles:
1-a bundles that manages the permissions.
2-RegisterService: a bundle that registers a service S.
3-GoodBundle: a signed bundle that consumes S.
4-MaliciousBundle: an unsigned bundles that attempts to consume S.
I run Felix with run_felix.sh = *{java
-Dfelix.config.properties=file:lib/felix/conf/config.properties
-Dfelix.cache.profiledir=lib/felix/profile -Djava.security.manager
-Djava.security.policy=lib/all.policy -Dfelix.keystore=file:/home/me/myKS.ks
-Dfelix.keystore.pass=mypass -Dfelix.keystore.type=JKS -jar
lib/felix/felix.jar}*
The problem is that my 'GoodBundle' cannot get the service!
It worked well when I substitued:
*{m_signed = condPermAdmin.addConditionalPermissionInfo(new ConditionInfo[]{
new ConditionInfo(BundleSignerCondition.class.getName(), new
String[]{"* ; o=ENIT"})
}, ALLPERMISSION_INFO);
} *
by
*{m_signed = condPermAdmin.addConditionalPermissionInfo(new ConditionInfo[]{
new ConditionInfo(BundleLocationCondition.class.getName(),
new String[]{context.getBundle(7).getLocation()})
}, ALLPERMISSION_INFO);
}* (GoodBundle has id=7)
So I doubted that there is something wrong with Jarsigneing, but the command
:
*{jarsigner -keystore /home/me/myKS.ks GoodBundle-1.0.jar myAlias}*
returns tells me that there is nothing wrong with the signature and all the
fields appear as they are supposed to be.
What might be the problem?
Thank you very much in advance.