6.0.0-beta1
7/25/25

[#6252] s/mime private cert save to postgresql failed
Summary s/mime private cert save to postgresql failed
Queue IMP
Queue Version 4.1.6
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester szimszon (at) oregpreshaz (dot) eu
Created 02/12/2008 (6373 days ago)
Due
Updated 02/26/2008 (6359 days ago)
Assigned 02/12/2008 (6373 days ago)
Resolved 02/26/2008 (6359 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
02/26/2008 03:15:00 PM Jan Schneider State ⇒ Not A Bug
 
02/26/2008 03:05:16 PM szimszon (at) oregpreshaz (dot) eu Comment #15 Reply to this comment
Eh, mea culpa.



I created a db with the "createdb --encoding=UNICODE --owner horde 
horde" command.



And the --encoding=UNICODE was wrong...



Now I dropped it and created the database without "--encoding=UNICODE" 
and everything is fine.



Sorry.


02/26/2008 02:31:44 PM szimszon (at) oregpreshaz (dot) eu Comment #14 Reply to this comment
With the RC2 the situation is the same...
02/26/2008 02:27:46 PM szimszon (at) oregpreshaz (dot) eu Comment #13 Reply to this comment
That helps a lot. And it makes me wonder, which encoding *does* your
public have? I.e. is the name in the comment block of the key utf-8
or iso-8859-1 encoded?
Hm, I can only guess :( It could be iso-8859-2 :-o
And how did you get that key in the first place?
From http://thawte.com
Did you export it from somewhere?
From Thunderbird.
Did you create it on the
command line? If so, how?
I created it through thawte's web interface...
02/26/2008 01:54:10 PM Jan Schneider Comment #12 Reply to this comment
That helps a lot. And it makes me wonder, which encoding *does* your 
public have? I.e. is the name in the comment block of the key utf-8 or 
iso-8859-1 encoded? And how did you get that key in the first place? 
Did you export it from somewhere? Did you create it on the command 
line? If so, how?
02/26/2008 01:11:06 PM szimszon (at) oregpreshaz (dot) eu Comment #11 Reply to this comment
Now I switched on the logging :)



Feb 25 20:46:45 HORDE [emergency] [imp] DB Error: unknown error: 
INSERT INTO horde_prefs (pref_uid, pref_scope, pref_name, pref_value) 
VALUES('szimszon@oregpreshaz.eu', 'imp', 'smime_private_key', 'Bag 
Attributes

     friendlyName: Szabolcs J.nos Gyuris''s Thawte Consulting (Pty) Ltd. ID

     localKeyID: 24 77 B9 AF B8 CD 6C 3D FE 85 13 33 E5 E4 D6 C4 5E 61 DE 86

Key Attributes: <No Attributes>

-----BEGIN RSA PRIVATE KEY-----

...

-----END RSA PRIVATE KEY-----') [nativecode=ERROR:  invalid byte 
sequence for encoding "UTF8": 0xe16e6f

HINT:  This error can also happen if the byte sequence does not match 
the encoding expected by the server, which is controlled by 
"client_encoding".] [on line 263 of 
"/srv/www/oregpreshaz.eu/ssl/horde.oregpreshaz.eu/lib/Horde/Prefs/sql.php"]
02/25/2008 09:26:10 PM szimszon (at) oregpreshaz (dot) eu Comment #10 Reply to this comment
Yes, but you said you trimmed a lot of text from it. Make sure you
set the max_size setting for your Prefs backend appropriately - if
that's the issue you may get better error info that way.
I was now able to insert manualy the certificate without trimming out 
any text.

I don't think that it's a data length problem. The pref_value is a 
"text" field.


02/25/2008 06:57:47 PM Chuck Hagenbuch Comment #9 Reply to this comment
I was able to put my key in db manualy.
Yes, but you said you trimmed a lot of text from it. Make sure you set 
the max_size setting for your Prefs backend appropriately - if that's 
the issue you may get better error info that way.
02/25/2008 06:54:41 PM szimszon (at) oregpreshaz (dot) eu Comment #8 Reply to this comment
Is the pref_value field too small for your key?
I was able to put my key in db manualy.
Can you try IMP 4.2
and Horde 3.2 (the release candidates)?
I'll try...



  Are other preferences stored
normally in your database?
Yes. my pgp key is stored with no problems...
02/25/2008 06:32:07 PM Chuck Hagenbuch Comment #7 Reply to this comment
Is the pref_value field too small for your key? Can you try IMP 4.2 
and Horde 3.2 (the release candidates)? Are other preferences stored 
normally in your database?
02/24/2008 08:05:55 PM szimszon (at) oregpreshaz (dot) eu Comment #6 Reply to this comment
What do you mean with this?
Sorry for my poor english :(



So...



1. I have a clean database with no personal data.

2. I log into the website.

3. I upload my x.509 certificate

4. I can use it everything is fine

5. but there aren't any database entry in the database with my x.509 
certificate (I think it's only in cache)

SELECT * from horde_prefs where pref_uid='szimszon@xxxxxxxxxxx' and 
pref_name like 'smime_%';



         pref_uid         | pref_scope |       pref_name       |       
     pref_value

-------------------------+------------+-----------------------+---------------------------------

hordewebmail=#



6. I del my x.509 certificate

7. after that there is 3 entry in the database:

SELECT * from horde_prefs where pref_uid='szimszon@xxxxxxxxxx' and 
pref_name like 'smime_%';



         pref_uid         | pref_scope |       pref_name       |       
     pref_value

-------------------------+------------+-----------------------+---------------------------------

  szimszon@xxxxxxxxxxxxxx | imp        | smime_additional_cert |

  szimszon@xxxxxxxxxxxxxx | imp        | smime_private_key     |

  szimszon@xxxxxxxxxxxxxx | imp        | smime_public_key      |

hordewebmail=#


02/24/2008 12:16:07 PM Jan Schneider Comment #5 Reply to this comment
If I delete it on the webpage then 3 entry  appears with
pref_name='smime_public_key' and pref_name='smime_private_key' and
pref_name='smime_additional_cert' with pref_value='' .
What do you mean with this?
02/15/2008 08:29:00 AM szimszon (at) oregpreshaz (dot) eu Comment #4 Reply to this comment
The pgp import works great...
02/12/2008 05:02:53 PM szimszon (at) oregpreshaz (dot) eu Comment #3 Reply to this comment
What happens if you try to import it?
It works until I log off. And there's no database entry with 
pref_name='smime_public_key' and pref_name='smime_private_key'... 
There's no error message, nothing.



If I delete it on the webpage then 3 entry  appears with 
pref_name='smime_public_key' and pref_name='smime_private_key' and 
pref_name='smime_additional_cert' with pref_value='' .


02/12/2008 04:35:37 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
What happens if you try to import it?
02/12/2008 03:23:31 PM szimszon (at) oregpreshaz (dot) eu Comment #1
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Queue ⇒ IMP
Summary ⇒ s/mime private cert save to postgresql failed
Type ⇒ Bug
Reply to this comment
I wonder if somebody could help me.



I have an x.509 certificate from Thawte with some international characters:

subject=/SN=Gyuris/GN=Szabolcs J\xC3\xA1nos/CN=Szabolcs J\xC3\xA1nos Gyuris



I don't know what the problem is but my private certificate don't get saved to

smime_private_key, smime_public_key... :(



The certificate is originated from thunderbird backup system.

After I try to import the cert to IMP everything seems to be ok but nothing

happens in the database. But I was able to save my cert. manually to my

postgresql database. I have to remove all the text from cert. before 
-----BEGIN

CERTIFICATE----- and -----BEGIN RSA PRIVATE KEY-----...



Thank you!

Saved Queries