Commit 8eff4234 authored by Niels Möller's avatar Niels Möller

* src/dsa.h: New file, all dsa-related declarations moved here

from dsa_keygen.h (which is obsoleted) and publickey_crypto.h.

* src/publickey_crypto.h (DSA_MAX_SIZE): New constant.

Rev: src/dsa.h:1.1
Rev: src/dsa_keygen.h:1.6
Rev: src/publickey_crypto.h:1.41
parent c01cac9a
/* dsa.h
*
* $Id$
*/
/* lsh, an implementation of the ssh protocol
*
* Copyright (C) 2000 Niels Mller
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef LSH_DSA_H_INCLUDED
#define LSH_DSA_H_INCLUDED
#include "bignum.h"
#include "publickey_crypto.h"
#define GABA_DECLARE
#include "dsa.h.x"
#undef GABA_DECLARE
/* DSA signatures */
/* The standard says that DSA public keys are at most 1024 bits, i.e.
* 128 octets. We are a little more liberal than that. Note that
* allowing really large keys opens for Denial-of-service attacks. */
#define DSA_MAX_SIZE 300
/* NOTE: These definitions should not really be public. But the
* structures are needed for both plain ssh-dss and spki-style dsa. */
/* DSA definitions */
/* GABA:
(struct
(name dsa_public)
(vars
(p bignum)
(q bignum)
(g bignum)
(y bignum)))
*/
/* GABA:
(class
(name dsa_signer)
(super signer)
(vars
(random object randomness)
(public struct dsa_public)
(a bignum)))
*/
/* GABA:
(class
(name dsa_verifier)
(super verifier)
(vars
(public struct dsa_public)))
*/
void init_dsa_public(struct dsa_public *public);
/* parse an ssh keyblob */
int parse_dsa_public(struct simple_buffer *buffer,
struct dsa_public *public);
struct sexp *
make_dsa_public_key(struct dsa_public *dsa);
struct signature_algorithm *
make_dsa_algorithm(struct randomness *random);
/* Non spki keys */
struct dsa_verifier *
make_ssh_dss_verifier(UINT32 public_length,
const UINT8 *public);
struct lsh_string *
ssh_dss_public_key(struct signer *s);
#if DATAFELLOWS_WORKAROUNDS
struct verifier *
make_dsa_verifier_kludge(struct verifier *v);
struct signer *
make_dsa_signer_kludge(struct signer *dsa);
#endif /* DATAFELLOWS_WORKAROUNDS */
void dsa_nist_gen(mpz_t p, mpz_t q, struct randomness *r, unsigned l);
void dsa_find_generator(mpz_t g, struct randomness *r, mpz_t p, mpz_t q);
struct sexp *
dsa_generate_key(struct randomness *r, unsigned level);
#endif /* LSH_DSA_H_INCLUDED */
......@@ -27,12 +27,6 @@
#ifndef LSH_DSA_KEYGEN_H_INCLUDED
#define LSH_DSA_KEYGEN_H_INCLUDED
#include "bignum.h"
void dsa_nist_gen(mpz_t p, mpz_t q, struct randomness *r, unsigned l);
void dsa_find_generator(mpz_t g, struct randomness *r, mpz_t p, mpz_t q);
struct sexp *
dsa_generate_key(struct randomness *r, unsigned level);
#warning dsa_keygen.h is obsolete
#endif /* LSH_DSA_KEYGEN_H_INCLUDED */
......@@ -49,76 +49,6 @@ make_keypair(UINT32 type,
struct lsh_string *public,
struct signer *private);
/* DSA definitions */
/* GABA:
(struct
(name dsa_public)
(vars
(p bignum)
(q bignum)
(g bignum)
(y bignum)))
*/
/* DSA signatures */
/* The stadard says that DSA public keys are at most 1024 bits, i.e.
* 128 octets. We are a little more liberal than that. Note that
* allowing really large keys opens for Denial-of-service attacks. */
#define DSA_MAX_SIZE 300
/* NOTE: These definitions should not really be public. But the
* structures are needed for both plain ssh-dss and spki-style dsa. */
/* GABA:
(class
(name dsa_signer)
(super signer)
(vars
(random object randomness)
(public struct dsa_public)
(a bignum)))
*/
/* GABA:
(class
(name dsa_verifier)
(super verifier)
(vars
(public struct dsa_public)))
*/
void init_dsa_public(struct dsa_public *public);
/* parse an ssh keyblob */
int parse_dsa_public(struct simple_buffer *buffer,
struct dsa_public *public);
struct sexp *
make_dsa_public_key(struct dsa_public *dsa);
struct signature_algorithm *make_dsa_algorithm(struct randomness *random);
/* Non spki keys */
struct dsa_verifier *
make_ssh_dss_verifier(UINT32 public_length,
const UINT8 *public);
struct lsh_string *
ssh_dss_public_key(struct signer *s);
#if DATAFELLOWS_WORKAROUNDS
struct verifier *make_dsa_verifier_kludge(struct verifier *v);
struct signer *make_dsa_signer_kludge(struct signer *dsa);
/* struct signature_algorithm *make_dsa_kludge_algorithm(struct randomness *random); */
#endif
struct signer *make_dsa_signer_classic(struct signer *s);
struct verifier *make_dsa_verifier_classic(struct verifier *v);
/* Groups. For now, assume that all group elements are represented by
* bignums. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment