Bug 4246 - The user and root password are not encrypted in SC manifest
: The user and root password are not encrypted in SC manifest
Status: RESOLVED FIXINSOURCE
Product: installer
autoinstall
: unspecified
: i86pc/i386 OpenSolaris
: P1 critical (vote)
: 2009.04
Assigned To: William Schumann
:
:
: rn4
:
:
:
  Show dependency treegraph
 
Reported: 2008-10-26 00:10 UTC by Sundar Yamunachari
Modified: 2009-02-08 13:05 UTC (History)
3 users (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description Sundar Yamunachari 2008-10-26 00:10:30 UTC
The SC manifest has the user and root passwords. It works if the passwords are
in clear. If I try encrypted password, it doesn't work. The passwords should be
encrypted.

Example of a SC manifest

<!-- <?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="profile" name="name">
      <service name="ai_properties" version="1" type="service">
          <instance name="default" enabled="true">
              <property_group name="ai" type="application">
                <propval name="username" type="astring" value="jack"/>
                <propval name="userpass" type="astring" value="jack"/>
                <propval name="description" type="astring" value="Jackshome"/>
                <propval name="rootpass" type="astring" value="opensolaris"/>
                <propval name="timezone" type="astring" value="US/Pacific"/>
              </property_group>
          </instance>
        </service>
</service_bundle>
Comment 1 Sundar Yamunachari 2008-10-29 23:57:07 UTC
The AI engine is encryting the password and pass it to the orchestrator since
orchestrator assumes that the password is encrypted. We should ask the user to
provide encrypted passwords for user and root and shouldn't encrypt in AI
engine.
Comment 2 Sundar Yamunachari 2008-11-04 14:39:04 UTC
Reducing the severity from blocker to critical since this bug doesn't affect
the installation
Comment 3 Clay Baenziger 2008-11-11 10:46:25 UTC
Hi Alok,
   I just would like to give you a heads up to please ensure any special
characters which can be valid XML markup use their XML entities instead.
Comment 4 William Schumann 2009-01-22 07:42:41 UTC
(In reply to comment #3)
> Hi Alok,
>    I just would like to give you a heads up to please ensure any special
> characters which can be valid XML markup use their XML entities instead.

The man page for shadow(4), which holds the encrypted passwords, indicates that
the format of /etc/shadow is ASCII, so there should be no need for encoding XML
entities for the encrypted passwords in the manifest.

So it seems that the only change is to remove calls encrypting passwords in the
AI engine.
Comment 5 William Schumann 2009-01-23 02:52:27 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Hi Alok,
> >    I just would like to give you a heads up to please ensure any special
> > characters which can be valid XML markup use their XML entities instead.
> 
> The man page for shadow(4), which holds the encrypted passwords, indicates that
> the format of /etc/shadow is ASCII, so there should be no need for encoding XML
> entities for the encrypted passwords in the manifest.

But there might be special XML characters in encrypted passwords that have
alternate encodings in XML, so this must still be examined.
Comment 6 William Schumann 2009-01-27 09:42:08 UTC
XML entities will now be decoded.  The XML decoding is basic and has some
shortcuts, such as decoding only 1-byte numeric values.  It is expected that
the AI manifests will soon be restructured and then should be parsed with
established parsers, such as in libxml2.

Bugs fixed along the way:
- values with spaces were being truncated at the first space
- apostrophes used as value delimiters were not working
- some typos with keyword name not matching intended storage variable name
Comment 7 William Schumann 2009-02-03 13:38:26 UTC
The man page for shadow(4) states:

     The    encrypted    password    consists    of    at    most
     CRYPT_MAXCIPHERTEXTLEN characters chosen from a 64-character
     alphabet (., /, 0-9, A-Z, a-z). Two additional special char-
     acters,  "$"  and  ",",  can also be used and are defined in
     crypt(3C).

Since none of these characters are HTML entities, decoding is unnecessary.
Comment 8 William Schumann 2009-02-03 13:39:18 UTC
(In reply to comment #7)
> The man page for shadow(4) states:
> 
>      The    encrypted    password    consists    of    at    most
>      CRYPT_MAXCIPHERTEXTLEN characters chosen from a 64-character
>      alphabet (., /, 0-9, A-Z, a-z). Two additional special char-
>      acters,  "$"  and  ",",  can also be used and are defined in
>      crypt(3C).
> 
> Since none of these characters are HTML entities, decoding is unnecessary.

XML entities, that is.
Comment 9 William Schumann 2009-02-08 13:05:37 UTC
Pushed in changeset 436:86bc65bc6cb6