Re: [Freeipa-devel] [PATCH] 383 Check subject name encoding in ipa-cacert-manage renew

2014-12-10 Thread Martin Kosek
On 12/09/2014 01:56 PM, Jan Cholasta wrote:
 Dne 5.12.2014 v 12:01 Jan Cholasta napsal(a):
 Dne 5.12.2014 v 11:43 Martin Kosek napsal(a):
 On 12/05/2014 11:34 AM, Jan Cholasta wrote:
 Dne 5.12.2014 v 09:03 Martin Kosek napsal(a):
 On 12/04/2014 09:36 AM, Jan Cholasta wrote:
 +if x509.get_der_subject(cert, x509.DER) != der_subject:
 +raise admintool.ScriptError(Subject name encoding
 mismatch)

 I think we can expect this to be a pretty common error, given this is
 the default behavior of Microsoft Certificate Services. I would thus
 like to make the error message more juicy.

 We need to make sure we offer some pointers for these users or they
 will
 just blame IPA for screwing up. So, the information I wrote

 https://bugzilla.redhat.com/show_bug.cgi?id=1129558#c11

 need to somehow get to the error message as a potential/likely root
 cause of the problem. Whether you write it in the error message itself
 or update the design page and just insert a link is up to you.

 Martin

 I would rather document this and have users read the documentation,
 which they
 should do anyway when something goes wrong. There are many errors in
 IPA which
 are common and users may blame IPA for them and I don't see what makes
 this one
 so special that it should require a special treatment.

 I saw several reasons:
 - Certificateinstallation error are more common than the others and
 users are usually quite lost in what to do with them.
 - In this case, we know by 90% probability what is the root cause
 - It will block one of the main use cases for the new CA renewal tool
 and people will likely hit it as MS CAs is one of the most common CAs
 and this is it's default behavior.

 Giving more details in this case will not hurt us, but benefit users. So
 I still do not see the harm.

 I do not see a harm either, my point is that we should probably point
 the user to documentation when *anything* in *any* script goes wrong,
 not just when some arbitrarily cherry-picked error occurs.


 Anyway, I have created
 http://www.freeipa.org/page/Troubleshooting#External_CA_renewal_with_ipa-cacert-manage_fails.




 Good. Do you plan to reference the section or enhance the error message?

 I plan to reference http://www.freeipa.org/page/Troubleshooting.
 
 See the attached patch (385).

I think the reference for the Troubleshooting page should be more narrow so
that people only see the URL only for the cases we give specific advise for.
Otherwise I assume they will just ignore the page if they do not find the
advise for other errors.

Other idea would be to give reference to the article when the actual CSR is
generated - as a heads up.

Martin

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 383 Check subject name encoding in ipa-cacert-manage renew

2014-12-10 Thread Martin Kosek
On 12/10/2014 02:35 PM, Jan Cholasta wrote:
 Dne 10.12.2014 v 11:53 Martin Kosek napsal(a):
 On 12/09/2014 01:56 PM, Jan Cholasta wrote:
 Dne 5.12.2014 v 12:01 Jan Cholasta napsal(a):
 Dne 5.12.2014 v 11:43 Martin Kosek napsal(a):
 On 12/05/2014 11:34 AM, Jan Cholasta wrote:
 Dne 5.12.2014 v 09:03 Martin Kosek napsal(a):
 On 12/04/2014 09:36 AM, Jan Cholasta wrote:
 +if x509.get_der_subject(cert, x509.DER) != der_subject:
 +raise admintool.ScriptError(Subject name encoding
 mismatch)

 I think we can expect this to be a pretty common error, given this is
 the default behavior of Microsoft Certificate Services. I would thus
 like to make the error message more juicy.

 We need to make sure we offer some pointers for these users or they
 will
 just blame IPA for screwing up. So, the information I wrote

 https://bugzilla.redhat.com/show_bug.cgi?id=1129558#c11

 need to somehow get to the error message as a potential/likely root
 cause of the problem. Whether you write it in the error message itself
 or update the design page and just insert a link is up to you.

 Martin

 I would rather document this and have users read the documentation,
 which they
 should do anyway when something goes wrong. There are many errors in
 IPA which
 are common and users may blame IPA for them and I don't see what makes
 this one
 so special that it should require a special treatment.

 I saw several reasons:
 - Certificateinstallation error are more common than the others and
 users are usually quite lost in what to do with them.
 - In this case, we know by 90% probability what is the root cause
 - It will block one of the main use cases for the new CA renewal tool
 and people will likely hit it as MS CAs is one of the most common CAs
 and this is it's default behavior.

 Giving more details in this case will not hurt us, but benefit users. So
 I still do not see the harm.

 I do not see a harm either, my point is that we should probably point
 the user to documentation when *anything* in *any* script goes wrong,
 not just when some arbitrarily cherry-picked error occurs.


 Anyway, I have created
 http://www.freeipa.org/page/Troubleshooting#External_CA_renewal_with_ipa-cacert-manage_fails.





 Good. Do you plan to reference the section or enhance the error message?

 I plan to reference http://www.freeipa.org/page/Troubleshooting.

 See the attached patch (385).

 I think the reference for the Troubleshooting page should be more narrow so
 that people only see the URL only for the cases we give specific advise for.
 Otherwise I assume they will just ignore the page if they do not find the
 advise for other errors.
 
 Right, makes sense.
 

 Other idea would be to give reference to the article when the actual CSR is
 generated - as a heads up.
 
 I think referring to troubleshooting before there actually is some trouble is
 not very good for publicity.

