Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 704258 Details for
Bug 885130
CVE-2012-6137 subscription-manager: rhn-migrate-classic-to-rhsm missing SSL certificate verification
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
A fix for this issue
0001-885130-Switch-from-using-xmlrpclib-to-rhnlib-s-rpcli.patch (text/plain), 5.62 KB, created by
Alex Wood
on 2013-03-01 17:20:06 UTC
(
hide
)
Description:
A fix for this issue
Filename:
MIME Type:
Creator:
Alex Wood
Created:
2013-03-01 17:20:06 UTC
Size:
5.62 KB
patch
obsolete
>From 812a12d8cba60bf4db657926ba20a5a25deba487 Mon Sep 17 00:00:00 2001 >From: Alex Wood <awood@redhat.com> >Date: Fri, 1 Mar 2013 11:48:34 -0500 >Subject: [PATCH] 885130: Switch from using xmlrpclib to rhnlib's rpclib. > >--- > src/subscription_manager/migrate/migrate.py | 40 +++++++-------------------- > subscription-manager.spec | 1 + > test/test_migration.py | 21 ++------------ > 3 files changed, 14 insertions(+), 48 deletions(-) > >diff --git a/src/subscription_manager/migrate/migrate.py b/src/subscription_manager/migrate/migrate.py >index 94ea5bf..52159ac 100755 >--- a/src/subscription_manager/migrate/migrate.py >+++ b/src/subscription_manager/migrate/migrate.py >@@ -14,9 +14,7 @@ > # in this software or its documentation. > # > >-import base64 > import getpass >-import httplib > import libxml2 > import logging > import os >@@ -26,9 +24,9 @@ import simplejson as json > import subprocess > import sys > import traceback >-import xmlrpclib > from datetime import datetime > from M2Crypto.SSL import SSLError >+from rhn import rpclib > > import rhsm.config > from rhsm.connection import UEPConnection, RemoteServerException, RestlibException >@@ -121,24 +119,6 @@ class Menu(object): > raise InvalidChoiceError > > >-class ProxiedTransport(xmlrpclib.Transport): >- def set_proxy(self, proxy, credentials): >- self.proxy = proxy >- self.credentials = credentials >- >- def make_connection(self, host): >- self.realhost = host >- return httplib.HTTP(self.proxy) >- >- def send_request(self, connection, handler, request_body): >- connection.putrequest("POST", 'http://%s%s' % (self.realhost, handler)) >- >- def send_host(self, connection, host): >- connection.putheader('Host', self.realhost) >- if self.credentials: >- connection.putheader('Proxy-Authorization', 'Basic ' + self.credentials) >- >- > class UserCredentials(object): > def __init__(self, username, password): > self.username = username >@@ -328,17 +308,17 @@ class MigrationEngine(object): > server_url = 'https://%s/rpc/api' % (hostname) > try: > if self.rhncfg['enableProxy']: >- pt = ProxiedTransport() >+ proxy = "%s:%s" % (self.proxy_host, self.proxy_port) >+ log.info("Using proxy %s for RHN API methods" % (proxy)) > if self.rhncfg['enableProxyAuth']: >- proxy_credentials = base64.encodestring('%s:%s' % (self.proxy_user, self.proxy_pass)).strip() >- else: >- proxy_credentials = "" >- >- pt.set_proxy("%s:%s" % (self.proxy_host, self.proxy_port), proxy_credentials) >- log.info("Using proxy %s:%s for RHN API methods" % (self.proxy_host, self.proxy_port)) >- sc = xmlrpclib.Server(server_url, transport=pt) >+ proxy = "@".join(["%s:%s" % (self.proxy_user, self.proxy_pass), proxy]) > else: >- sc = xmlrpclib.Server(server_url) >+ proxy = None >+ >+ sc = rpclib.Server(server_url, proxy=proxy) >+ >+ ca = self.rhncfg["sslCACert"] >+ sc.add_trusted_cert(ca) > > sk = sc.auth.login(credentials.username, credentials.password) > return (sc, sk) >diff --git a/subscription-manager.spec b/subscription-manager.spec >index 6151af2..e9779b0 100644 >--- a/subscription-manager.spec >+++ b/subscription-manager.spec >@@ -105,6 +105,7 @@ This package contains the firstboot screens for subscription manager. > Summary: Migration scripts for moving to certificate based subscriptions > Group: System Environment/Base > Requires: %{name} = %{version}-%{release} >+Requires: rhnlib > > %description -n subscription-manager-migration > This package contains scripts that aid in moving to certificate based >diff --git a/test/test_migration.py b/test/test_migration.py >index d584dce..2cef446 100644 >--- a/test/test_migration.py >+++ b/test/test_migration.py >@@ -62,22 +62,6 @@ class TestMenu(unittest.TestCase): > self.assertEqual(choice, "Hello") > > >-class TestProxiedTransport(unittest.TestCase): >- def setUp(self): >- self.transport = migrate.ProxiedTransport() >- >- def test_set_proxy(self): >- self.transport.set_proxy("proxy", "credentials") >- self.assertEquals(self.transport.proxy, "proxy") >- self.assertEquals(self.transport.credentials, "credentials") >- >- def test_make_connection(self): >- self.transport.proxy = "proxy" >- http = self.transport.make_connection("host") >- self.assertEquals(self.transport.realhost, "host") >- self.assertEquals(http._conn.host, "proxy") >- >- > class TestMigration(unittest.TestCase): > def setUp(self): > migrate.initUp2dateConfig = lambda: {} >@@ -411,13 +395,13 @@ class TestMigration(unittest.TestCase): > else: > self.fail("No exception raised") > >- @patch("xmlrpclib.Server") >+ @patch("rhn.rpclib.Server") > def test_connect_to_rhn(self, mock_server): >- pass > rhn_config = { > "serverURL": "https://some.host.example.com/XMLRPC", > "enableProxy": True, > "enableProxyAuth": True, >+ "sslCACert": "/some/path/here", > } > self.engine.rhncfg = rhn_config > self.engine.proxy_user = "proxy_user" >@@ -431,6 +415,7 @@ class TestMigration(unittest.TestCase): > > ms = mock_server.return_value > self.engine.connect_to_rhn(credentials) >+ mock_server.assert_called_with("https://some.host.example.com/rpc/api", proxy="proxy_user:proxy_pass@proxy.example.com:3128") > ms.auth.login.assert_called_with("username", "password") > > def test_check_is_org_admin(self): >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 885130
: 704258