X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=keyindex.c;h=c656bd142e9f7f500965c182bdecb3b6c83d3c6b;hb=357fbc65bfab230bbf12313e8b458d8325a6174f;hp=ae1bcf89b1501f3a3e5bda5663ddaa44905d20bf;hpb=ced2e52d6466e53a9e7d1cc1d1b606e902ba592b;p=onak.git
diff --git a/keyindex.c b/keyindex.c
index ae1bcf8..c656bd1 100644
--- a/keyindex.c
+++ b/keyindex.c
@@ -13,8 +13,7 @@
* more details.
*
* You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * this program. If not, see .
*/
#include
@@ -26,14 +25,12 @@
#include "decodekey.h"
#include "getcgi.h"
-#include "hash.h"
#include "keydb.h"
#include "keyid.h"
#include "keyindex.h"
#include "keystructs.h"
#include "log.h"
#include "onak.h"
-#include "onak-conf.h"
#include "openpgp.h"
/*
@@ -96,8 +93,21 @@ unsigned int keylength(struct openpgp_packet *keydata)
case OPENPGP_PKALGO_ECDSA:
case OPENPGP_PKALGO_EDDSA:
/* Elliptic curve key size is based on OID */
+ /* Curve25519 / 1.3.6.1.4.1.3029.1.5.1 */
+ if ((keydata->data[6] == 10) &&
+ (keydata->data[7] == 0x2B) &&
+ (keydata->data[8] == 0x06) &&
+ (keydata->data[9] == 0x01) &&
+ (keydata->data[10] == 0x04) &&
+ (keydata->data[11] == 0x01) &&
+ (keydata->data[12] == 0x97) &&
+ (keydata->data[13] == 0x55) &&
+ (keydata->data[14] == 0x01) &&
+ (keydata->data[15] == 0x05) &&
+ (keydata->data[16] == 0x01)) {
+ length = 255;
/* Ed25519 / 1.3.6.1.4.1.11591.15.1 */
- if ((keydata->data[6] == 9) &&
+ } else if ((keydata->data[6] == 9) &&
(keydata->data[7] == 0x2B) &&
(keydata->data[8] == 0x06) &&
(keydata->data[9] == 0x01) &&
@@ -107,7 +117,7 @@ unsigned int keylength(struct openpgp_packet *keydata)
(keydata->data[13] == 0x47) &&
(keydata->data[14] == 0x0F) &&
(keydata->data[15] == 0x01)) {
- length = 256;
+ length = 255;
/* nistp256 / 1.2.840.10045.3.1.7 */
} else if ((keydata->data[6] == 8) &&
(keydata->data[7] == 0x2A) &&