| 1 |
<?xml version='1.0' encoding='UTF-8'?> |
| 2 |
<!-- Schema file written by PDE --> |
| 3 |
<schema targetNamespace="org.eclipse.equinox.p2.artifact.repository" xmlns="http://www.w3.org/2001/XMLSchema"> |
| 4 |
<annotation> |
| 5 |
<appInfo> |
| 6 |
<meta.schema plugin="org.eclipse.equinox.p2.artifact.repository" id="artifactChecksums" name="Artifact Checksum support"/> |
| 7 |
</appInfo> |
| 8 |
<documentation> |
| 9 |
Provides a mapping from checksum algorithm id and <code>java.security.MessageDigest</code> implementations. |
| 10 |
|
| 11 |
<p>p2 detects errors which may have been introduced during artifact transmission/storage by calculating artifact checksum using MD5 hash function. As a <a href="https://en.wikipedia.org/wiki/Collision_attack">collision attack</a> and a <a href="https://en.wikipedia.org/wiki/Chosen-prefix_collision_attack">chosen-prefix collision attack</a> against MD5 have been demonstrated in public, it can be used but only to detect unintentional corruption. Current implementation is not extensible and doesn't allow to use other, more collision-resistant, hash functions.</p> |
| 12 |
|
| 13 |
<p>With this extension point, any <code>java.security.MessageDigest</code> from Java Security API can be used to check integrity of artifacts. For more information on these APIs, see <a href="https://docs.oracle.com/en/java/javase/11/security/java-cryptography-architecture-jca-reference-guide.html">Java Cryptography Architecture (JCA) Reference Guide</a>.</p> |
| 14 |
</documentation> |
| 15 |
</annotation> |
| 16 |
|
| 17 |
<element name="extension"> |
| 18 |
<annotation> |
| 19 |
<appInfo> |
| 20 |
<meta.element /> |
| 21 |
</appInfo> |
| 22 |
</annotation> |
| 23 |
<complexType> |
| 24 |
<sequence> |
| 25 |
<element ref="artifactChecksum" minOccurs="1" maxOccurs="unbounded"/> |
| 26 |
</sequence> |
| 27 |
<attribute name="point" type="string" use="required"> |
| 28 |
<annotation> |
| 29 |
<documentation> |
| 30 |
|
| 31 |
</documentation> |
| 32 |
</annotation> |
| 33 |
</attribute> |
| 34 |
<attribute name="id" type="string"> |
| 35 |
<annotation> |
| 36 |
<documentation> |
| 37 |
|
| 38 |
</documentation> |
| 39 |
</annotation> |
| 40 |
</attribute> |
| 41 |
<attribute name="name" type="string"> |
| 42 |
<annotation> |
| 43 |
<documentation> |
| 44 |
|
| 45 |
</documentation> |
| 46 |
<appInfo> |
| 47 |
<meta.attribute translatable="true"/> |
| 48 |
</appInfo> |
| 49 |
</annotation> |
| 50 |
</attribute> |
| 51 |
</complexType> |
| 52 |
</element> |
| 53 |
|
| 54 |
<element name="artifactChecksum"> |
| 55 |
<complexType> |
| 56 |
<attribute name="id" type="string" use="required"> |
| 57 |
<annotation> |
| 58 |
<documentation> |
| 59 |
id of the checksum algorithm, i.e. <code>sha-512</code>. |
| 60 |
|
| 61 |
As other tools will rely on this id, consider using some well-defined value (i.e. <a href="https://www.iana.org/assignments/hash-function-text-names/hash-function-text-names.xhtml">Hash Function Textual Names</a> ). |
| 62 |
</documentation> |
| 63 |
</annotation> |
| 64 |
</attribute> |
| 65 |
<attribute name="algorithm" type="string" use="required"> |
| 66 |
<annotation> |
| 67 |
<documentation> |
| 68 |
Name of the message digest algorithm as expected by <code>java.security.MessageDigest</code>'s method <code>getInstance(String)</code>. Also check the MessageDigest section in the Java Cryptography Architecture Standard Algorithm Name Documentation for information about standard algorithm names. |
| 69 |
</documentation> |
| 70 |
</annotation> |
| 71 |
</attribute> |
| 72 |
<attribute name="providerName" type="string"> |
| 73 |
<annotation> |
| 74 |
<documentation> |
| 75 |
For custom security provider, name of the security provider that provides this message digest implementation, the value returned by <code>java.security.Provider.getName()</code>. |
| 76 |
</documentation> |
| 77 |
</annotation> |
| 78 |
</attribute> |
| 79 |
<attribute name="warnInsecure" type="boolean"> |
| 80 |
<annotation> |
| 81 |
<documentation> |
| 82 |
Since 1.4.300 |
| 83 |
Set to true if this algorithm is now considered as insecure. A warning will be logged when this algorithm is used. An artifact that has no checksums or checksums only for insecure algorithms will emit a warning to user. |
| 84 |
</documentation> |
| 85 |
</annotation> |
| 86 |
</attribute> |
| 87 |
<attribute name="priority" type="string" use="default" value="0"> |
| 88 |
<annotation> |
| 89 |
<documentation> |
| 90 |
Gives a priority of this algorithm, algorithms with higher priority are preffered if multiple ones are applicable. |
| 91 |
</documentation> |
| 92 |
</annotation> |
| 93 |
</attribute> |
| 94 |
<attribute name="publish" type="boolean" use="default" value="true"> |
| 95 |
<annotation> |
| 96 |
<documentation> |
| 97 |
Controls if this checksum should be published when assembling a repository. |
| 98 |
</documentation> |
| 99 |
</annotation> |
| 100 |
</attribute> |
| 101 |
</complexType> |
| 102 |
</element> |
| 103 |
|
| 104 |
<annotation> |
| 105 |
<appInfo> |
| 106 |
<meta.section type="since"/> |
| 107 |
</appInfo> |
| 108 |
<documentation> |
| 109 |
2.4.0 |
| 110 |
</documentation> |
| 111 |
</annotation> |
| 112 |
|
| 113 |
<annotation> |
| 114 |
<appInfo> |
| 115 |
<meta.section type="examples"/> |
| 116 |
</appInfo> |
| 117 |
<documentation> |
| 118 |
To enable support for MessageDigest implementation which is provided by a statically registered Provider, contributing bundle should only register an extension: |
| 119 |
|
| 120 |
<pre> |
| 121 |
<extension point="org.eclipse.equinox.p2.artifact.repository.artifactChecksums"> |
| 122 |
<artifactChecksum |
| 123 |
algorithm="SHA3-512" |
| 124 |
id="sha3-512"> |
| 125 |
</artifactChecksum> |
| 126 |
</extension> |
| 127 |
</pre> |
| 128 |
|
| 129 |
If the MessageDigest implementation is provided by a custom security provider (from the contributing bundle itself or some other bundle), it should be registered first with the Framework service registry under interface <code>java.security.Provider</code>: |
| 130 |
|
| 131 |
<pre> |
| 132 |
import java.security.Provider; |
| 133 |
import java.util.Dictionary; |
| 134 |
import java.util.Hashtable; |
| 135 |
|
| 136 |
import org.bouncycastle.jce.provider.BouncyCastleProvider; |
| 137 |
import org.osgi.framework.BundleActivator; |
| 138 |
import org.osgi.framework.BundleContext; |
| 139 |
import org.osgi.framework.ServiceRegistration; |
| 140 |
|
| 141 |
... |
| 142 |
|
| 143 |
Dictionary<String, Object> props = new Hashtable<>(); |
| 144 |
props.put("providerName", "BC"); |
| 145 |
ServiceRegistration<Provider> registration = context.registerService(Provider.class, new BouncyCastleProvider(), props); |
| 146 |
</pre> |
| 147 |
|
| 148 |
and then register an extension using <code>providerName</code> attribute: |
| 149 |
|
| 150 |
<pre> |
| 151 |
<extension point="org.eclipse.equinox.p2.artifact.repository.artifactChecksums"> |
| 152 |
<artifactChecksum |
| 153 |
algorithm="Whirlpool" |
| 154 |
id="whirlpool" |
| 155 |
providerName="BC"> |
| 156 |
</artifactChecksum> |
| 157 |
</extension> |
| 158 |
</pre> |
| 159 |
</documentation> |
| 160 |
</annotation> |
| 161 |
|
| 162 |
|
| 163 |
<annotation> |
| 164 |
<appInfo> |
| 165 |
<meta.section type="implementation"/> |
| 166 |
</appInfo> |
| 167 |
<documentation> |
| 168 |
Contributes a checksum algorithm with id <code>sha-256</code> and maps it to <code>SHA-256</code> MessageDigest implementation. |
| 169 |
</documentation> |
| 170 |
</annotation> |
| 171 |
|
| 172 |
<annotation> |
| 173 |
<appInfo> |
| 174 |
<meta.section type="copyright"/> |
| 175 |
</appInfo> |
| 176 |
<documentation> |
| 177 |
Copyright (c) 2015, 2018 Mykola Nikishov. |
| 178 |
|
| 179 |
This program and the accompanying materials are made |
| 180 |
available under the terms of the Eclipse Public License 2.0 which |
| 181 |
accompanies this distribution, and is available at |
| 182 |
<a href="https://www.eclipse.org/legal/epl-2.0">https://www.eclipse.org/legal/epl-v20.html</a>/ |
| 183 |
|
| 184 |
SPDX-License-Identifier: EPL-2.0 |
| 185 |
</documentation> |
| 186 |
</annotation> |
| 187 |
|
| 188 |
</schema> |