Mailinglist Archive: opensuse-buildservice (306 mails)

< Previous Next >
Re: [opensuse-buildservice] Extra newlines in base64 passx on SLES 10 (python 2.4.2)
On 2010-01-20 12:34:06 -0600, Luke Imhoff wrote:
When converting an older oscrc that contained a random password, the
add_section part that was rewriting the password to be bz2 and base64
encoded died with:

<SNIP>
It seemed odd to me that base64 encoding would include \n, so I tried
using base64 instead of encode('base64'):

passx = base64.b64encode(passwd.encode('bz2'))
passx =
'QlpoOTFBWSZTWdaogbUAAAWPgDwAGgRGEBA8oEAgACKAAaeo8oUwmmgNMT1QmTbwV1iAUV8XckU4UJDWqIG1'

If you compare the two encodings you'll notice that the only difference
is the infix newline and the newline at the end.

Thanks I just adopted it in git master. I really fail to see a meaningful
reason why encode('base64') splits the string at 76 char boundaries...


Marcus
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
References