Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Documentation for TXT_DB errors?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
"Charles Mills"  
View profile  
 More options Oct 1 2012, 10:12 am
Newsgroups: mailing.openssl.users
From: charl...@mcn.org ("Charles Mills")
Date: Mon, 1 Oct 2012 10:11:33 -0400
Local: Mon, Oct 1 2012 10:11 am
Subject: Documentation for TXT_DB errors?
Is there specific documentation anywhere for TXT_DB errors?

I'm not a total newbie at this but I am not an expert. I have issued server
certificates before but now I am stuck on a TXT_DB error 2.

serial.txt exists and contains 1C. index.txt exists and contains 17
(decimal) lines.

Unless I am confused the CN I am trying to issue for is unique. A revoke for
the_cn_name.PEM fails. However some of the additional DNS in the certificate
are not unique. Is that a problem? In other words, I am trying to issue
foo.PEM for CN=foo. foo.PEM does not exist and O=foo does not appear in
index.txt. But I am trying to issue the certificate with DNS.2=bar. I may
already have outstanding unrevoked certificates with DNS.2=bar. Is that a
problem?

What should I be looking for that accounts for TXT_DB error 2 in this
situation? Is there authoritative documentation I should be reading?

Thanks much,

Charles

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-us...@openssl.org
Automated List Manager                           majord...@openssl.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
"Dave Thompson"  
View profile  
 More options Oct 1 2012, 6:03 pm
Newsgroups: mailing.openssl.users
From: dthomp...@prinpay.com ("Dave Thompson")
Date: Mon, 1 Oct 2012 18:01:36 -0400
Local: Mon, Oct 1 2012 6:01 pm
Subject: RE: Documentation for TXT_DB errors?

> From: owner-openssl-us...@openssl.org On Behalf Of Charles Mills
> Sent: Monday, 01 October, 2012 10:12
> Is there specific documentation anywhere for TXT_DB errors?

AFAIK only $sourcetree/crypto/txt_db/txt_db.h
Unlike most(?) other modules in openssl, txt_db does NOT use
the ERR_ module with its error strings capability; bummer.

> I'm not a total newbie at this but I am not an expert. I have
> issued server
> certificates before but now I am stuck on a TXT_DB error 2.

2 is DB_ERROR_INDEX_CLASH .

> serial.txt exists and contains 1C. index.txt exists and contains 17
> (decimal) lines.

Does any line in index.txt have col 3 (serial) 1C? All certs from
a CA (at least under a given CA key+cert if you chain with AKI,
as is generally best practice but optional in openssl) must have
unique serials, and openssl 'ca' enforces this with an in-memory
index on data in file (normally and a bit misleadingly) index.txt,
in addition to using file serial which if not interfered with
assigns sequential thus unique values.

If serial(.txt?) started from 00 or 01, and only 'ca' updated it,
and you didn't delete any lines from index.txt or replace that
with a copy/version that is missing lines (like a backup),
you should have 27 or 28 (respectively) lines in index.txt,
for each serial value through hex 1B in sequence.

The usual name for the serial file is just serial no .txt.
I assume either this is a typo or you changed the config
so that serial.txt is actually being used. If not, look at
the file that is actually being used.

> Unless I am confused the CN I am trying to issue for is
> unique. A revoke for
> the_cn_name.PEM fails. However some of the additional DNS in
> the certificate
> are not unique. Is that a problem? In other words, I am
> trying to issue
> foo.PEM for CN=foo. foo.PEM does not exist and O=foo does not
> appear in
> index.txt. But I am trying to issue the certificate with
> DNS.2=bar. I may
> already have outstanding unrevoked certificates with
> DNS.2=bar. Is that a
> problem?

You say revoke (I assume ca -revoke) the_cn_name.PEM 'fails'
but then you say CN=foo and foo.PEM does not exist. -revoke uses
existing cert file(s) to determine serial, and check subject.
If the file doesn't exist this can't work. Was the error
nonexistent file, or something else, and if so what?

A cert's subject (or other) DN (Distinguished Name) can have
multiple attributes; CN (Common Name) is the only one important
for SSL or at least HTTPS server, and maybe all you are using.
Specifically, do you mean a subject of /CN=foo or /O=foo ?
Those are *different* DNs as far as X.509 is concerned,
but the latter is not useful for an SSL server cert.

Further, there is no requirement the subject DN be unique.
You can quite reasonably have multiple certs for one subject,
from the same CA (with different serials) or different CAs.
It may sometimes be confusing and undesirable, and openssl 'ca'
has an option to reject it (within one CA) but not by default.
Did you configure that on?

The *issuer* DN, i.e. the *CA* DN, should be unique, to allow
openssl to verify, or auto-chain, a child cert. If you only
created yourself one CA key+cert, it is necessarily unique.

Assuming you mean DNS.2 *in subjectAltName aka SAN*, SAN values
(also) don't need to be unique and aren't checked. I guess .2=bar
and (.1)=subject=foo, another good practice not enforced by openssl?
Aside: I'm pretty sure you don't need the .nnn i.e. .2 here,
since openssl treats subjectAltName as one attribute containing
multiple values, not multiple attributes that must be combined.

> What should I be looking for that accounts for TXT_DB error 2 in this
> situation? Is there authoritative documentation I should be reading?

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-us...@openssl.org
Automated List Manager                           majord...@openssl.org

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
"Charles Mills"  
View profile  
 More options Oct 2 2012, 9:04 am
Newsgroups: mailing.openssl.users
From: charl...@mcn.org ("Charles Mills")
Date: Tue, 2 Oct 2012 09:03:18 -0400
Local: Tues, Oct 2 2012 9:03 am
Subject: RE: Documentation for TXT_DB errors?
Dave, as always, thanks.

> Unlike most(?) other modules in openssl, txt_db does NOT use the ERR_

module with its error strings

I love OpenSSL and I'm not going to tell you how to run your organization
but better documentation would probably mean both wider acceptance and fewer
dumb questions from folks like me!

> Does any line in index.txt have col 3 (serial) 1C?

No. Here is a cut and paste of the entire left hand side of index.txt.

R       130821124505Z   120822123411Z   0B      unknown /CN=C
R       130822123506Z   120822124611Z   0C      unknown /CN=C
V       130822124721Z           0D      unknown /CN=Charles Mills
R       130822125501Z   120823201015Z   0E      unknown /CN=C
R       130822135246Z   120822185456Z   0F      unknown /CN=C
R       130822185636Z   120822190409Z   10      unknown /CN=C
R       130822190502Z   120823201600Z   11      unknown /CN=C
R       130823201708Z   120824133410Z   12      unknown /CN=C
R       130824133506Z   120824145025Z   13      unknown /CN=C
R       130824134844Z   120824135333Z   14      unknown /CN=C
V       130824135429Z           15      unknown /CN=Charles Mills
V       130824152620Z           16      unknown /CN=Charles Mills
R       130830225706Z   120830235325Z   17      unknown /CN=C
R       130831000017Z   120831231148Z   18      unknown /CN=C
R       130831233626Z   120904174701Z   19      unknown /CN=C
R       130905130939Z   120905182554Z   1A      unknown /CN=C
R       130912152715Z   120912155806Z   1B      unknown /CN=C
R       120919161159Z   121001143321Z   93E150296A86E7C7

> you should have 27 or 28 (respectively) lines in index.txt

Early on in my use of OpenSSL, when I (a.) understood even less than I do
now and (b.) issued lots of "practice" certificates I "solved" the duplicate
certificate problem by repeatedly deleting and re-creating index.txt. My
bad. Perhaps I should both delete it ONE more time and reset serial to 00?
This is a total playpen situation. I have no pretense of being any sort of
"real" CA at this time.

> The usual name for the serial file is just serial no .txt

Definitely serial.txt. Not sure how that happened. Something in the Win32
pre-built distribution that I got?

> If the file doesn't exist this can't work. Was the error nonexistent file,

or something else, and if so what?

Non-existent file. Was not sure if revoke started from the file or from the
index.

> Did you configure that on?

Config file in use says

unique_subject  = no

> Further, there is no requirement the subject DN be unique.

Wow, I ran into lots of trouble with that issue. That's how I got into
re-creating the index file (which I now know was wrong, but nonetheless that
is why I did it). Any idea why I would have had certificate requests
rejected as duplicates then?

> Aside: I'm pretty sure you don't need the .nnn i.e. .2 here, since openssl

treats subjectAltName as one

Hmmm. It's working so I don't think I'll touch it. I know it took a lot of
hacking to get it to work. Again, may I repeat my plea for documentation?
Why do open source projects attract plenty of coders but not tech writers?
Aren't there tech writers who would love to make a contribution to open
source?

thanks and take care,

Charles


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
"Charles Mills"  
View profile  
 More options Oct 2 2012, 5:07 pm
Newsgroups: mailing.openssl.users
From: charl...@mcn.org ("Charles Mills")
Date: Tue, 2 Oct 2012 17:06:12 -0400
Local: Tues, Oct 2 2012 5:06 pm
Subject: RE: Documentation for TXT_DB errors?
I deleted index.txt and reset serial.txt to 00 and that solved the problem.

Hope that was not a terrible idea.

I understand that I have lost the ability to revoke any previous
certificates.

I won't edit index.txt again.

Charles


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
"Dave Thompson"  
View profile  
 More options Oct 2 2012, 11:51 pm
Newsgroups: mailing.openssl.users
From: dthomp...@prinpay.com ("Dave Thompson")
Date: Tue, 2 Oct 2012 23:49:36 -0400
Local: Tues, Oct 2 2012 11:49 pm
Subject: RE: Documentation for TXT_DB errors?

> From: owner-openssl-us...@openssl.org On Behalf Of Charles Mills
> Sent: Tuesday, 02 October, 2012 17:06
> I deleted index.txt and reset serial.txt to 00 and that
> solved the problem.

> Hope that was not a terrible idea.

If this was play data as said it shouldn't hurt, but I'm
not sure it's a true solution since I didn't see anything
wrong in the data you showed in your previous message (to
which I was working on a reply when you sent this update).

> I understand that I have lost the ability to revoke any previous
> certificates.

To be exact, not entirely. If you put a higher value like 20
in serial.txt and thus use distinct serial values going forward,
you could manually reinsert a "forgotten" old entry back into the
"database", which is enough to revoke it with 'ca' (or 'ocsp').
Even if you reuse serials, you could revoke the serial for an old
cert at the cost of also revoking some new(er) cert, which you
would presumably then replace. Real CAs replace certs sometimes,
for a variety of reasons, so that's not crazy but is extra work.

But for play data no one should really rely on these certs anyway
so there's no risk in leaving them "valid". I assume you are doing
this for testing, so just test with the new ones and discard the old.
Also, what did you use for 'days' (validity period)? If it's short,
once your old certs expire their revocation status doesn't matter.

> I won't edit index.txt again.

If you editted, as opposed to just deleting as mentioned before,
it's possible you messed something up in the file. If the problem
doesn't recur, I'd accept that as a not-impossible explanation  
(cf Sherlock Holmes). But I suggest keeping track of what you do,
so if the problem does recur you can post a complete scenario
for us (maybe but not necessarily me) to look at.

> Charles

> -----Original Message-----
> From: Charles Mills [mailto:charl...@mcn.org]
> Sent: Tuesday, October 02, 2012 9:03 AM
> To: 'openssl-us...@openssl.org'
> Subject: RE: Documentation for TXT_DB errors?

<snip most as superceded, but one point I wanted to keep:>

> Hmmm. It's working so I don't think I'll touch it. I know it
> took a lot of
> hacking to get it to work. Again, may I repeat my plea for
> documentation?
> Why do open source projects attract plenty of coders but not
> tech writers?
> Aren't there tech writers who would love to make a
> contribution to open
> source?

Yes, documentation is a problem for lots of open-source,
and openssl is unfortunately quite typical in this area.
But until people volunteer, or somebody pays, that's life.
I think this list does help some -- and to a point I snipped,
your questions WEREN'T dumb or inappropriate in my opinion,
and certainly no one else raised any objection.

Cheers.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-us...@openssl.org
Automated List Manager                           majord...@openssl.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
"lists"  
View profile  
 More options Oct 4 2012, 11:50 am
Newsgroups: mailing.openssl.users
From: li...@rustichelli.net ("lists")
Date: Thu, 4 Oct 2012 17:42:46 +0200
Local: Thurs, Oct 4 2012 11:42 am
Subject: Re: Documentation for TXT_DB errors?
On 10/03/2012 05:49 AM, Dave Thompson wrote:

>> I deleted index.txt and reset serial.txt to 00 and that
>> solved the problem.

>> Hope that was not a terrible idea.

In my opinion, reusing serials is a *very bad* idea in general.
It is definitely deprecated and maybe forbidden in some legal context (I work in Italy, no officially appointed CA would reuse serials here).
Think about the existence of an OpenSSL function named X509_issuer_and_serial_hash.
It exists exactly because serials are intended to be unique and combining them with the CA (the hash is for leveraging the output) makes easy to have a unique identifier for certificates in a system; I personally use it.
Just to present another example, OCSP can be queried by a serial number (of the certified that is to be verified).

(sorry I'm not keeping the whole message. My MX is a blacklist and I'm forced to use an  awkward webmail interface...)

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-us...@openssl.org
Automated List Manager                           majord...@openssl.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
"Charles Mills"  
View profile  
 More options Oct 5 2012, 8:41 am
Newsgroups: mailing.openssl.users
From: charl...@mcn.org ("Charles Mills")
Date: Fri, 5 Oct 2012 08:40:11 -0400
Local: Fri, Oct 5 2012 8:40 am
Subject: RE: Documentation for TXT_DB errors?
I hear you (whoever you are!).

It's a playpen CA. I'm a software developer. These certificates will never be allowed out into the wild.

Charles


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »