Believe both entry types (old and new) when looking for the key.

This commit is contained in:
relyea%netscape.com 2002-09-06 23:16:42 +00:00
Родитель e856e7ef2f
Коммит da7aa009d9
1 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@ -32,7 +32,7 @@
*
* Private Key Database code
*
* $Id: keydb.c,v 1.29 2002-09-06 00:27:49 wtc%netscape.com Exp $
* $Id: keydb.c,v 1.30 2002-09-06 23:16:42 relyea%netscape.com Exp $
*/
#include "lowkeyi.h"
@ -1141,6 +1141,18 @@ nsslowkey_KeyForCertExists(NSSLOWKEYDBHandle *handle, NSSLOWCERTCertificate *cer
}
status = (* handle->db->get)(handle->db, &namekey, &dummy, 0);
/* some databases have the key stored as a signed value */
if (status) {
unsigned char *buf = (unsigned char *)PORT_Alloc(namekey.size+1);
if (buf) {
PORT_Memcpy(&buf[1], namekey.data, namekey.size);
buf[0] = 0;
namekey.data = buf;
namekey.size ++;
status = (* handle->db->get)(handle->db, &namekey, &dummy, 0);
PORT_Free(buf);
}
}
nsslowkey_DestroyPublicKey(pubkey);
if ( status ) {
return PR_FALSE;