mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
11.58.2012 aad596c8559b3d3d081617736cdbeda1374f017b
Fix OPENDJ-482: Validation for the CertificateSyntax

A huge thanks to Manuel Gaupp for this contribution.

In addition to the original contributed change I have made the following alterations:

* make the CertificateSyntax strictness configurable. By default the syntax will enforce the syntax, but this can be disabled if needed

* add a new method "isHumanReadable" to AttributeSyntax and AttributeType classes in order to make it easier to determine whether or not a syntax/type is human readable. This can be used in order to determine whether or not an attribute value can be included in log messages, for example.
4 files added
78 files modified
1605 ■■■■■ changed files
opends/resource/config/config.ldif 2 ●●●●● patch | view | raw | blame | history
opends/resource/schema/02-config.ldif 6 ●●●●● patch | view | raw | blame | history
opends/src/admin/defn/org/opends/server/admin/std/CertificateAttributeSyntaxConfiguration.xml 75 ●●●●● patch | view | raw | blame | history
opends/src/admin/messages/CertificateAttributeSyntaxCfgDefn.properties 7 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/core.properties 8 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/core_ca_ES.properties 8 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/core_de.properties 3 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/core_es.properties 8 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/core_fr.properties 8 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/core_ja.properties 8 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/core_ko.properties 8 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/core_pl.properties 8 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/core_zh_CN.properties 8 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/core_zh_TW.properties 8 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/schema.properties 6 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/schema_de.properties 3 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/schema_es.properties 6 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/schema_fr.properties 6 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/schema_ja.properties 6 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/schema_ko.properties 6 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/schema_zh_CN.properties 6 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/schema_zh_TW.properties 6 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/api/AttributeSyntax.java 18 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/asn1/ASN1ByteChannelReader.java 16 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/asn1/ASN1ByteSequenceReader.java 21 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/asn1/ASN1Constants.java 8 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/asn1/ASN1InputStreamReader.java 21 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/asn1/ASN1Reader.java 25 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/AciSyntax.java 12 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/AttributeTypeSyntax.java 14 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/AuthPasswordSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/BinarySyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/BitStringSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/BooleanSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/CertificateListSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/CertificatePairSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/CertificateSyntax.java 270 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/CountryStringSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/DITContentRuleSyntax.java 12 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/DITStructureRuleSyntax.java 12 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/DeliveryMethodSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/DirectoryStringSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/DistinguishedNameSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/EnhancedGuideSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/FaxNumberSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/FaxSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/GeneralizedTimeSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/GuideSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/IA5StringSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/IntegerSyntax.java 10 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/JPEGSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/LDAPSyntaxDescriptionSyntax.java 18 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/MatchingRuleSyntax.java 14 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/MatchingRuleUseSyntax.java 12 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/NameAndOptionalUIDSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/NameFormSyntax.java 12 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/NumericStringSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/OIDSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/ObjectClassSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/OctetStringSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/OtherMailboxSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/PostalAddressSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/PresentationAddressSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/PrintableStringSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/ProtocolInformationSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/SubstringAssertionSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/SubtreeSpecificationSyntax.java 12 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/SupportedAlgorithmSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/TelephoneNumberSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/TeletexTerminalIdentifierSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/TelexNumberSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/UTCTimeSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/UUIDSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/UserPasswordSyntax.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/types/AttributeType.java 28 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java 64 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java 53 ●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/core/ModifyOperationTestCase.java 22 ●●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/ExternalSASLMechanismHandlerTestCase.java 39 ●●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/LDAPBinaryOptionTestCase.java 13 ●●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/schema/BinaryAttributeSyntaxTest.java 87 ●●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/schema/CertificateSyntaxTest.java 197 ●●●●● patch | view | raw | blame | history
opends/resource/config/config.ldif
@@ -2044,9 +2044,11 @@
dn: cn=Certificate,cn=Syntaxes,cn=config
objectClass: top
objectClass: ds-cfg-attribute-syntax
objectClass: ds-cfg-certificate-attribute-syntax
cn: Certificate
ds-cfg-java-class: org.opends.server.schema.CertificateSyntax
ds-cfg-enabled: true
ds-cfg-strict-format: true
dn: cn=Certificate List,cn=Syntaxes,cn=config
objectClass: top
opends/resource/schema/02-config.ldif
@@ -5135,3 +5135,9 @@
  SUP ds-cfg-virtual-attribute
  STRUCTURAL
  X-ORIGIN 'OpenDJ Directory Server' )
objectClasses: ( 1.3.6.1.4.1.36733.2.1.2.10
  NAME 'ds-cfg-certificate-attribute-syntax'
  SUP ds-cfg-attribute-syntax
  STRUCTURAL
  MAY ds-cfg-strict-format
  X-ORIGIN 'OpenDJ Directory Server' )
opends/src/admin/defn/org/opends/server/admin/std/CertificateAttributeSyntaxConfiguration.xml
New file
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
  ! CDDL HEADER START
  !
  ! The contents of this file are subject to the terms of the
  ! Common Development and Distribution License, Version 1.0 only
  ! (the "License").  You may not use this file except in compliance
  ! with the License.
  !
  ! You can obtain a copy of the license at
  ! trunk/opends/resource/legal-notices/CDDLv1_0.txt
  ! or http://forgerock.org/license/CDDLv1.0.html.
  ! See the License for the specific language governing permissions
  ! and limitations under the License.
  !
  ! When distributing Covered Code, include this CDDL HEADER in each
  ! file and include the License file at
  ! trunk/opends/resource/legal-notices/CDDLv1_0.txt.  If applicable,
  ! add the following below this CDDL HEADER, with the fields enclosed
  ! by brackets "[]" replaced with your own identifying information:
  !      Portions Copyright [yyyy] [name of copyright owner]
  !
  ! CDDL HEADER END
  !
  !
  !      Copyright 2012 ForgeRock AS.
  ! -->
<adm:managed-object name="certificate-attribute-syntax"
  plural-name="certificate-attribute-syntaxes"
  extends="attribute-syntax" package="org.opends.server.admin.std"
  xmlns:adm="http://www.opends.org/admin"
  xmlns:ldap="http://www.opends.org/admin-ldap">
  <adm:synopsis>
    <adm:user-friendly-plural-name />
    define an attribute syntax for storing X.509 Certificates.
  </adm:synopsis>
  <adm:profile name="ldap">
    <ldap:object-class>
      <ldap:name>ds-cfg-certificate-attribute-syntax</ldap:name>
      <ldap:superior>ds-cfg-attribute-syntax</ldap:superior>
    </ldap:object-class>
  </adm:profile>
  <adm:property-override name="java-class" advanced="true">
    <adm:default-behavior>
      <adm:defined>
        <adm:value>
          org.opends.server.schema.CertificateSyntax
        </adm:value>
      </adm:defined>
    </adm:default-behavior>
  </adm:property-override>
  <adm:property name="strict-format" advanced="true">
    <adm:synopsis>
      Indicates whether or not X.509 Certificate values are required to
      strictly comply with the standard definition for this syntax.
    </adm:synopsis>
    <adm:description>
      When set to false, certificates will not be validation and, as a result
      any sequence of bytes will be acceptable.
    </adm:description>
    <adm:default-behavior>
      <adm:defined>
        <adm:value>true</adm:value>
      </adm:defined>
    </adm:default-behavior>
    <adm:syntax>
      <adm:boolean />
    </adm:syntax>
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:name>ds-cfg-strict-format</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
</adm:managed-object>
opends/src/admin/messages/CertificateAttributeSyntaxCfgDefn.properties
New file
@@ -0,0 +1,7 @@
user-friendly-name=Certificate Attribute Syntax
user-friendly-plural-name=Certificate Attribute Syntaxes
synopsis=Certificate Attribute Syntaxes define an attribute syntax for storing X.509 Certificates.
property.enabled.synopsis=Indicates whether the Certificate Attribute Syntax is enabled.
property.java-class.synopsis=Specifies the fully-qualified name of the Java class that provides the Certificate Attribute Syntax implementation.
property.strict-format.synopsis=Indicates whether or not X.509 Certificate values are required to strictly comply with the standard definition for this syntax.
property.strict-format.description=When set to false, certificates will not be validation and, as a result any sequence of bytes will be acceptable.
opends/src/messages/messages/core.properties
@@ -1853,3 +1853,11 @@
 operation has been rejected because request handler thread was interrupted \
 while attempting to put the operation on the work queue
INFO_DISCONNECT_DUE_TO_INVALID_CREDENTIALS_741=Invalid Credentials
SEVERE_WARN_ADD_OP_INVALID_SYNTAX_NO_VALUE_742=Entry "%s" contains a value for \
 attribute %s that is invalid according to the syntax for that attribute:  %s
MILD_ERR_MODIFY_ADD_INVALID_SYNTAX_NO_VALUE_743=When attempting to modify entry \
 %s, one value for attribute %s was found to be invalid according to the \
 associated syntax:  %s
MILD_ERR_MODIFY_REPLACE_INVALID_SYNTAX_NO_VALUE_744=When attempting to modify \
 entry %s to replace the set of values for attribute %s, one value was found to \
 be invalid according to the associated syntax:  %s
opends/src/messages/messages/core_ca_ES.properties
@@ -31,3 +31,11 @@
INFO_ERGONOMIC_SIZING_OF_WORKER_THREAD_POOL_720=No s'ha especificat cap mida de conjunt de fils d'execuci\u00f3 de la cua de treball: re-dimensionat autom\u00e0ticament a utilitzar %d fils d'execuci\u00f3
SEVERE_ERR_CRYPTOMGR_FAILED_INSTANCE_CERTIFICATE_NULL_721=L'entrada CryptoManager "%s" (inst\u00e0ncia-parell-claus certificat-clau-p\u00fablica) no cont\u00e9 un certificat de clau-p\u00fablica
INFO_DSCORE_DESCRIPTION_TIMEOUT_722=Temps m\u00e0xim (ens segons) per esperar abans del retorn de la comanda (el servidor continua el proc\u00e9s d'arranc, independentment). Un valor de '0' indica una expiraci\u00f3 de temps infinita, la qual significa que la comanda \u00fanicament retorna quant el servidor ha completat l'arranc. El valor predeterminat es de 60 segons. Aquesta opci\u00f3 no pot ser utilitzada amb l'opci\u00f3 -N, --nodetach
SEVERE_WARN_ADD_OP_INVALID_SYNTAX_NO_VALUE_742=Entry "%s" contains a value for \
 attribute %s that is invalid according to the syntax for that attribute:  %s
MILD_ERR_MODIFY_ADD_INVALID_SYNTAX_NO_VALUE_743=When attempting to modify entry \
 %s, one value for attribute %s was found to be invalid according to the \
 associated syntax:  %s
MILD_ERR_MODIFY_REPLACE_INVALID_SYNTAX_NO_VALUE_744=When attempting to modify \
 entry %s to replace the set of values for attribute %s, one value was found to \
 be invalid according to the associated syntax:  %s
opends/src/messages/messages/core_de.properties
@@ -742,3 +742,6 @@
MILD_ERR_RDN_MISSING_ATTRIBUTE_VALUE_727=Die angegebene Zeichenfolge "%s" konnte nicht als ein relativer Distinguished Name entschl\u00fcsselt werden, da die angegebene Zeichenfolge keinen Wert f\u00fcr den Attributtyp "%s" enth\u00e4lt
MILD_ERR_CRYPTOMGR_INVALID_SYMMETRIC_KEY_LENGTH_728=CryptoManager konnte nicht gestartet werden, weil die angegebene Schl\u00fcssell\u00e4nge "%d" f\u00fcr die Verschl\u00fcsselung \u00fcber der zul\u00e4ssigen Verschl\u00fcsselungsst\u00e4rke "%d" in Jurisdiction Policy-Dateien liegt
MILD_ERR_DISK_SPACE_MONITOR_UPDATE_FAILED_729=Fehler beim Aktualisieren des freien Speicherplatzes f\u00fcr Verzeichnis %s: %s
SEVERE_WARN_ADD_OP_INVALID_SYNTAX_NO_VALUE_742=Eintrag "%s" enth\u00e4lt einen Wert f\u00fcr Attribut %s, das entsprechend der Syntax f\u00fcr dieses Attribut ung\u00fcltig ist:  %s
MILD_ERR_MODIFY_ADD_INVALID_SYNTAX_NO_VALUE_743=Beim Versuch, Eintrag %s zu \u00e4ndern und einen oder mehrere Werte f\u00fcr Attribut %s hinzuzuf\u00fcgen, wurde festgestellt, dass ein Wert nach der zugeordneten Syntax ung\u00fcltig ist:  %s
MILD_ERR_MODIFY_REPLACE_INVALID_SYNTAX_NO_VALUE_744=Beim Versuch, Eintrag %s zu \u00e4ndern und den Satz mit Werten f\u00fcr Attribut %s zu ersetzen, wurde festgestellt, dass ein Wert nach der zugeordneten Syntax ung\u00fcltig ist:  %s
opends/src/messages/messages/core_es.properties
@@ -742,3 +742,11 @@
MILD_ERR_RDN_MISSING_ATTRIBUTE_VALUE_727=No se puede decodificar la cadena proporcionada "%s" como un nombre distinguido relativo porque no contiene ning\u00fan valor para el tipo de atributo %s
MILD_ERR_CRYPTOMGR_INVALID_SYMMETRIC_KEY_LENGTH_728=CryptoManager no pudo inicializarse porque la longitud de la clave de cifrado de "%d" especificada supera la intensidad de criptograf\u00eda permitida de "%d" en los archivos de directiva de jurisdicci\u00f3n
MILD_ERR_DISK_SPACE_MONITOR_UPDATE_FAILED_729=No pudo actualizarse el espacio libre en el disco para el directorio %s: %s
SEVERE_WARN_ADD_OP_INVALID_SYNTAX_NO_VALUE_742=Entry "%s" contains a value for \
 attribute %s that is invalid according to the syntax for that attribute:  %s
MILD_ERR_MODIFY_ADD_INVALID_SYNTAX_NO_VALUE_743=When attempting to modify entry \
 %s, one value for attribute %s was found to be invalid according to the \
 associated syntax:  %s
MILD_ERR_MODIFY_REPLACE_INVALID_SYNTAX_NO_VALUE_744=When attempting to modify \
 entry %s to replace the set of values for attribute %s, one value was found to \
 be invalid according to the associated syntax:  %s
opends/src/messages/messages/core_fr.properties
@@ -742,3 +742,11 @@
MILD_ERR_RDN_MISSING_ATTRIBUTE_VALUE_727=Impossible de d\u00e9coder le cha\u00eene fournie "%s" en tant que nom distinctif relatif, car elle ne contient pas de valeur pour le type d'attribut %s
MILD_ERR_CRYPTOMGR_INVALID_SYMMETRIC_KEY_LENGTH_728=CryptoManager n'a pas r\u00e9ussi \u00e0 s'initialiser car la longueur de la cl\u00e9 de chiffrement sp\u00e9cifi\u00e9e "%d" est bien au-del\u00e0 de la force de chiffrement "%d" dans les fichiers de strat\u00e9gie de juridiction
MILD_ERR_DISK_SPACE_MONITOR_UPDATE_FAILED_729=\u00c9chec de la mise \u00e0 jour de l'espace disque libre dans le r\u00e9pertoire\u00a0%s: %s
SEVERE_WARN_ADD_OP_INVALID_SYNTAX_NO_VALUE_742=Entry "%s" contains a value for \
 attribute %s that is invalid according to the syntax for that attribute:  %s
MILD_ERR_MODIFY_ADD_INVALID_SYNTAX_NO_VALUE_743=When attempting to modify entry \
 %s, one value for attribute %s was found to be invalid according to the \
 associated syntax:  %s
MILD_ERR_MODIFY_REPLACE_INVALID_SYNTAX_NO_VALUE_744=When attempting to modify \
 entry %s to replace the set of values for attribute %s, one value was found to \
 be invalid according to the associated syntax:  %s
opends/src/messages/messages/core_ja.properties
@@ -743,3 +743,11 @@
MILD_ERR_RDN_MISSING_ATTRIBUTE_VALUE_727=\u6307\u5b9a\u3055\u308c\u305f\u6587\u5b57\u5217 "%s" \u3092\u76f8\u5bfe\u8b58\u5225\u540d\u3068\u3057\u3066\u5fa9\u53f7\u5316\u3067\u304d\u307e\u305b\u3093\u3002\u5c5e\u6027\u578b %s \u306e\u5024\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u305b\u3093
MILD_ERR_CRYPTOMGR_INVALID_SYMMETRIC_KEY_LENGTH_728=\u6307\u5b9a\u3055\u308c\u305f\u6697\u53f7\u5316\u30ad\u30fc\u306e\u9577\u3055 "%d" \u304c\u7ba1\u8f44\u30dd\u30ea\u30b7\u30fc\u30d5\u30a1\u30a4\u30eb\u5185\u3067\u8a31\u53ef\u3055\u308c\u308b\u6697\u53f7\u5316\u306e\u9577\u3055 "%d" \u3092\u8d85\u3048\u3066\u3044\u308b\u305f\u3081\u3001CryptoManager \u306f\u521d\u671f\u5316\u306b\u5931\u6557\u3057\u307e\u3057\u305f
MILD_ERR_DISK_SPACE_MONITOR_UPDATE_FAILED_729=\u30c7\u30a3\u30ec\u30af\u30c8\u30ea %s \u306e\u7a7a\u304d\u30c7\u30a3\u30b9\u30af\u5bb9\u91cf\u3092\u66f4\u65b0\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f: %s
SEVERE_WARN_ADD_OP_INVALID_SYNTAX_NO_VALUE_742=Entry "%s" contains a value for \
 attribute %s that is invalid according to the syntax for that attribute:  %s
MILD_ERR_MODIFY_ADD_INVALID_SYNTAX_NO_VALUE_743=When attempting to modify entry \
 %s, one value for attribute %s was found to be invalid according to the \
 associated syntax:  %s
MILD_ERR_MODIFY_REPLACE_INVALID_SYNTAX_NO_VALUE_744=When attempting to modify \
 entry %s to replace the set of values for attribute %s, one value was found to \
 be invalid according to the associated syntax:  %s
opends/src/messages/messages/core_ko.properties
@@ -736,3 +736,11 @@
SEVERE_ERR_CRYPTOMGR_FAILED_INSTANCE_CERTIFICATE_NULL_721=The CryptoManager entry "%s" (the instance-key-pair public-key-certificate) does not contain a public-key certificate
INFO_DSCORE_DESCRIPTION_TIMEOUT_722=Maximum time (in seconds) to wait before the command returns (the server continues the startup process, regardless). A value of '0' indicates an infinite timeout, which means that the command returns only when the server startup is completed. The default value is 60 seconds. This option cannot be used with the -N, --nodetach option
FATAL_ERR_DSCORE_ERROR_NODETACH_TIMEOUT_723=In no-detach mode, the 'timeout' option cannot be used
SEVERE_WARN_ADD_OP_INVALID_SYNTAX_NO_VALUE_742=Entry "%s" contains a value for \
 attribute %s that is invalid according to the syntax for that attribute:  %s
MILD_ERR_MODIFY_ADD_INVALID_SYNTAX_NO_VALUE_743=When attempting to modify entry \
 %s, one value for attribute %s was found to be invalid according to the \
 associated syntax:  %s
MILD_ERR_MODIFY_REPLACE_INVALID_SYNTAX_NO_VALUE_744=When attempting to modify \
 entry %s to replace the set of values for attribute %s, one value was found to \
 be invalid according to the associated syntax:  %s
opends/src/messages/messages/core_pl.properties
@@ -19,3 +19,11 @@
INFO_RESULT_OTHER_105=Inny
INFO_RESULT_SIZE_LIMIT_EXCEEDED_67=Przekroczony limit rozmiary
SEVERE_ERR_ADD_ENTRY_ALREADY_EXISTS_400=Wpis %s nie mo\u017ce zosta\u0107 dodatny, gdy\u017c wpis o takiej nazwie ju\u017c istnieje
SEVERE_WARN_ADD_OP_INVALID_SYNTAX_NO_VALUE_742=Entry "%s" contains a value for \
 attribute %s that is invalid according to the syntax for that attribute:  %s
MILD_ERR_MODIFY_ADD_INVALID_SYNTAX_NO_VALUE_743=When attempting to modify entry \
 %s, one value for attribute %s was found to be invalid according to the \
 associated syntax:  %s
MILD_ERR_MODIFY_REPLACE_INVALID_SYNTAX_NO_VALUE_744=When attempting to modify \
 entry %s to replace the set of values for attribute %s, one value was found to \
 be invalid according to the associated syntax:  %s
opends/src/messages/messages/core_zh_CN.properties
@@ -742,3 +742,11 @@
MILD_ERR_RDN_MISSING_ATTRIBUTE_VALUE_727=\u65e0\u6cd5\u5c06\u63d0\u4f9b\u7684\u5b57\u7b26\u4e32 "%s" \u89e3\u7801\u4e3a\u76f8\u5bf9\u6807\u8bc6\u540d\uff0c\u56e0\u4e3a\u5b83\u672a\u5305\u542b\u5c5e\u6027\u7c7b\u578b %s \u7684\u503c
MILD_ERR_CRYPTOMGR_INVALID_SYMMETRIC_KEY_LENGTH_728=CryptoManager \u65e0\u6cd5\u521d\u59cb\u5316\uff0c\u56e0\u4e3a\u6307\u5b9a\u7684\u52a0\u5bc6\u5668\u5bc6\u94a5\u957f\u5ea6 "%d" \u8d85\u8fc7\u7ba1\u8f96\u6743\u7b56\u7565\u6587\u4ef6\u4e2d\u5141\u8bb8\u7684\u52a0\u5bc6\u5f3a\u5ea6 "%d"
MILD_ERR_DISK_SPACE_MONITOR_UPDATE_FAILED_729=\u65e0\u6cd5\u66f4\u65b0\u76ee\u5f55 %s \u7684\u53ef\u7528\u78c1\u76d8\u7a7a\u95f4: %s
SEVERE_WARN_ADD_OP_INVALID_SYNTAX_NO_VALUE_742=Entry "%s" contains a value for \
 attribute %s that is invalid according to the syntax for that attribute:  %s
MILD_ERR_MODIFY_ADD_INVALID_SYNTAX_NO_VALUE_743=When attempting to modify entry \
 %s, one value for attribute %s was found to be invalid according to the \
 associated syntax:  %s
MILD_ERR_MODIFY_REPLACE_INVALID_SYNTAX_NO_VALUE_744=When attempting to modify \
 entry %s to replace the set of values for attribute %s, one value was found to \
 be invalid according to the associated syntax:  %s
opends/src/messages/messages/core_zh_TW.properties
@@ -737,3 +737,11 @@
SEVERE_ERR_CRYPTOMGR_FAILED_INSTANCE_CERTIFICATE_NULL_721=The CryptoManager entry "%s" (the instance-key-pair public-key-certificate) does not contain a public-key certificate
INFO_DSCORE_DESCRIPTION_TIMEOUT_722=Maximum time (in seconds) to wait before the command returns (the server continues the startup process, regardless). A value of '0' indicates an infinite timeout, which means that the command returns only when the server startup is completed. The default value is 60 seconds. This option cannot be used with the -N, --nodetach option
FATAL_ERR_DSCORE_ERROR_NODETACH_TIMEOUT_723=In no-detach mode, the 'timeout' option cannot be used
SEVERE_WARN_ADD_OP_INVALID_SYNTAX_NO_VALUE_742=Entry "%s" contains a value for \
 attribute %s that is invalid according to the syntax for that attribute:  %s
MILD_ERR_MODIFY_ADD_INVALID_SYNTAX_NO_VALUE_743=When attempting to modify entry \
 %s, one value for attribute %s was found to be invalid according to the \
 associated syntax:  %s
MILD_ERR_MODIFY_REPLACE_INVALID_SYNTAX_NO_VALUE_744=When attempting to modify \
 entry %s to replace the set of values for attribute %s, one value was found to \
 be invalid according to the associated syntax:  %s
opends/src/messages/messages/schema.properties
@@ -1067,3 +1067,9 @@
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXPECTED_QUOTE_AT_POS_329=The provided value \
 "%s" could not be parsed as an ldap syntax description because a single \
 quote was expected at position %d but the character %s was found instead
SEVERE_ERR_SYNTAX_CERTIFICATE_NOTVALID_330=The provided value is not a valid \
 X.509 Certificate
SEVERE_ERR_SYNTAX_CERTIFICATE_INVALID_VERSION_331=The provided value is not \
 a valid X.509 Certificate because it contains an invalid version number (%d)
SEVERE_ERR_SYNTAX_CERTIFICATE_INVALID_DER_332=The provided value is not a valid \
 X.509 Certificate because it contains invalid DER encodings
opends/src/messages/messages/schema_de.properties
@@ -376,3 +376,6 @@
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXTENSION_INVALID_CHARACTER_327=The provided value "%s" could not be parsed as an ldap syntax extension because an invalid character was found at position %d
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXPECTED_CLOSE_PARENTHESIS_328=The provided value "%s" could not be parsed as an ldap syntax description because a close parenthesis was expected at position %d but instead a '%s' character was found
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXPECTED_QUOTE_AT_POS_329=The provided value "%s" could not be parsed as an ldap syntax description because a single quote was expected at position %d but the character %s was found instead
SEVERE_ERR_SYNTAX_CERTIFICATE_NOTVALID_330=Der angegebene Wert ist kein g\u00fcltiges X.509 Zertifikat
SEVERE_ERR_SYNTAX_CERTIFICATE_INVALID_VERSION_331=Der angegebene Wert ist kein g\u00fcltiges X.509 Zertifikat, da es eine ung\u00fcltige Versionsnummer beinhaltet (%d)
SEVERE_ERR_SYNTAX_CERTIFICATE_INVALID_DER_332=Der angegebene Wert ist kein g\u00fcltiges X.509 Zertifikat, da es ung\u00fcltige DER Kodierungen beinhaltet
opends/src/messages/messages/schema_es.properties
@@ -376,3 +376,9 @@
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXTENSION_INVALID_CHARACTER_327=No se pudo analizar el valor proporcionado "%s" como sintaxis LDAP porque se encontr\u00f3 un car\u00e1cter no v\u00e1lido en la posici\u00f3n %d
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXPECTED_CLOSE_PARENTHESIS_328=No se pudo analizar el valor proporcionado "%s" como sintaxis LDAP porque conten\u00eda un par\u00e9ntesis de cierre inesperado en la posici\u00f3n %d
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXPECTED_QUOTE_AT_POS_329=No se pudo analizar el valor proporcionado "%s" como sintaxis LDAP porque, en lugar de la comilla sencilla esperada en la posici\u00f3n %d, se encontr\u00f3 el car\u00e1cter %s
SEVERE_ERR_SYNTAX_CERTIFICATE_NOTVALID_330=The provided value is not a valid \
 X.509 Certificate
SEVERE_ERR_SYNTAX_CERTIFICATE_INVALID_VERSION_331=The provided value is not \
 a valid X.509 Certificate because it contains an invalid version number (%d)
SEVERE_ERR_SYNTAX_CERTIFICATE_INVALID_DER_332=The provided value is not a valid \
 X.509 Certificate because it contains invalid DER encodings
opends/src/messages/messages/schema_fr.properties
@@ -376,3 +376,9 @@
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXTENSION_INVALID_CHARACTER_327=Impossible d'analyser la valeur indiqu\u00e9e "%s" en tant qu'extension de syntaxe ldap car un caract\u00e8re invalide se trouve \u00e0 la position %d
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXPECTED_CLOSE_PARENTHESIS_328=Impossible d'analyser la valeur indiqu\u00e9e "%s" en tant que syntaxe ldap car elle contient une parenth\u00e8se de fermeture inattendue \u00e0 la position %d
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXPECTED_QUOTE_AT_POS_329=Impossible d'analyser la valeur fournie ("%s") en tant que syntaxe ldap car une apostrophe devrait se trouver \u00e0 la position %d au lieu du caract\u00e8re %s
SEVERE_ERR_SYNTAX_CERTIFICATE_NOTVALID_330=The provided value is not a valid \
 X.509 Certificate
SEVERE_ERR_SYNTAX_CERTIFICATE_INVALID_VERSION_331=The provided value is not \
 a valid X.509 Certificate because it contains an invalid version number (%d)
SEVERE_ERR_SYNTAX_CERTIFICATE_INVALID_DER_332=The provided value is not a valid \
 X.509 Certificate because it contains invalid DER encodings
opends/src/messages/messages/schema_ja.properties
@@ -376,3 +376,9 @@
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXTENSION_INVALID_CHARACTER_327=The provided value "%s" could not be parsed as an ldap syntax extension because an invalid character was found at position %d
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXPECTED_CLOSE_PARENTHESIS_328=The provided value "%s" could not be parsed as an ldap syntax description because a close parenthesis was expected at position %d but instead a '%s' character was found
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXPECTED_QUOTE_AT_POS_329=The provided value "%s" could not be parsed as an ldap syntax description because a single quote was expected at position %d but the character %s was found instead
SEVERE_ERR_SYNTAX_CERTIFICATE_NOTVALID_330=The provided value is not a valid \
 X.509 Certificate
SEVERE_ERR_SYNTAX_CERTIFICATE_INVALID_VERSION_331=The provided value is not \
 a valid X.509 Certificate because it contains an invalid version number (%d)
SEVERE_ERR_SYNTAX_CERTIFICATE_INVALID_DER_332=The provided value is not a valid \
 X.509 Certificate because it contains invalid DER encodings
opends/src/messages/messages/schema_ko.properties
@@ -377,3 +377,9 @@
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXTENSION_INVALID_CHARACTER_327=The provided value "%s" could not be parsed as an ldap syntax extension because an invalid character was found at position %d
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXPECTED_CLOSE_PARENTHESIS_328=The provided value "%s" could not be parsed as an ldap syntax description because a close parenthesis was expected at position %d but instead a '%s' character was found
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXPECTED_QUOTE_AT_POS_329=The provided value "%s" could not be parsed as an ldap syntax description because a single quote was expected at position %d but the character %s was found instead
SEVERE_ERR_SYNTAX_CERTIFICATE_NOTVALID_330=The provided value is not a valid \
 X.509 Certificate
SEVERE_ERR_SYNTAX_CERTIFICATE_INVALID_VERSION_331=The provided value is not \
 a valid X.509 Certificate because it contains an invalid version number (%d)
SEVERE_ERR_SYNTAX_CERTIFICATE_INVALID_DER_332=The provided value is not a valid \
 X.509 Certificate because it contains invalid DER encodings
opends/src/messages/messages/schema_zh_CN.properties
@@ -376,3 +376,9 @@
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXTENSION_INVALID_CHARACTER_327=The provided value "%s" could not be parsed as an ldap syntax extension because an invalid character was found at position %d
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXPECTED_CLOSE_PARENTHESIS_328=The provided value "%s" could not be parsed as an ldap syntax description because a close parenthesis was expected at position %d but instead a '%s' character was found
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXPECTED_QUOTE_AT_POS_329=The provided value "%s" could not be parsed as an ldap syntax description because a single quote was expected at position %d but the character %s was found instead
SEVERE_ERR_SYNTAX_CERTIFICATE_NOTVALID_330=The provided value is not a valid \
 X.509 Certificate
SEVERE_ERR_SYNTAX_CERTIFICATE_INVALID_VERSION_331=The provided value is not \
 a valid X.509 Certificate because it contains an invalid version number (%d)
SEVERE_ERR_SYNTAX_CERTIFICATE_INVALID_DER_332=The provided value is not a valid \
 X.509 Certificate because it contains invalid DER encodings
opends/src/messages/messages/schema_zh_TW.properties
@@ -377,3 +377,9 @@
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXTENSION_INVALID_CHARACTER_327=The provided value "%s" could not be parsed as an ldap syntax extension because an invalid character was found at position %d
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXPECTED_CLOSE_PARENTHESIS_328=The provided value "%s" could not be parsed as an ldap syntax description because a close parenthesis was expected at position %d but instead a '%s' character was found
MILD_ERR_ATTR_SYNTAX_LDAPSYNTAX_EXPECTED_QUOTE_AT_POS_329=The provided value "%s" could not be parsed as an ldap syntax description because a single quote was expected at position %d but the character %s was found instead
SEVERE_ERR_SYNTAX_CERTIFICATE_NOTVALID_330=The provided value is not a valid \
 X.509 Certificate
SEVERE_ERR_SYNTAX_CERTIFICATE_INVALID_VERSION_331=The provided value is not \
 a valid X.509 Certificate because it contains an invalid version number (%d)
SEVERE_ERR_SYNTAX_CERTIFICATE_INVALID_DER_332=The provided value is not a valid \
 X.509 Certificate because it contains invalid DER encodings
opends/src/server/org/opends/server/api/AttributeSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions copyright 2012 ForgeRock AS.
 */
package org.opends.server.api;
import org.opends.messages.Message;
@@ -215,15 +216,24 @@
  /**
   * Indicates whether this attribute syntax is a binary one.
   * @return  {@code true} if it is a binary syntax rule
   *          , or {@code false} if not.
   * Indicates whether this attribute syntax requires BER encoding.
   *
   * @return {@code true} if this syntax required BER encoding.
   */
  public abstract boolean isBinary();
  /**
   * Indicates whether this attribute syntax is human readable.
   *
   * @return {@code true} if this syntax is human readable.
   */
  public abstract boolean isHumanReadable();
  /**
   * Retrieves the hash code for this attribute syntax.  It will be
   * calculated as the sum of the characters in the OID.
   *
@@ -273,7 +283,7 @@
      return false;
    }
    return getOID().equals(((AttributeSyntax) o).getOID());
    return getOID().equals(((AttributeSyntax<?>) o).getOID());
  }
opends/src/server/org/opends/server/protocols/asn1/ASN1ByteChannelReader.java
@@ -23,7 +23,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions copyright 2011 ForgeRock AS.
 *      Portions copyright 2011-2012 ForgeRock AS.
 */
package org.opends.server.protocols.asn1;
@@ -405,6 +405,13 @@
  /**
   * {@inheritDoc}
   */
  public void readEndExplicitTag() throws ASN1Exception {
    reader.readEndExplicitTag();
  }
  /**
   * {@inheritDoc}
   */
  public void readEndSequence() throws ASN1Exception {
    reader.readEndSequence();
  }
@@ -468,6 +475,13 @@
  /**
   * {@inheritDoc}
   */
  public void readStartExplicitTag() throws ASN1Exception {
    reader.readStartExplicitTag();
  }
  /**
   * {@inheritDoc}
   */
  public void readStartSequence() throws ASN1Exception {
    reader.readStartSequence();
  }
opends/src/server/org/opends/server/protocols/asn1/ASN1ByteSequenceReader.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2012 Forgerock AS
 */
package org.opends.server.protocols.asn1;
@@ -460,6 +461,16 @@
  /**
   * {@inheritDoc}
   */
  public void readStartExplicitTag() throws ASN1Exception
  {
    // From an implementation point of view, an explicit tag is equivalent to a
    // sequence, as it is a constructed type.
    readStartSequence();
  }
  /**
   * {@inheritDoc}
   */
  public void readStartSet() throws ASN1Exception
  {
    // From an implementation point of view, a set is equivalent to a
@@ -493,6 +504,16 @@
  /**
   * {@inheritDoc}
   */
  public void readEndExplicitTag() throws ASN1Exception
  {
    // From an implementation point of view, an explicit tag is equivalent to a
    // sequence, as it is also a constructed type.
    readEndSequence();
  }
  /**
   * {@inheritDoc}
   */
  public void readEndSet() throws ASN1Exception
  {
    // From an implementation point of view, a set is equivalent to a
opends/src/server/org/opends/server/protocols/asn1/ASN1Constants.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 Forgerock AS
 */
package org.opends.server.protocols.asn1;
@@ -54,6 +55,13 @@
  /**
   * The BER type that is assigned to the universal bit string type.
   */
  public static final byte UNIVERSAL_BIT_STRING_TYPE = 0x03;
  /**
   * The BER type that is assigned to the universal octet string type.
   */
  public static final byte UNIVERSAL_OCTET_STRING_TYPE = 0x04;
opends/src/server/org/opends/server/protocols/asn1/ASN1InputStreamReader.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.protocols.asn1;
@@ -747,6 +748,16 @@
  /**
   * {@inheritDoc}
   */
  public void readStartExplicitTag() throws ASN1Exception
  {
    // From an implementation point of view, an explicit tag is equivalent to a
    // sequence, as it is also a constructed type.
    readStartSequence();
  }
  /**
   * {@inheritDoc}
   */
  public void readStartSet() throws ASN1Exception
  {
    // From an implementation point of view, a set is equivalent to a
@@ -796,6 +807,16 @@
  /**
   * {@inheritDoc}
   */
  public void readEndExplicitTag() throws ASN1Exception
  {
    // From an implementation point of view, an explicit tag is equivalent to a
    // sequence, as it is also a constructed type.
    readEndSequence();
  }
  /**
   * {@inheritDoc}
   */
  public void readEndSet() throws ASN1Exception
  {
    // From an implementation point of view, a set is equivalent to a
opends/src/server/org/opends/server/protocols/asn1/ASN1Reader.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2012 Forgerock AS
 */
package org.opends.server.protocols.asn1;
@@ -116,6 +117,18 @@
  /**
   * Finishes reading an explicit tag. Any elements not read in the
   * explicit tag will be discarded.
   *
   * @throws ASN1Exception
   *           If an error occurs while advancing to the end of the
   *           explicit tag.
   */
  void readEndExplicitTag() throws ASN1Exception;
  /**
   * Finishes reading a sequence. Any elements not read in the
   * sequence will be discarded.
   *
@@ -234,6 +247,18 @@
  /**
   * Reads the next ASN.1 element as an explicit tag. All further
   * reads will read the elements in the explicit tag until
   * {@link #readEndExplicitTag()} is called.
   *
   * @throws ASN1Exception
   *           If the next element is not an explicit tag.
   */
  void readStartExplicitTag() throws ASN1Exception;
  /**
   * Reads the next ASN.1 element as a sequence. All further reads
   * will read the elements in the sequence until
   * {@link #readEndSequence()} is called.
opends/src/server/org/opends/server/schema/AciSyntax.java
@@ -23,7 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 *      Portions Copyright 2011-2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -250,5 +250,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/AttributeTypeSyntax.java
@@ -23,7 +23,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 *      Portions Copyright 2011-2012 ForgeRock AS
 */
package org.opends.server.schema;
import org.opends.messages.Message;
@@ -448,7 +448,7 @@
    List<String> typeNames = new LinkedList<String>();
    String description = null;
    AttributeType superiorType = null;
    AttributeSyntax syntax = DirectoryServer.getDefaultAttributeSyntax();
    AttributeSyntax<?> syntax = DirectoryServer.getDefaultAttributeSyntax();
    ApproximateMatchingRule approximateMatchingRule = null;
    EqualityMatchingRule equalityMatchingRule = null;
    OrderingMatchingRule orderingMatchingRule = null;
@@ -1605,4 +1605,14 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/AuthPasswordSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions copyright 2012 ForgeRock AS.
 */
package org.opends.server.schema;
import org.opends.messages.Message;
@@ -512,5 +513,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/BinarySyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -249,5 +250,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return false;
  }
}
opends/src/server/org/opends/server/schema/BitStringSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -252,5 +253,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/BooleanSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
import org.opends.messages.Message;
@@ -293,5 +294,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/CertificateListSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -236,5 +237,15 @@
  {
    return true;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return false;
  }
}
opends/src/server/org/opends/server/schema/CertificatePairSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -236,5 +237,15 @@
  {
    return true;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return false;
  }
}
opends/src/server/org/opends/server/schema/CertificateSyntax.java
@@ -23,12 +23,16 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 Forgerock AS
 */
package org.opends.server.schema;
import org.opends.server.admin.std.server.AttributeSyntaxCfg;
import java.util.List;
import org.opends.server.admin.server.ConfigurationChangeListener;
import org.opends.server.admin.std.server.CertificateAttributeSyntaxCfg;
import org.opends.server.api.ApproximateMatchingRule;
import org.opends.server.api.AttributeSyntax;
import org.opends.server.api.EqualityMatchingRule;
@@ -37,12 +41,20 @@
import org.opends.server.config.ConfigException;
import org.opends.server.core.DirectoryServer;
import org.opends.server.types.ByteSequence;
import org.opends.server.types.ConfigChangeResult;
import org.opends.server.types.ResultCode;
import org.opends.server.protocols.asn1.ASN1;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1Reader;
import static org.opends.server.loggers.ErrorLogger.*;
import static org.opends.messages.SchemaMessages.*;
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import static org.opends.server.schema.SchemaConstants.*;
import static org.opends.server.protocols.asn1.ASN1Constants.*;
/**
@@ -51,7 +63,8 @@
 * bytes.  It will be treated much like the octet string attribute syntax.
 */
public class CertificateSyntax
       extends AttributeSyntax<AttributeSyntaxCfg>
       extends AttributeSyntax<CertificateAttributeSyntaxCfg>
       implements ConfigurationChangeListener<CertificateAttributeSyntaxCfg>
{
  // The default equality matching rule for this syntax.
  private EqualityMatchingRule defaultEqualityMatchingRule;
@@ -62,6 +75,9 @@
  // The default substring matching rule for this syntax.
  private SubstringMatchingRule defaultSubstringMatchingRule;
  // The current configuration.
  private volatile CertificateAttributeSyntaxCfg config;
  /**
@@ -80,7 +96,7 @@
  /**
   * {@inheritDoc}
   */
  public void initializeSyntax(AttributeSyntaxCfg configuration)
  public void initializeSyntax(CertificateAttributeSyntaxCfg configuration)
         throws ConfigException
  {
    defaultEqualityMatchingRule =
@@ -106,6 +122,34 @@
      logError(ERR_ATTR_SYNTAX_UNKNOWN_SUBSTRING_MATCHING_RULE.get(
          SMR_OCTET_STRING_OID, SYNTAX_CERTIFICATE_NAME));
    }
    this.config = configuration;
    config.addCertificateChangeListener(this);
  }
  /**
   * {@inheritDoc}
   */
  public boolean isConfigurationChangeAcceptable(
      CertificateAttributeSyntaxCfg configuration,
      List<Message> unacceptableReasons)
  {
    // The configuration is always acceptable.
    return true;
  }
  /**
   * {@inheritDoc}
   */
  public ConfigChangeResult applyConfigurationChange(
      CertificateAttributeSyntaxCfg configuration)
  {
    this.config = configuration;
    return new ConfigChangeResult(ResultCode.SUCCESS, false);
  }
@@ -222,7 +266,215 @@
  public boolean valueIsAcceptable(ByteSequence value,
                                   MessageBuilder invalidReason)
  {
    // All values will be acceptable for the certificate syntax.
    // Skip validation if strict validation is disabled.
    if (!config.isStrictFormat())
    {
      return true;
    }
    // Validate the ByteSequence against the definitions of X.509, clause 7
    long x509Version=0;
    ASN1Reader reader = ASN1.getReader(value);
    try
    {
      // Certificate SIGNED SEQUENCE
      if (!reader.hasNextElement() ||
          reader.peekType() != UNIVERSAL_SEQUENCE_TYPE)
      {
        invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
        return false;
      }
      reader.readStartSequence();
      // CertificateContent SEQUENCE
      if (!reader.hasNextElement() ||
          reader.peekType() != UNIVERSAL_SEQUENCE_TYPE)
      {
        invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
        return false;
      }
      reader.readStartSequence();
      // Optional Version
      if (reader.hasNextElement() &&
          reader.peekType() == (TYPE_MASK_CONTEXT | TYPE_MASK_CONSTRUCTED))
      {
        reader.readStartExplicitTag();
        if (!reader.hasNextElement() ||
            reader.peekType() != UNIVERSAL_INTEGER_TYPE)
        {
          invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
          return false;
        }
        x509Version=reader.readInteger();
        if (x509Version < 0 || x509Version >2)
        {
          // invalid Version specified
          invalidReason.append(ERR_SYNTAX_CERTIFICATE_INVALID_VERSION
            .get(x509Version));
          return false;
        }
        if (x509Version == 0)
        {
          // DEFAULT values shall not be included in DER encoded SEQUENCE
          // (X.690, 11.5)
          invalidReason.append(ERR_SYNTAX_CERTIFICATE_INVALID_DER.get());
          return false;
        }
        reader.readEndExplicitTag();
      }
      // serialNumber
      if (!reader.hasNextElement() ||
          reader.peekType() != UNIVERSAL_INTEGER_TYPE)
      {
        invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
        return false;
      }
      reader.skipElement();
      // signature AlgorithmIdentifier
      if (!reader.hasNextElement() ||
          reader.peekType() != UNIVERSAL_SEQUENCE_TYPE)
      {
        invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
        return false;
      }
      reader.skipElement();
      // issuer name (SEQUENCE as of X.501, 9.2)
      if (!reader.hasNextElement() ||
          reader.peekType() != UNIVERSAL_SEQUENCE_TYPE)
      {
        invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
        return false;
      }
      reader.skipElement();
      // validity (SEQUENCE)
      if (!reader.hasNextElement() ||
          reader.peekType() != UNIVERSAL_SEQUENCE_TYPE)
      {
        invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
        return false;
      }
      reader.skipElement();
      // subject name (SEQUENCE as of X.501, 9.2)
      if (!reader.hasNextElement() ||
          reader.peekType() != UNIVERSAL_SEQUENCE_TYPE)
      {
        invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
        return false;
      }
      reader.skipElement();
      // SubjectPublicKeyInfo (SEQUENCE)
      if (!reader.hasNextElement() ||
          reader.peekType() != UNIVERSAL_SEQUENCE_TYPE)
      {
        invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
        return false;
      }
      reader.skipElement();
      // OPTIONAL issuerUniqueIdentifier
      if (reader.hasNextElement() &&
          reader.peekType() == (TYPE_MASK_CONTEXT + 1))
      {
        if (x509Version < 1)
        {
          // only valid in v2 and v3
          invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
          return false;
        }
        reader.skipElement();
      }
      // OPTIONAL subjectUniqueIdentifier
      if (reader.hasNextElement() &&
          reader.peekType() == (TYPE_MASK_CONTEXT + 2))
      {
        if (x509Version < 1)
        {
          // only valid in v2 and v3
          invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
          return false;
        }
        reader.skipElement();
      }
      // OPTIONAL extensions
      if (reader.hasNextElement() &&
          reader.peekType() == ((TYPE_MASK_CONTEXT|TYPE_MASK_CONSTRUCTED) + 3))
      {
        if (x509Version < 2)
        {
          // only valid in v3
          invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
          return false;
        }
        reader.readStartExplicitTag(); // read Tag
        if (!reader.hasNextElement() ||
            reader.peekType() != UNIVERSAL_SEQUENCE_TYPE)
        {
          // only valid in v3
          invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
          return false;
        }
        reader.readEndExplicitTag(); // read end Tag
      }
      // There should not be any further ASN.1 elements within this SEQUENCE
      if (reader.hasNextElement())
      {
        invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
        return false;
      }
      reader.readEndSequence(); // End CertificateContent SEQUENCE
      // AlgorithmIdentifier SEQUENCE
      if (!reader.hasNextElement() ||
          reader.peekType() != UNIVERSAL_SEQUENCE_TYPE)
      {
        invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
        return false;
      }
      reader.skipElement();
      // ENCRYPTED HASH BIT STRING
      if (!reader.hasNextElement() ||
          reader.peekType() != UNIVERSAL_BIT_STRING_TYPE)
      {
        invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
        return false;
      }
      reader.skipElement();
      // There should not be any further ASN.1 elements within this SEQUENCE
      if (reader.hasNextElement())
      {
        invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
        return false;
      }
      reader.readEndSequence(); // End Certificate SEQUENCE
      // There should not be any further ASN.1 elements
      if (reader.hasNextElement())
      {
        invalidReason.append(ERR_SYNTAX_CERTIFICATE_NOTVALID.get());
        return false;
      }
      // End of the certificate
    }
    catch (ASN1Exception e)
    {
      System.out.println(e.getMessageObject());
      invalidReason.append(e.getMessageObject());
      return false;
    }
    // The basic structure of the value is an X.509 certificate
    return true;
  }
@@ -235,5 +487,15 @@
  {
    return true;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return false;
  }
}
opends/src/server/org/opends/server/schema/CountryStringSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -265,5 +266,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/DITContentRuleSyntax.java
@@ -23,7 +23,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 *      Portions Copyright 2011-2012 ForgeRock AS
 */
package org.opends.server.schema;
import org.opends.messages.Message;
@@ -1484,5 +1484,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/DITStructureRuleSyntax.java
@@ -23,7 +23,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 *      Portions Copyright 2011-2012 ForgeRock AS
 */
package org.opends.server.schema;
import org.opends.messages.Message;
@@ -1231,5 +1231,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/DeliveryMethodSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -311,5 +312,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/DirectoryStringSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
import org.opends.messages.Message;
@@ -355,5 +356,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/DistinguishedNameSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -279,5 +280,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/EnhancedGuideSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -312,5 +313,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/FaxNumberSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -367,5 +368,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/FaxSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -235,5 +236,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return false;
  }
}
opends/src/server/org/opends/server/schema/GeneralizedTimeSyntax.java
@@ -24,6 +24,7 @@
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2009 D. J. Hagberg, Millibits Consulting, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -1653,5 +1654,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/GuideSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -556,5 +557,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/IA5StringSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
import org.opends.messages.Message;
@@ -262,5 +263,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/IntegerSyntax.java
@@ -394,5 +394,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/JPEGSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -235,5 +236,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return false;
  }
}
opends/src/server/org/opends/server/schema/LDAPSyntaxDescriptionSyntax.java
@@ -23,7 +23,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 *      Portions Copyright 2011-2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -473,7 +473,7 @@
        StringBuilder woidBuffer = new StringBuilder();
        pos = readQuotedString(valueStr, woidBuffer, pos);
        String syntaxOID = toLowerCase(woidBuffer.toString());
        AttributeSyntax subSyntax = schema.getSyntax(syntaxOID);
        AttributeSyntax<?> subSyntax = schema.getSyntax(syntaxOID);
        if (subSyntax == null)
        {
          Message message = ERR_ATTR_SYNTAX_LDAPSYNTAX_UNKNOWN_SYNTAX.get(
@@ -933,6 +933,16 @@
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
  /**
   * This class provides a substitution mechanism where one unimplemented
   * syntax can be substituted by another defined syntax. A substitution syntax
   * is an LDAPSyntaxDescriptionSyntax with X-SUBST extension.
@@ -941,7 +951,7 @@
          LDAPSyntaxDescriptionSyntax
  {
    // The syntax that will subsittute the unimplemented syntax.
    private AttributeSyntax subSyntax;
    private AttributeSyntax<?> subSyntax;
    // The description of this syntax.
    private String description;
@@ -956,7 +966,7 @@
    //Creates a new instance of this syntax.
    private SubstitutionSyntax(AttributeSyntax subSyntax,
    private SubstitutionSyntax(AttributeSyntax<?> subSyntax,
            String definition,
            String description,
            String oid)
opends/src/server/org/opends/server/schema/MatchingRuleSyntax.java
@@ -23,7 +23,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 *      Portions Copyright 2011-2012 ForgeRock AS
 */
package org.opends.server.schema;
import org.opends.messages.Message;
@@ -396,7 +396,7 @@
    // for everything else we might need to know.
    ConcurrentHashMap<String,String> names =
         new ConcurrentHashMap<String,String>();
    AttributeSyntax syntax = null;
    AttributeSyntax<?> syntax = null;
    ConcurrentHashMap<String,CopyOnWriteArrayList<String>> extraProperties =
         new ConcurrentHashMap<String,CopyOnWriteArrayList<String>>();
@@ -1186,5 +1186,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/MatchingRuleUseSyntax.java
@@ -23,7 +23,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 *      Portions Copyright 2011-2012 ForgeRock AS
 */
package org.opends.server.schema;
import org.opends.messages.Message;
@@ -1176,5 +1176,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/NameAndOptionalUIDSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -298,5 +299,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/NameFormSyntax.java
@@ -23,7 +23,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 *      Portions Copyright 2011-2012 ForgeRock AS
 */
package org.opends.server.schema;
import org.opends.messages.Message;
@@ -1291,5 +1291,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/NumericStringSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -262,5 +263,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/OIDSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -226,5 +227,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/ObjectClassSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
import org.opends.messages.Message;
@@ -1514,5 +1515,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/OctetStringSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -235,5 +236,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return false;
  }
}
opends/src/server/org/opends/server/schema/OtherMailboxSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -302,5 +303,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/PostalAddressSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -227,5 +228,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/PresentationAddressSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -245,5 +246,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/PrintableStringSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -284,5 +285,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/ProtocolInformationSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -245,5 +246,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/SubstringAssertionSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -272,5 +273,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/SubtreeSpecificationSyntax.java
@@ -23,7 +23,7 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions copyright 2011 ForgeRock AS
 *      Portions copyright 2011-2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -273,4 +273,14 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/SupportedAlgorithmSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -236,5 +237,15 @@
  {
    return true;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return false;
  }
}
opends/src/server/org/opends/server/schema/TelephoneNumberSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
import org.opends.messages.Message;
@@ -387,5 +388,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/TeletexTerminalIdentifierSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -400,5 +401,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/TelexNumberSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -356,5 +357,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/UTCTimeSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -894,5 +895,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/UUIDSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
@@ -291,5 +292,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/schema/UserPasswordSyntax.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 ForgeRock AS
 */
package org.opends.server.schema;
import org.opends.messages.Message;
@@ -343,5 +344,15 @@
  {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isHumanReadable()
  {
    return true;
  }
}
opends/src/server/org/opends/server/types/AttributeType.java
@@ -23,7 +23,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 *      Portions Copyright 2011-2012 ForgeRock AS
 */
package org.opends.server.types;
@@ -80,7 +80,7 @@
  private final ApproximateMatchingRule approximateMatchingRule;
  // The syntax for this attribute type.
  private final AttributeSyntax syntax;
  private final AttributeSyntax<?> syntax;
  // The superior attribute type from which this attribute type
  // inherits.
@@ -179,7 +179,7 @@
                       Collection<String> typeNames,
                       String oid, String description,
                       AttributeType superiorType,
                       AttributeSyntax syntax,
                       AttributeSyntax<?> syntax,
                       AttributeUsage attributeUsage,
                       boolean isCollective,
                       boolean isNoUserModification,
@@ -258,7 +258,7 @@
                       Collection<String> typeNames,
                       String oid, String description,
                       AttributeType superiorType,
                       AttributeSyntax syntax,
                       AttributeSyntax<?> syntax,
                       ApproximateMatchingRule
                            approximateMatchingRule,
                       EqualityMatchingRule equalityMatchingRule,
@@ -514,7 +514,7 @@
   *
   * @return  The syntax for this attribute type.
   */
  public AttributeSyntax getSyntax()
  public AttributeSyntax<?> getSyntax()
  {
    return syntax;
  }
@@ -522,9 +522,9 @@
  /**
   * Indicates whether this attribute syntax is a binary one.
   * @return  {@code true} if it is a binary syntax rule
   *          , or {@code false} if not.
   * Indicates whether this attribute syntax requires BER encoding.
   *
   * @return {@code true} if this syntax required BER encoding.
   */
  public boolean isBinary()
  {
@@ -534,6 +534,18 @@
  /**
   * Indicates whether this attribute syntax is human readable.
   *
   * @return {@code true} if this syntax is human readable.
   */
  public boolean isHumanReadable()
  {
    return syntax.isHumanReadable();
  }
  /**
   * Retrieves the OID for this syntax associated with this attribute
   * type.
   *
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java
@@ -1259,15 +1259,30 @@
                {
                  if (! syntax.valueIsAcceptable(v.getValue(), invalidReason))
                  {
                    Message message = WARN_ADD_OP_INVALID_SYNTAX.get(
                    if (!syntax.isHumanReadable() || syntax.isBinary())
                    {
                      // Value is not human-readable
                      Message message = WARN_ADD_OP_INVALID_SYNTAX_NO_VALUE.get(
                                        String.valueOf(entryDN),
                                        String.valueOf(a.getName()),
                                        String.valueOf(invalidReason));
                      throw new DirectoryException(
                                   ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                   message);
                    }
                    else
                    {
                      Message message = WARN_ADD_OP_INVALID_SYNTAX.get(
                                        String.valueOf(entryDN),
                                        String.valueOf(v.getValue().toString()),
                                        String.valueOf(a.getName()),
                                        String.valueOf(invalidReason));
                    throw new DirectoryException(
                      throw new DirectoryException(
                                   ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                   message);
                    }
                  }
                }
              }
@@ -1287,15 +1302,30 @@
                  if (! syntax.valueIsAcceptable(v.getValue(),
                                                 invalidReason))
                  {
                    Message message = WARN_ADD_OP_INVALID_SYNTAX.
                    if (!syntax.isHumanReadable() || syntax.isBinary())
                    {
                      // Value is not human-readable
                      Message message = WARN_ADD_OP_INVALID_SYNTAX_NO_VALUE.
                        get(String.valueOf(entryDN),
                            String.valueOf(a.getName()),
                            String.valueOf(invalidReason));
                      throw new DirectoryException(
                                   ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                   message);
                    }
                    else
                    {
                      Message message = WARN_ADD_OP_INVALID_SYNTAX.
                        get(String.valueOf(entryDN),
                            String.valueOf(v.getValue().toString()),
                            String.valueOf(a.getName()),
                            String.valueOf(invalidReason));
                    throw new DirectoryException(
                      throw new DirectoryException(
                                   ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                   message);
                    }
                  }
                }
              }
@@ -1319,11 +1349,22 @@
                  if (! syntax.valueIsAcceptable(v.getValue(),
                                                 invalidReason))
                  {
                    logError(WARN_ADD_OP_INVALID_SYNTAX.get(
                    if (!syntax.isHumanReadable() || syntax.isBinary())
                    {
                      // Value is not human-readable
                      logError(WARN_ADD_OP_INVALID_SYNTAX_NO_VALUE.get(
                                  String.valueOf(entryDN),
                                  String.valueOf(a.getName()),
                                  String.valueOf(invalidReason)));
                    }
                    else
                    {
                      logError(WARN_ADD_OP_INVALID_SYNTAX.get(
                                  String.valueOf(entryDN),
                                  String.valueOf(v.getValue().toString()),
                                  String.valueOf(a.getName()),
                                  String.valueOf(invalidReason)));
                    }
                  }
                }
              }
@@ -1342,11 +1383,22 @@
                  if (! syntax.valueIsAcceptable(v.getValue(),
                                                 invalidReason))
                  {
                    logError(WARN_ADD_OP_INVALID_SYNTAX.get(
                    if (!syntax.isHumanReadable() || syntax.isBinary())
                    {
                      // Value is not human-readable
                      logError(WARN_ADD_OP_INVALID_SYNTAX_NO_VALUE.get(
                                  String.valueOf(entryDN),
                                  String.valueOf(a.getName()),
                                  String.valueOf(invalidReason)));
                    }
                    else
                    {
                      logError(WARN_ADD_OP_INVALID_SYNTAX.get(
                                  String.valueOf(entryDN),
                                  String.valueOf(v.getValue().toString()),
                                  String.valueOf(a.getName()),
                                  String.valueOf(invalidReason)));
                    }
                  }
                }
              }
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
@@ -1492,9 +1492,19 @@
        {
          if (!syntax.valueIsAcceptable(v.getValue(), invalidReason))
          {
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
            if (!syntax.isHumanReadable() || syntax.isBinary())
            {
              // Value is not human-readable
              throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                ERR_MODIFY_ADD_INVALID_SYNTAX_NO_VALUE.get(
                    String.valueOf(entryDN), attr.getName(), invalidReason));
            }
            else
            {
              throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                ERR_MODIFY_ADD_INVALID_SYNTAX.get(String.valueOf(entryDN), attr
                    .getName(), v.getValue().toString(), invalidReason));
            }
          }
        }
      }
@@ -1506,8 +1516,18 @@
          if (!syntax.valueIsAcceptable(v.getValue(), invalidReason))
          {
            setResultCode(ResultCode.INVALID_ATTRIBUTE_SYNTAX);
            logError(ERR_MODIFY_ADD_INVALID_SYNTAX.get(String.valueOf(entryDN),
                attr.getName(), v.getValue().toString(), invalidReason));
            if (!syntax.isHumanReadable() || syntax.isBinary())
            {
              // Value is not human-readable
              logError(ERR_MODIFY_ADD_INVALID_SYNTAX_NO_VALUE.get(
                  String.valueOf(entryDN), attr.getName(), invalidReason));
            }
            else
            {
              logError(ERR_MODIFY_ADD_INVALID_SYNTAX.get(String
                  .valueOf(entryDN), attr.getName(), v.getValue().toString(),
                  invalidReason));
            }
            invalidReason = new MessageBuilder();
          }
        }
@@ -1695,9 +1715,19 @@
        {
          if (!syntax.valueIsAcceptable(v.getValue(), invalidReason))
          {
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
            if (!syntax.isHumanReadable() || syntax.isBinary())
            {
              // Value is not human-readable
              throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                ERR_MODIFY_REPLACE_INVALID_SYNTAX_NO_VALUE.get(
                    String.valueOf(entryDN), attr.getName(), invalidReason));
            }
            else
            {
              throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                ERR_MODIFY_REPLACE_INVALID_SYNTAX.get(String.valueOf(entryDN),
                    attr.getName(), v.getValue().toString(), invalidReason));
            }
          }
        }
      }
@@ -1709,9 +1739,18 @@
          if (!syntax.valueIsAcceptable(v.getValue(), invalidReason))
          {
            setResultCode(ResultCode.INVALID_ATTRIBUTE_SYNTAX);
            logError(ERR_MODIFY_REPLACE_INVALID_SYNTAX.get(String
                .valueOf(entryDN), attr.getName(), v.getValue().toString(),
                invalidReason));
            if (!syntax.isHumanReadable() || syntax.isBinary())
            {
              // Value is not human-readable
              logError(ERR_MODIFY_REPLACE_INVALID_SYNTAX_NO_VALUE.get(String
                  .valueOf(entryDN), attr.getName(), invalidReason));
            }
            else
            {
              logError(ERR_MODIFY_REPLACE_INVALID_SYNTAX.get(String
                  .valueOf(entryDN), attr.getName(), v.getValue().toString(),
                  invalidReason));
            }
            invalidReason = new MessageBuilder();
          }
        }
opends/tests/unit-tests-testng/src/server/org/opends/server/core/ModifyOperationTestCase.java
@@ -59,6 +59,7 @@
import org.opends.server.tools.LDAPModify;
import org.opends.server.tools.LDAPWriter;
import org.opends.server.types.*;
import org.opends.server.util.Base64;
import org.opends.server.util.ServerConstants;
import org.opends.server.workflowelement.localbackend.LocalBackendModifyOperation;
@@ -5163,8 +5164,25 @@
    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();
    String certificateValue =
      "MIICpTCCAg6gAwIBAgIJALeoA6I3ZC/cMA0GCSqGSIb3DQEBBQUAMFYxCzAJBgNV" +
      "BAYTAlVTMRMwEQYDVQQHEwpDdXBlcnRpb25lMRwwGgYDVQQLExNQcm9kdWN0IERl" +
      "dmVsb3BtZW50MRQwEgYDVQQDEwtCYWJzIEplbnNlbjAeFw0xMjA1MDIxNjM0MzVa" +
      "Fw0xMjEyMjExNjM0MzVaMFYxCzAJBgNVBAYTAlVTMRMwEQYDVQQHEwpDdXBlcnRp" +
      "b25lMRwwGgYDVQQLExNQcm9kdWN0IERldmVsb3BtZW50MRQwEgYDVQQDEwtCYWJz" +
      "IEplbnNlbjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApysa0c9qc8FB8gIJ" +
      "8zAb1pbJ4HzC7iRlVGhRJjFORkGhyvU4P5o2wL0iz/uko6rL9/pFhIlIMbwbV8sm" +
      "mKeNUPitwiKOjoFDmtimcZ4bx5UTAYLbbHMpEdwSpMC5iF2UioM7qdiwpAfZBd6Z" +
      "69vqNxuUJ6tP+hxtr/aSgMH2i8ECAwEAAaN7MHkwCQYDVR0TBAIwADAsBglghkgB" +
      "hvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYE" +
      "FLlZD3aKDa8jdhzoByOFMAJDs2osMB8GA1UdIwQYMBaAFLlZD3aKDa8jdhzoByOF" +
      "MAJDs2osMA0GCSqGSIb3DQEBBQUAA4GBAE5vccY8Ydd7by2bbwiDKgQqVyoKrkUg" +
      "6CD0WRmc2pBeYX2z94/PWO5L3Fx+eIZh2wTxScF+FdRWJzLbUaBuClrxuy0Y5ifj" +
      "axuJ8LFNbZtsp1ldW3i84+F5+SYT+xI67ZcoAtwx/VFVI9s5I/Gkmu9f9nxjPpK7" +
      "1AIUXiE3Qcck";
    ArrayList<ByteString> values = new ArrayList<ByteString>();
    values.add(ByteString.valueOf("2468"));
    values.add(ByteString.wrap(Base64.decode(certificateValue)));
    LDAPAttribute attr = new LDAPAttribute("usercertificate", values);
    ArrayList<RawModification> mods = new ArrayList<RawModification>();
    mods.add(new LDAPModification(ModificationType.ADD, attr));
@@ -5184,7 +5202,7 @@
    Attribute a = attrList.get(0);
    assertTrue(a.hasOption("binary"));
    assertEquals(a.size(), 1);
    assertEquals(a.iterator().next().getValue().toString(), "2468");
    assertEquals(Base64.encode(a.iterator().next().getValue()), certificateValue);
  }
}
opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/ExternalSASLMechanismHandlerTestCase.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 Forgerock AS
 */
package org.opends.server.extensions;
@@ -507,6 +508,23 @@
  {
    TestCaseUtils.initializeTestBackend(true);
    String Certificate =
      "MIICpTCCAg6gAwIBAgIJALeoA6I3ZC/cMA0GCSqGSIb3DQEBBQUAMFYxCzAJBgNV" +
      "BAYTAlVTMRMwEQYDVQQHEwpDdXBlcnRpb25lMRwwGgYDVQQLExNQcm9kdWN0IERl" +
      "dmVsb3BtZW50MRQwEgYDVQQDEwtCYWJzIEplbnNlbjAeFw0xMjA1MDIxNjM0MzVa" +
      "Fw0xMjEyMjExNjM0MzVaMFYxCzAJBgNVBAYTAlVTMRMwEQYDVQQHEwpDdXBlcnRp" +
      "b25lMRwwGgYDVQQLExNQcm9kdWN0IERldmVsb3BtZW50MRQwEgYDVQQDEwtCYWJz" +
      "IEplbnNlbjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApysa0c9qc8FB8gIJ" +
      "8zAb1pbJ4HzC7iRlVGhRJjFORkGhyvU4P5o2wL0iz/uko6rL9/pFhIlIMbwbV8sm" +
      "mKeNUPitwiKOjoFDmtimcZ4bx5UTAYLbbHMpEdwSpMC5iF2UioM7qdiwpAfZBd6Z" +
      "69vqNxuUJ6tP+hxtr/aSgMH2i8ECAwEAAaN7MHkwCQYDVR0TBAIwADAsBglghkgB" +
      "hvhCAQ0EHxYdSW52YWxpZCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYE" +
      "FLlZD3aKDa8jdhzoByOFMAJDs2osMB8GA1UdIwQYMBaAFLlZD3aKDa8jdhzoByOF" +
      "MAJDs2osMA0GCSqGSIb3DQEBBQUAA4GBAE5vccY8Ydd7by2bbwiDKgQqVyoKrkUg" +
      "6CD0WRmc2pBeYX2z94/PWO5L3Fx+eIZh2wTxScF+FdRWJzLbUaBuClrxuy0Y5ifj" +
      "axuJ8LFNbZtsp1ldW3i84+F5+SYT+xI67ZcoAtwx/VFVI9s5I/Gkmu9f9nxjPpK7" +
      "1AIUXiE3Qcck";
    Entry e = TestCaseUtils.makeEntry(
         "dn: cn=Test User,o=test",
         "objectClass: top",
@@ -516,7 +534,7 @@
         "cn: Test User",
         "givenName: Test",
         "sn: User",
         "userCertificate;binary: invalid");
         "userCertificate;binary:: " + Certificate);
    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();
@@ -642,6 +660,23 @@
  {
    TestCaseUtils.initializeTestBackend(true);
    String Certificate =
      "MIICpTCCAg6gAwIBAgIJALeoA6I3ZC/cMA0GCSqGSIb3DQEBBQUAMFYxCzAJBgNV" +
      "BAYTAlVTMRMwEQYDVQQHEwpDdXBlcnRpb25lMRwwGgYDVQQLExNQcm9kdWN0IERl" +
      "dmVsb3BtZW50MRQwEgYDVQQDEwtCYWJzIEplbnNlbjAeFw0xMjA1MDIxNjM0MzVa" +
      "Fw0xMjEyMjExNjM0MzVaMFYxCzAJBgNVBAYTAlVTMRMwEQYDVQQHEwpDdXBlcnRp" +
      "b25lMRwwGgYDVQQLExNQcm9kdWN0IERldmVsb3BtZW50MRQwEgYDVQQDEwtCYWJz" +
      "IEplbnNlbjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApysa0c9qc8FB8gIJ" +
      "8zAb1pbJ4HzC7iRlVGhRJjFORkGhyvU4P5o2wL0iz/uko6rL9/pFhIlIMbwbV8sm" +
      "mKeNUPitwiKOjoFDmtimcZ4bx5UTAYLbbHMpEdwSpMC5iF2UioM7qdiwpAfZBd6Z" +
      "69vqNxuUJ6tP+hxtr/aSgMH2i8ECAwEAAaN7MHkwCQYDVR0TBAIwADAsBglghkgB" +
      "hvhCAQ0EHxYdSW52YWxpZCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYE" +
      "FLlZD3aKDa8jdhzoByOFMAJDs2osMB8GA1UdIwQYMBaAFLlZD3aKDa8jdhzoByOF" +
      "MAJDs2osMA0GCSqGSIb3DQEBBQUAA4GBAE5vccY8Ydd7by2bbwiDKgQqVyoKrkUg" +
      "6CD0WRmc2pBeYX2z94/PWO5L3Fx+eIZh2wTxScF+FdRWJzLbUaBuClrxuy0Y5ifj" +
      "axuJ8LFNbZtsp1ldW3i84+F5+SYT+xI67ZcoAtwx/VFVI9s5I/Gkmu9f9nxjPpK7" +
      "1AIUXiE3Qcck";
    Entry e = TestCaseUtils.makeEntry(
         "dn: cn=Test User,o=test",
         "objectClass: top",
@@ -651,7 +686,7 @@
         "cn: Test User",
         "givenName: Test",
         "sn: User",
         "userCertificate;binary: invalid");
         "userCertificate;binary:: " + Certificate);
    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();
opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/LDAPBinaryOptionTestCase.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright  2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 Forgerock AS
 */
package org.opends.server.protocols.ldap;
@@ -44,6 +45,7 @@
import org.opends.server.protocols.internal.InternalSearchOperation;
import org.opends.server.tools.*;
import org.opends.server.types.*;
import org.opends.server.util.Base64;
import org.testng.annotations.*;
import static org.testng.Assert.*;
@@ -63,7 +65,7 @@
  //Constant value of userCertificate attribute.
  private static final String CERT=
      ": MIIB5TCCAU6gAwIBAgIERloIajANBgkqhkiG9" +
      "MIIB5TCCAU6gAwIBAgIERloIajANBgkqhkiG9" +
      "w0BAQUFADA3MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRXhhbXBs" +
      "ZSBDb3JwMREwDwYDVQQDEwhKb2huIERvZTAeFw0wNzA1MjcyMjM4" +
      "MzRaFw0wNzA4MjUyMjM4MzRaMDcxCzAJBgNVBAYTAlVTMRUwEwYD" +
@@ -110,7 +112,7 @@
      "uid: user.1",
      "sn: 1",
      "cn: user 1",
      "userCertificate"+CERT
      "userCertificate:: "+CERT
      );
    String[] args = new String []
    {
@@ -131,7 +133,7 @@
      "uid: user.2",
      "sn: 2",
      "cn: user 2",
      "userCertificate;binary"+CERT
      "userCertificate;binary:: "+CERT
      );
    args = new String []
    {
@@ -292,7 +294,8 @@
      addAttrs.add(RawAttribute.create("sn", "sn#1"));
      addAttrs.add(RawAttribute.create("sn;x-foo", "sn#2"));
      addAttrs.add(RawAttribute.create("sn;lang-fr", "sn#3"));
      addAttrs.add(RawAttribute.create("userCertificate;binary", CERT));
      addAttrs.add(RawAttribute.create("userCertificate;binary",
                                       ByteString.wrap(Base64.decode(CERT))));
      AddRequestProtocolOp addRequest =
           new AddRequestProtocolOp(ByteString.valueOf("uid=user.7,o=test"),
@@ -488,7 +491,7 @@
     "dn: uid=user.4,o=test",
     "changetype: modify",
     "add: usercertificate;binary",
     "userCertificate;binary" + CERT);
     "userCertificate;binary:: " + CERT);
    args = new String[]
    {
      "-h", "127.0.0.1",
opends/tests/unit-tests-testng/src/server/org/opends/server/schema/BinaryAttributeSyntaxTest.java
New file
@@ -0,0 +1,87 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 Forgerock AS
 */
package org.opends.server.schema;
import static org.testng.Assert.*;
import org.opends.server.api.AttributeSyntax;
import org.opends.server.types.ByteString;
import org.opends.messages.MessageBuilder;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
public abstract class BinaryAttributeSyntaxTest extends SchemaTestCase
{
  /**
   * Create data for the testAcceptableValues test.
   * This should be a table of tables with 2 elements.
   * The first one should be the value to test, the second the expected
   * result of the test.
   *
   * @return a table containing data for the testAcceptableValues Test.
   */
  @DataProvider(name="acceptableValues")
  public abstract Object[][] createAcceptableValues();
  /**
   * Get an instance of the attribute syntax that muste be tested.
   *
   * @return An instance of the attribute syntax that muste be tested.
   */
  protected abstract AttributeSyntax getRule();
  /**
   * Test the normalization and the approximate comparison.
   */
  @Test(dataProvider= "acceptableValues")
  public void testAcceptableValues(ByteString value, Boolean result)
         throws Exception
  {
    // Make sure that the specified class can be instantiated as a task.
    AttributeSyntax syntax = getRule();
    MessageBuilder reason = new MessageBuilder();
    // test the valueIsAcceptable method
    Boolean liveResult =
      syntax.valueIsAcceptable(value, reason);
    if (liveResult != result)
      fail(syntax + ".valueIsAcceptable gave bad result for " + value.toString() +
          "reason : " + reason);
    // call the getters
    syntax.getApproximateMatchingRule();
    syntax.getDescription();
    syntax.getEqualityMatchingRule();
    syntax.getOID();
    syntax.getOrderingMatchingRule();
    syntax.getSubstringMatchingRule();
    syntax.getSyntaxName();
    syntax.toString();
  }
}
opends/tests/unit-tests-testng/src/server/org/opends/server/schema/CertificateSyntaxTest.java
New file
@@ -0,0 +1,197 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012 Forgerock AS
 */
package org.opends.server.schema;
import org.opends.server.admin.server.ConfigurationChangeListener;
import org.opends.server.admin.std.server.AttributeSyntaxCfg;
import org.opends.server.admin.std.server.CertificateAttributeSyntaxCfg;
import org.opends.server.api.AttributeSyntax;
import org.opends.server.config.ConfigException;
import org.testng.annotations.DataProvider;
import org.opends.server.types.ByteString;
import org.opends.server.types.DN;
import org.opends.server.util.Base64;
/**
 * Test the CertificateSyntax.
 */
public class CertificateSyntaxTest extends BinaryAttributeSyntaxTest
{
  /**
   * {@inheritDoc}
   */
  @Override
  protected AttributeSyntax<?> getRule()
  {
    CertificateSyntax syntax = new CertificateSyntax();
    CertificateAttributeSyntaxCfg cfg = new CertificateAttributeSyntaxCfg()
    {
      public DN dn()
      {
        return null;
      }
      public void removeChangeListener(
          ConfigurationChangeListener<AttributeSyntaxCfg> listener)
      {
        // Stub.
      }
      public boolean isEnabled()
      {
        // Stub.
        return false;
      }
      public void addChangeListener(
          ConfigurationChangeListener<AttributeSyntaxCfg> listener)
      {
        // Stub.
      }
      public void removeCertificateChangeListener(
          ConfigurationChangeListener<CertificateAttributeSyntaxCfg> listener)
      {
        // Stub.
      }
      public boolean isStrictFormat()
      {
        return true;
      }
      public String getJavaClass()
      {
        // Stub.
        return null;
      }
      public Class<? extends CertificateAttributeSyntaxCfg> configurationClass()
      {
        // Stub.
        return null;
      }
      public void addCertificateChangeListener(
          ConfigurationChangeListener<CertificateAttributeSyntaxCfg> listener)
      {
        // Stub.
      }
    };
    try
    {
      syntax.initializeSyntax(cfg);
    }
    catch (ConfigException e)
    {
      // Should never happen.
      throw new RuntimeException(e);
    }
    return syntax;
  }
  /**
   * {@inheritDoc}
   */
  @Override
  @DataProvider(name="acceptableValues")
  public Object[][] createAcceptableValues()
  {
    String validcert1 =
      "MIICpTCCAg6gAwIBAgIJALeoA6I3ZC/cMA0GCSqGSIb3DQEBBQUAMFYxCzAJBgNV" +
      "BAYTAlVTMRMwEQYDVQQHEwpDdXBlcnRpb25lMRwwGgYDVQQLExNQcm9kdWN0IERl" +
      "dmVsb3BtZW50MRQwEgYDVQQDEwtCYWJzIEplbnNlbjAeFw0xMjA1MDIxNjM0MzVa" +
      "Fw0xMjEyMjExNjM0MzVaMFYxCzAJBgNVBAYTAlVTMRMwEQYDVQQHEwpDdXBlcnRp" +
      "b25lMRwwGgYDVQQLExNQcm9kdWN0IERldmVsb3BtZW50MRQwEgYDVQQDEwtCYWJz" +
      "IEplbnNlbjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApysa0c9qc8FB8gIJ" +
      "8zAb1pbJ4HzC7iRlVGhRJjFORkGhyvU4P5o2wL0iz/uko6rL9/pFhIlIMbwbV8sm" +
      "mKeNUPitwiKOjoFDmtimcZ4bx5UTAYLbbHMpEdwSpMC5iF2UioM7qdiwpAfZBd6Z" +
      "69vqNxuUJ6tP+hxtr/aSgMH2i8ECAwEAAaN7MHkwCQYDVR0TBAIwADAsBglghkgB" +
      "hvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYE" +
      "FLlZD3aKDa8jdhzoByOFMAJDs2osMB8GA1UdIwQYMBaAFLlZD3aKDa8jdhzoByOF" +
      "MAJDs2osMA0GCSqGSIb3DQEBBQUAA4GBAE5vccY8Ydd7by2bbwiDKgQqVyoKrkUg" +
      "6CD0WRmc2pBeYX2z94/PWO5L3Fx+eIZh2wTxScF+FdRWJzLbUaBuClrxuy0Y5ifj" +
      "axuJ8LFNbZtsp1ldW3i84+F5+SYT+xI67ZcoAtwx/VFVI9s5I/Gkmu9f9nxjPpK7" +
      "1AIUXiE3Qcck";
    String invalidcert1 =
      "MIICpTCCAg6gAwIBBQIJALeoA6I3ZC/cMA0GCSqGSIb3DQEBBQUAMFYxCzAJBgNV" +
      "BAYTAlVTMRMwEQYDVQQHEwpDdXBlcnRpb25lMRwwGgYDVQQLExNQcm9kdWN0IERl" +
      "dmVsb3BtZW50MRQwEgYDVQQDEwtCYWJzIEplbnNlbjAeFw0xMjA1MDIxNjM0MzVa" +
      "Fw0xMjEyMjExNjM0MzVaMFYxCzAJBgNVBAYTAlVTMRMwEQYDVQQHEwpDdXBlcnRp" +
      "b25lMRwwGgYDVQQLExNQcm9kdWN0IERldmVsb3BtZW50MRQwEgYDVQQDEwtCYWJz" +
      "IEplbnNlbjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApysa0c9qc8FB8gIJ" +
      "8zAb1pbJ4HzC7iRlVGhRJjFORkGhyvU4P5o2wL0iz/uko6rL9/pFhIlIMbwbV8sm" +
      "mKeNUPitwiKOjoFDmtimcZ4bx5UTAYLbbHMpEdwSpMC5iF2UioM7qdiwpAfZBd6Z" +
      "69vqNxuUJ6tP+hxtr/aSgMH2i8ECAwEAAaN7MHkwCQYDVR0TBAIwADAsBglghkgB" +
      "hvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYE" +
      "FLlZD3aKDa8jdhzoByOFMAJDs2osMB8GA1UdIwQYMBaAFLlZD3aKDa8jdhzoByOF" +
      "MAJDs2osMA0GCSqGSIb3DQEBBQUAA4GBAE5vccY8Ydd7by2bbwiDKgQqVyoKrkUg" +
      "6CD0WRmc2pBeYX2z94/PWO5L3Fx+eIZh2wTxScF+FdRWJzLbUaBuClrxuy0Y5ifj" +
      "axuJ8LFNbZtsp1ldW3i84+F5+SYT+xI67ZcoAtwx/VFVI9s5I/Gkmu9f9nxjPpK7" +
      "1AIUXiE3Qcck";
    String brokencert1 =
      "MIICpTCCAg6gAwIBAgIJALeoA6I3ZC/cMA0GCSqGSIb3DQEBBQUAMFYxCzAJBgNV";
    try {
      return new Object [][] {
        {ByteString.wrap(Base64.decode(validcert1)), true},
        {ByteString.valueOf(validcert1), false},
        {ByteString.wrap(Base64.decode(invalidcert1)), false},
        {ByteString.wrap(Base64.decode(brokencert1)), false},
        {ByteString.valueOf("invalid"), false}
      };
    }
    catch (Exception e)
    {
      return new Object[][] {};
    }
  }
}