Ah, that's a good point - in this purpose it would be better to have it
somewhere else or only refer to the MS article.

 Anyway, updated patch attached, it implements what you suggested originally -
 link to the troubleshooting guide is added to relevant error messages. Let's
 think about this in more broad terms when the time comes for the installer
 refactoring.

Ok. I am fine with the patch conceptually. So now just someone (David?) needs
to make sure it did not break anything :-)

Martin

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 383 Check subject name encoding in ipa-cacert-manage renew

2014-12-10 Thread Martin Basti

On 10/12/14 16:02, Martin Kosek wrote:

On 12/10/2014 02:35 PM, Jan Cholasta wrote:

Dne 10.12.2014 v 11:53 Martin Kosek napsal(a):

On 12/09/2014 01:56 PM, Jan Cholasta wrote:

Dne 5.12.2014 v 12:01 Jan Cholasta napsal(a):

Dne 5.12.2014 v 11:43 Martin Kosek napsal(a):

On 12/05/2014 11:34 AM, Jan Cholasta wrote:

Dne 5.12.2014 v 09:03 Martin Kosek napsal(a):

On 12/04/2014 09:36 AM, Jan Cholasta wrote:

+if x509.get_der_subject(cert, x509.DER) != der_subject:
+raise admintool.ScriptError(Subject name encoding
mismatch)

I think we can expect this to be a pretty common error, given this is
the default behavior of Microsoft Certificate Services. I would thus
like to make the error message more juicy.

We need to make sure we offer some pointers for these users or they
will
just blame IPA for screwing up. So, the information I wrote

https://bugzilla.redhat.com/show_bug.cgi?id=1129558#c11

need to somehow get to the error message as a potential/likely root
cause of the problem. Whether you write it in the error message itself
or update the design page and just insert a link is up to you.

Martin

I would rather document this and have users read the documentation,
which they
should do anyway when something goes wrong. There are many errors in
IPA which
are common and users may blame IPA for them and I don't see what makes
this one
so special that it should require a special treatment.

I saw several reasons:
- Certificateinstallation error are more common than the others and
users are usually quite lost in what to do with them.
- In this case, we know by 90% probability what is the root cause
- It will block one of the main use cases for the new CA renewal tool
and people will likely hit it as MS CAs is one of the most common CAs
and this is it's default behavior.

Giving more details in this case will not hurt us, but benefit users. So
I still do not see the harm.

I do not see a harm either, my point is that we should probably point
the user to documentation when *anything* in *any* script goes wrong,
not just when some arbitrarily cherry-picked error occurs.


Anyway, I have created
http://www.freeipa.org/page/Troubleshooting#External_CA_renewal_with_ipa-cacert-manage_fails.





Good. Do you plan to reference the section or enhance the error message?

I plan to reference http://www.freeipa.org/page/Troubleshooting.

See the attached patch (385).

I think the reference for the Troubleshooting page should be more narrow so
that people only see the URL only for the cases we give specific advise for.
Otherwise I assume they will just ignore the page if they do not find the
advise for other errors.

Right, makes sense.


Other idea would be to give reference to the article when the actual CSR is
generated - as a heads up.

I think referring to troubleshooting before there actually is some trouble is
not very good for publicity.

Ah, that's a good point - in this purpose it would be better to have it
somewhere else or only refer to the MS article.


Anyway, updated patch attached, it implements what you suggested originally -
link to the troubleshooting guide is added to relevant error messages. Let's
think about this in more broad terms when the time comes for the installer
refactoring.

Ok. I am fine with the patch conceptually. So now just someone (David?) needs
to make sure it did not break anything :-)

Martin


ACK, seems it doesnt break anything.

--
Martin Basti

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 383 Check subject name encoding in ipa-cacert-manage renew

2014-12-10 Thread Jan Cholasta

Dne 9.12.2014 v 13:03 David Kupka napsal(a):

On 12/04/2014 09:36 AM, Jan Cholasta wrote:

Hi,

the attached patch fixes https://fedorahosted.org/freeipa/ticket/4781.

Honza



___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Works for me, ACK.



Thanks for the review.

Pushed to:
master: f7f3c83748b3b5d5d968cc3c72145f3c5f23cd8b
ipa-4-1: 731035e526441b93b69fb20c6a6c990cdcdc4899

--
Jan Cholasta

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 383 Check subject name encoding in ipa-cacert-manage renew

2014-12-10 Thread Jan Cholasta

Dne 10.12.2014 v 17:53 Martin Basti napsal(a):

On 10/12/14 16:02, Martin Kosek wrote:

On 12/10/2014 02:35 PM, Jan Cholasta wrote:

Dne 10.12.2014 v 11:53 Martin Kosek napsal(a):

On 12/09/2014 01:56 PM, Jan Cholasta wrote:

Dne 5.12.2014 v 12:01 Jan Cholasta napsal(a):

Dne 5.12.2014 v 11:43 Martin Kosek napsal(a):

On 12/05/2014 11:34 AM, Jan Cholasta wrote:

Dne 5.12.2014 v 09:03 Martin Kosek napsal(a):

On 12/04/2014 09:36 AM, Jan Cholasta wrote:

+if x509.get_der_subject(cert, x509.DER) !=
der_subject:
+raise admintool.ScriptError(Subject name
encoding
mismatch)

I think we can expect this to be a pretty common error, given
this is
the default behavior of Microsoft Certificate Services. I would
thus
like to make the error message more juicy.

We need to make sure we offer some pointers for these users or
they
will
just blame IPA for screwing up. So, the information I wrote

https://bugzilla.redhat.com/show_bug.cgi?id=1129558#c11

need to somehow get to the error message as a potential/likely
root
cause of the problem. Whether you write it in the error message
itself
or update the design page and just insert a link is up to you.

Martin

I would rather document this and have users read the documentation,
which they
should do anyway when something goes wrong. There are many
errors in
IPA which
are common and users may blame IPA for them and I don't see what
makes
this one
so special that it should require a special treatment.

I saw several reasons:
- Certificateinstallation error are more common than the others and
users are usually quite lost in what to do with them.
- In this case, we know by 90% probability what is the root cause
- It will block one of the main use cases for the new CA renewal
tool
and people will likely hit it as MS CAs is one of the most common
CAs
and this is it's default behavior.

Giving more details in this case will not hurt us, but benefit
users. So
I still do not see the harm.

I do not see a harm either, my point is that we should probably point
the user to documentation when *anything* in *any* script goes wrong,
not just when some arbitrarily cherry-picked error occurs.


Anyway, I have created
http://www.freeipa.org/page/Troubleshooting#External_CA_renewal_with_ipa-cacert-manage_fails.






Good. Do you plan to reference the section or enhance the error
message?

I plan to reference http://www.freeipa.org/page/Troubleshooting.

See the attached patch (385).

I think the reference for the Troubleshooting page should be more
narrow so
that people only see the URL only for the cases we give specific
advise for.
Otherwise I assume they will just ignore the page if they do not
find the
advise for other errors.

Right, makes sense.


Other idea would be to give reference to the article when the actual
CSR is
generated - as a heads up.

I think referring to troubleshooting before there actually is some
trouble is
not very good for publicity.

Ah, that's a good point - in this purpose it would be better to have it
somewhere else or only refer to the MS article.


