wolfssljni/spotbugs-exclude.xml

303 lines
9.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
SpotBugs exclusion filter for wolfSSL JNI/JSSE
This file lists bugs that have been reviewed and determined to be
intentional design decisions or false positives.
Documentation:
https://spotbugs.readthedocs.io/en/stable/filter.html
-->
<FindBugsFilter>
<!--
EI_EXPOSE_REP: Methods returning internal mutable objects.
getSNIServerNames(): all callers are internal JSSE classes
that only read from the returned list.
getSessionContext(): required by SSLSession interface, must
return the actual context object.
getVerifyException(): returns an Exception object which is
effectively immutable.
getOutputStream(): standard Socket API contract requires
returning the same stream instance.
-->
<Match>
<Class name=
"com.wolfssl.provider.jsse.WolfSSLImplementSSLSession"/>
<Method name="getSNIServerNames"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<Match>
<Class name=
"com.wolfssl.provider.jsse.WolfSSLImplementSSLSession"/>
<Method name="getSessionContext"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<Match>
<Class name=
"com.wolfssl.provider.jsse.WolfSSLInternalVerifyCb"/>
<Method name="getVerifyException"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<Match>
<Class name="com.wolfssl.provider.jsse.WolfSSLSocket"/>
<Method name="getOutputStream"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<!--
EI_EXPOSE_REP2: Internal classes storing references to other
internal objects. These classes are all part of the wolfJSSE
provider and are created/owned together - they need shared
mutable state by design. Cloning would break expected
behavior and add unnecessary overhead.
-->
<Match>
<Class name="com.wolfssl.WolfSSLSession"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="com.wolfssl.provider.jsse.WolfSSLEngine"/>
<Method name="unwrap"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name=
"com.wolfssl.provider.jsse.WolfSSLImplementSSLSession"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name=
"com.wolfssl.provider.jsse.WolfSSLInternalVerifyCb"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="com.wolfssl.provider.jsse.WolfSSLKeyX509"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name=
"com.wolfssl.provider.jsse.WolfSSLProvider$JSSEFIPSErrorCallback"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name=
"com.wolfssl.provider.jsse.WolfSSLServerSocket"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name=
"com.wolfssl.provider.jsse.WolfSSLServerSocketFactory"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name=
"com.wolfssl.provider.jsse.WolfSSLSessionContext"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="com.wolfssl.provider.jsse.WolfSSLSocket"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name=
"com.wolfssl.provider.jsse.WolfSSLSocketFactory"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="com.wolfssl.provider.jsse.WolfSSLTrustX509"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<!--
ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD: WolfSSL constructor
populates static fields (NID_*, wolfssl_*, cipher/hash/key
type enums, TLS 1.3 secret enums) from native JNI calls.
These values come from native wolfSSL at runtime and cannot
be compile-time constants. The constructor is the library
initialization point, writing statics here is by design.
-->
<Match>
<Class name="com.wolfssl.WolfSSL"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>
</Match>
<!--
ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD: WolfSSLProvider
constructor sets static sslLib singleton. Only one native
wolfSSL library instance is shared across all provider
objects by design.
-->
<Match>
<Class name="com.wolfssl.provider.jsse.WolfSSLProvider"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>
</Match>
<!--
CT_CONSTRUCTOR_THROW: JNI wrapper and JSSE class constructors
throw exceptions when native resource allocation fails (e.g.
native pointer returned as 0) or when invalid arguments are
provided. This is the standard Java idiom for signaling
construction failure. No native resources are leaked when
the exception is thrown since allocation had not yet
succeeded. Not vulnerable to finalizer attacks since the
native pointer is 0/null in the failure case.
-->
<Match>
<Class name="com.wolfssl.WolfCryptEccKey"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Class name="com.wolfssl.WolfSSL"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Class name="com.wolfssl.WolfSSLCRL"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Class name="com.wolfssl.WolfSSLCertManager"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Class name="com.wolfssl.WolfSSLCertRequest"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Class name="com.wolfssl.WolfSSLCertificate"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Class name="com.wolfssl.WolfSSLContext"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Class name="com.wolfssl.WolfSSLNameConstraints"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Class name="com.wolfssl.WolfSSLSession"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Class name="com.wolfssl.WolfSSLX509Name"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Class name="com.wolfssl.WolfSSLX509StoreCtx"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Class name=
"com.wolfssl.provider.jsse.WolfSSLAuthStore"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Class name="com.wolfssl.provider.jsse.WolfSSLEngine"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Class name=
"com.wolfssl.provider.jsse.WolfSSLEngineHelper"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Class name="com.wolfssl.provider.jsse.WolfSSLKeyX509"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Class name=
"com.wolfssl.provider.jsse.WolfSSLSNIServerName"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Class name="com.wolfssl.provider.jsse.WolfSSLSocket"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<!--
IS2_INCONSISTENT_SYNC: Fields set in constructors before
object is published to other threads, then read under locks
afterward. Safe per Java Memory Model since constructor
completion happens-before publication.
-->
<Match>
<Class name="com.wolfssl.WolfSSLCertificate"/>
<Field name="active"/>
<Bug pattern="IS2_INCONSISTENT_SYNC"/>
</Match>
<Match>
<Class name="com.wolfssl.WolfSSLCRL"/>
<Field name="active"/>
<Bug pattern="IS2_INCONSISTENT_SYNC"/>
</Match>
<Match>
<Class name="com.wolfssl.WolfSSLCertRequest"/>
<Field name="active"/>
<Bug pattern="IS2_INCONSISTENT_SYNC"/>
</Match>
<Match>
<Class name="com.wolfssl.WolfSSLContext"/>
<Field name="sslCtxPtr"/>
<Bug pattern="IS2_INCONSISTENT_SYNC"/>
</Match>
<Match>
<Class name="com.wolfssl.WolfSSLX509Name"/>
<Field name="x509NamePtr"/>
<Bug pattern="IS2_INCONSISTENT_SYNC"/>
</Match>
<!--
IS2_INCONSISTENT_SYNC: WolfSSLSession callback context
fields and ctx. Getters use synchronized on 'this', setters
use synchronized(sslLock). These are set once during setup
and read from JNI callbacks. The ctx field is set in the
constructor before object publication.
-->
<Match>
<Class name="com.wolfssl.WolfSSLSession"/>
<Bug pattern="IS2_INCONSISTENT_SYNC"/>
</Match>
<!--
IS2_INCONSISTENT_SYNC: WolfSSLEngine.ssl and
WolfSSLSocket.ssl fields set in constructor (before
publication), unsynchronized reads only in debug logging
lambdas (read-only, non-critical).
-->
<Match>
<Class name="com.wolfssl.provider.jsse.WolfSSLEngine"/>
<Field name="ssl"/>
<Bug pattern="IS2_INCONSISTENT_SYNC"/>
</Match>
<Match>
<Class name="com.wolfssl.provider.jsse.WolfSSLSocket"/>
<Field name="ssl"/>
<Bug pattern="IS2_INCONSISTENT_SYNC"/>
</Match>
</FindBugsFilter>