1 |
W dniu 28.02.2017, wto o godzinie 23∶57 -0800, użytkownik Zac Medico |
2 |
napisał: |
3 |
> On 02/28/2017 11:34 PM, Michał Górny wrote: |
4 |
> > The pycrypto override used the same variables as actual hash functions |
5 |
> > before determining whether its functions are useful. As a result, if |
6 |
> > pycrypto had a broken module and no hash function was generated, |
7 |
> > the possible previous implementation was replaced by None. |
8 |
> > --- |
9 |
> > pym/portage/checksum.py | 12 ++++++------ |
10 |
> > 1 file changed, 6 insertions(+), 6 deletions(-) |
11 |
> > |
12 |
> > diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py |
13 |
> > index a46b820af..fc38417a7 100644 |
14 |
> > --- a/pym/portage/checksum.py |
15 |
> > +++ b/pym/portage/checksum.py |
16 |
> > @@ -105,14 +105,14 @@ except ImportError: |
17 |
> > # is broken somehow. |
18 |
> > try: |
19 |
> > from Crypto.Hash import SHA256, RIPEMD |
20 |
> > - sha256hash = getattr(SHA256, 'new', None) |
21 |
> > - if sha256hash is not None: |
22 |
> > + sha256hash_ = getattr(SHA256, 'new', None) |
23 |
> > + if sha256hash_ is not None: |
24 |
> > sha256hash = _generate_hash_function("SHA256", |
25 |
> > - sha256hash, origin="pycrypto") |
26 |
> > - rmd160hash = getattr(RIPEMD, 'new', None) |
27 |
> > - if rmd160hash is not None: |
28 |
> > + sha256hash_, origin="pycrypto") |
29 |
> > + rmd160hash_ = getattr(RIPEMD, 'new', None) |
30 |
> > + if rmd160hash_ is not None: |
31 |
> > rmd160hash = _generate_hash_function("RMD160", |
32 |
> > - rmd160hash, origin="pycrypto") |
33 |
> > + rmd160hash_, origin="pycrypto") |
34 |
> > except ImportError: |
35 |
> > pass |
36 |
> > |
37 |
> > |
38 |
> |
39 |
> Looks good. |
40 |
|
41 |
Thanks. Merged both patches. |
42 |
|
43 |
-- |
44 |
Best regards, |
45 |
Michał Górny |