Anyway, updated patch attached, it implements what you suggested
originally -
link to the troubleshooting guide is added to relevant error
messages. Let's
think about this in more broad terms when the time comes for the
installer
refactoring.

Ok. I am fine with the patch conceptually. So now just someone
(David?) needs
to make sure it did not break anything :-)

Martin


ACK, seems it doesnt break anything.



Thanks for the review.

Pushed to:
master: 8f9c5988e2f370cef66a4cd7cf3d363f061a439c
ipa-4-1: 3cb2f5e841f5bac6a8cc02bc9467846b35f7aab8

--
Jan Cholasta

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 383 Check subject name encoding in ipa-cacert-manage renew

2014-12-09 Thread David Kupka

On 12/04/2014 09:36 AM, Jan Cholasta wrote:

Hi,

the attached patch fixes https://fedorahosted.org/freeipa/ticket/4781.

Honza



___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Works for me, ACK.

--
David Kupka

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 383 Check subject name encoding in ipa-cacert-manage renew

2014-12-09 Thread Jan Cholasta

Dne 5.12.2014 v 12:01 Jan Cholasta napsal(a):

Dne 5.12.2014 v 11:43 Martin Kosek napsal(a):

On 12/05/2014 11:34 AM, Jan Cholasta wrote:

Dne 5.12.2014 v 09:03 Martin Kosek napsal(a):

On 12/04/2014 09:36 AM, Jan Cholasta wrote:

+if x509.get_der_subject(cert, x509.DER) != der_subject:
+raise admintool.ScriptError(Subject name encoding
mismatch)


I think we can expect this to be a pretty common error, given this is
the default behavior of Microsoft Certificate Services. I would thus
like to make the error message more juicy.

We need to make sure we offer some pointers for these users or they
will
just blame IPA for screwing up. So, the information I wrote

https://bugzilla.redhat.com/show_bug.cgi?id=1129558#c11

need to somehow get to the error message as a potential/likely root
cause of the problem. Whether you write it in the error message itself
or update the design page and just insert a link is up to you.

Martin


I would rather document this and have users read the documentation,
which they
should do anyway when something goes wrong. There are many errors in
IPA which
are common and users may blame IPA for them and I don't see what makes
this one
so special that it should require a special treatment.


I saw several reasons:
- Certificateinstallation error are more common than the others and
users are usually quite lost in what to do with them.
- In this case, we know by 90% probability what is the root cause
- It will block one of the main use cases for the new CA renewal tool
and people will likely hit it as MS CAs is one of the most common CAs
and this is it's default behavior.

Giving more details in this case will not hurt us, but benefit users. So
I still do not see the harm.


I do not see a harm either, my point is that we should probably point
the user to documentation when *anything* in *any* script goes wrong,
not just when some arbitrarily cherry-picked error occurs.




Anyway, I have created
http://www.freeipa.org/page/Troubleshooting#External_CA_renewal_with_ipa-cacert-manage_fails.




Good. Do you plan to reference the section or enhance the error message?


I plan to reference http://www.freeipa.org/page/Troubleshooting.


See the attached patch (385).





Martin





--
Jan Cholasta
From b5a4da2119eb6a57750fdb55bec5a5ad1c6db669 Mon Sep 17 00:00:00 2001
From: Jan Cholasta jchol...@redhat.com
Date: Tue, 9 Dec 2014 12:47:58 +
Subject: [PATCH] Refer the user to freeipa.org when something goes wrong in
 ipa-cacert-manage

https://fedorahosted.org/freeipa/ticket/4781
---
 ipaserver/install/ipa_cacert_manage.py | 8 
 1 file changed, 8 insertions(+)

diff --git a/ipaserver/install/ipa_cacert_manage.py b/ipaserver/install/ipa_cacert_manage.py
index 8fda6a2..f73c7fe 100644
--- a/ipaserver/install/ipa_cacert_manage.py
+++ b/ipaserver/install/ipa_cacert_manage.py
@@ -120,6 +120,14 @@ class CACertManage(admintool.AdminTool):
 
 return rc
 
+def log_failure(self, error_message, return_value, exception, backtrace):
+super(CACertManage, self).log_failure(
+error_message, return_value, exception, backtrace)
+
+if isinstance(exception, admintool.ScriptError):
+print(\nVisit http://www.freeipa.org/page/Troubleshooting for 
+  troubleshooting guide)
+
 def ldap_connect(self):
 conn = ldap2()
 
-- 
2.1.0

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Re: [Freeipa-devel] [PATCH] 383 Check subject name encoding in ipa-cacert-manage renew

2014-12-05 Thread Martin Kosek

On 12/04/2014 09:36 AM, Jan Cholasta wrote:

+if x509.get_der_subject(cert, x509.DER) != der_subject:
+raise admintool.ScriptError(Subject name encoding mismatch)


I think we can expect this to be a pretty common error, given this is the 
default behavior of Microsoft Certificate Services. I would thus like to make 
the error message more juicy.


We need to make sure we offer some pointers for these users or they will just 
blame IPA for screwing up. So, the information I wrote


https://bugzilla.redhat.com/show_bug.cgi?id=1129558#c11

need to somehow get to the error message as a potential/likely root cause of 
the problem. Whether you write it in the error message itself or update the 
design page and just insert a link is up to you.


Martin

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 383 Check subject name encoding in ipa-cacert-manage renew

2014-12-05 Thread Jan Cholasta

Dne 5.12.2014 v 09:03 Martin Kosek napsal(a):

On 12/04/2014 09:36 AM, Jan Cholasta wrote:

+if x509.get_der_subject(cert, x509.DER) != der_subject:
+raise admintool.ScriptError(Subject name encoding
mismatch)


I think we can expect this to be a pretty common error, given this is
the default behavior of Microsoft Certificate Services. I would thus
like to make the error message more juicy.

We need to make sure we offer some pointers for these users or they will
just blame IPA for screwing up. So, the information I wrote

https://bugzilla.redhat.com/show_bug.cgi?id=1129558#c11

need to somehow get to the error message as a potential/likely root
cause of the problem. Whether you write it in the error message itself
or update the design page and just insert a link is up to you.

Martin


I would rather document this and have users read the documentation, 
which they should do anyway when something goes wrong. There are many 
errors in IPA which are common and users may blame IPA for them and I 
don't see what makes this one so special that it should require a 
special treatment.


Anyway, I have created 
http://www.freeipa.org/page/Troubleshooting#External_CA_renewal_with_ipa-cacert-manage_fails.


Honza

--
Jan Cholasta

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 383 Check subject name encoding in ipa-cacert-manage renew

2014-12-05 Thread Martin Kosek

On 12/05/2014 11:34 AM, Jan Cholasta wrote:

Dne 5.12.2014 v 09:03 Martin Kosek napsal(a):

On 12/04/2014 09:36 AM, Jan Cholasta wrote:

+if x509.get_der_subject(cert, x509.DER) != der_subject:
+raise admintool.ScriptError(Subject name encoding
mismatch)


I think we can expect this to be a pretty common error, given this is
the default behavior of Microsoft Certificate Services. I would thus
like to make the error message more juicy.

We need to make sure we offer some pointers for these users or they will
just blame IPA for screwing up. So, the information I wrote

https://bugzilla.redhat.com/show_bug.cgi?id=1129558#c11

need to somehow get to the error message as a potential/likely root
cause of the problem. Whether you write it in the error message itself
or update the design page and just insert a link is up to you.

Martin


I would rather document this and have users read the documentation, which they
should do anyway when something goes wrong. There are many errors in IPA which
are common and users may blame IPA for them and I don't see what makes this one
so special that it should require a special treatment.


I saw several reasons:
- Certificateinstallation error are more common than the others and users are 
usually quite lost in what to do with them.

- In this case, we know by 90% probability what is the root cause
- It will block one of the main use cases for the new CA renewal tool and 
people will likely hit it as MS CAs is one of the most common CAs and this is 
it's default behavior.


Giving more details in this case will not hurt us, but benefit users. So I 
still do not see the harm.



Anyway, I have created
http://www.freeipa.org/page/Troubleshooting#External_CA_renewal_with_ipa-cacert-manage_fails.


Good. Do you plan to reference the section or enhance the error message?

Martin

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 383 Check subject name encoding in ipa-cacert-manage renew

2014-12-05 Thread Jan Cholasta

Dne 5.12.2014 v 11:43 Martin Kosek napsal(a):

On 12/05/2014 11:34 AM, Jan Cholasta wrote:

Dne 5.12.2014 v 09:03 Martin Kosek napsal(a):

On 12/04/2014 09:36 AM, Jan Cholasta wrote:

+if x509.get_der_subject(cert, x509.DER) != der_subject:
+raise admintool.ScriptError(Subject name encoding
mismatch)


I think we can expect this to be a pretty common error, given this is
the default behavior of Microsoft Certificate Services. I would thus
like to make the error message more juicy.

We need to make sure we offer some pointers for these users or they will
just blame IPA for screwing up. So, the information I wrote

https://bugzilla.redhat.com/show_bug.cgi?id=1129558#c11

need to somehow get to the error message as a potential/likely root
cause of the problem. Whether you write it in the error message itself
or update the design page and just insert a link is up to you.

Martin


I would rather document this and have users read the documentation,
which they
should do anyway when something goes wrong. There are many errors in
IPA which
are common and users may blame IPA for them and I don't see what makes
this one
so special that it should require a special treatment.


I saw several reasons:
- Certificateinstallation error are more common than the others and
users are usually quite lost in what to do with them.
- In this case, we know by 90% probability what is the root cause
- It will block one of the main use cases for the new CA renewal tool
and people will likely hit it as MS CAs is one of the most common CAs
and this is it's default behavior.

Giving more details in this case will not hurt us, but benefit users. So
I still do not see the harm.


I do not see a harm either, my point is that we should probably point 
the user to documentation when *anything* in *any* script goes wrong, 
not just when some arbitrarily cherry-picked error occurs.





Anyway, I have created
http://www.freeipa.org/page/Troubleshooting#External_CA_renewal_with_ipa-cacert-manage_fails.



Good. Do you plan to reference the section or enhance the error message?


I plan to reference http://www.freeipa.org/page/Troubleshooting.



Martin



--
Jan Cholasta

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


[Freeipa-devel] [PATCH] 383 Check subject name encoding in ipa-cacert-manage renew

2014-12-04 Thread Jan Cholasta

Hi,

the attached patch fixes https://fedorahosted.org/freeipa/ticket/4781.

Honza

--
Jan Cholasta
From d1d323fa046a9aabed08571c2be2d91a02e866e0 Mon Sep 17 00:00:00 2001
From: Jan Cholasta jchol...@redhat.com
Date: Thu, 4 Dec 2014 08:15:46 +
Subject: [PATCH] Check subject name encoding in ipa-cacert-manage renew

https://fedorahosted.org/freeipa/ticket/4781
---
 ipaserver/install/ipa_cacert_manage.py | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ipaserver/install/ipa_cacert_manage.py b/ipaserver/install/ipa_cacert_manage.py
index 2a8d95f..8fda6a2 100644
--- a/ipaserver/install/ipa_cacert_manage.py
+++ b/ipaserver/install/ipa_cacert_manage.py
@@ -213,18 +213,21 @@ class CACertManage(admintool.AdminTool):
 try:
 nss_cert = x509.load_certificate(old_cert, x509.DER)
 subject = nss_cert.subject
+der_subject = x509.get_der_subject(old_cert, x509.DER)
 #pylint: disable=E1101
 pkinfo = nss_cert.subject_public_key_info.format()
 #pylint: enable=E1101
 
 nss_cert = x509.load_certificate_from_file(cert_file.name)
+cert = nss_cert.der_data
 if nss_cert.subject != subject:
 raise admintool.ScriptError(Subject name mismatch)
+if x509.get_der_subject(cert, x509.DER) != der_subject:
+raise admintool.ScriptError(Subject name encoding mismatch)
 #pylint: disable=E1101
 if nss_cert.subject_public_key_info.format() != pkinfo:
 raise admintool.ScriptError(Subject public key info mismatch)
 #pylint: enable=E1101
-cert = nss_cert.der_data
 finally:
 del nss_cert
 nss.nss_shutdown()
@@ -238,7 +241,7 @@ class CACertManage(admintool.AdminTool):
 tmpdb.add_cert(cert, 'IPA CA', 'C,,')
 except ipautil.CalledProcessError, e:
 raise admintool.ScriptError(
-Not compatible with the current CA certificate: %s, e)
+Not compatible with the current CA certificate: %s % e)
 
 ca_certs = x509.load_certificate_list_from_file(ca_file.name)
 for ca_cert in ca_certs:
-- 
2.1.0

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel