Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-3154

[classlib][security] Security.getProviders(filter) methods don't accept empty attribute value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • None

    Description

      The following test cases pass on RI but fail on Harmony with InvalidParameterException. However Harmony implementation follows the spec.

      Security.getProviders("MyService.Algorithm KeySize"); // The filter is not in the required format
      or
      Map<String, String> m = new HashMap<String, String>();
      m.put("MyService.Algorithm KeySize", ""); // The value for the key is empty string
      Security.getProviders(m);

      1) There is a clear statement in the spec. for getProviders(Map<String,String> filter) method that attribute value MUST be non-empty string.

      The spec says: "... The selection criteria are represented by a map. Each map entry represents a selection criterion. A provider is selected iff it satisfies all selection criteria. The key for any entry in such a map must be in one of the following two formats:
      ...
      <crypto_service>.<algorithm_or_type> <attribute_name>

      The cryptographic service name must not contain any dots. There must be one or more space charaters between the <algorithm_or_type> and the <attribute_name>.

      The value associated with the key must be a non-empty string."

      2) For the second method - the specified format implies that attribute value can not be omitted.
      It says for getProviders(String filter):
      "... The selection criterion must be specified in one of the following two formats:
      ...
      <crypto_service>.<algorithm_or_type> <attribute_name>:< attribute_value>

      The cryptographic service name must not contain any dots. There must be one or more space charaters between the the <algorithm_or_type> and the <attribute_name>.

      A provider satisfies this selection criterion iff the provider implements the specified algorithm or type for the specified cryptographic service and its implementation meets the constraint expressed by the specified attribute name/value pair. "

      Attachments

        Issue Links

          Activity

            People

              smm Stepan Mishura
              smm Stepan Mishura
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: