hashsum.c: Return nonzero from `checkhash' on errors.
[u/mdw/catacomb] / group-parse.c
index 276e2d2..7711952 100644 (file)
@@ -1,13 +1,13 @@
 /* -*-c-*-
  *
- * $Id: group-parse.c,v 1.2 2004/04/03 03:32:05 mdw Exp $
+ * $Id: group-parse.c,v 1.3 2004/04/08 01:36:15 mdw Exp $
  *
  * Parse group description strings
  *
  * (c) 2004 Straylight/Edgeware
  */
 
-/*----- Licensing notice --------------------------------------------------* 
+/*----- Licensing notice --------------------------------------------------*
  *
  * This file is part of Trivial IP Encryption (TrIPE).
  *
  * 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.
- * 
+ *
  * TrIPE 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 TrIPE; if not, write to the Free Software Foundation,
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-/*----- Revision history --------------------------------------------------* 
- *
- * $Log: group-parse.c,v $
- * Revision 1.2  2004/04/03 03:32:05  mdw
- * General robustification.
- *
- * Revision 1.1  2004/04/01 12:50:09  mdw
- * Add cyclic group abstraction, with test code.  Separate off exponentation
- * functions for better static linking.  Fix a buttload of bugs on the way.
- * Generally ensure that negative exponents do inversion correctly.  Add
- * table of standard prime-field subgroups.  (Binary field subgroups are
- * currently unimplemented but easy to add if anyone ever finds a good one.)
- *
- */
-
 /*----- Header files ------------------------------------------------------*/
 
 #include "group.h"
@@ -68,7 +53,7 @@ group *group_parse(qd_parse *qd)
     case 0: {
       dh_param dp;
       qd_delim(qd, '{');
-      if (dh_parse(qd, &dp)) break;
+      if (dh_parse(qd, &dp)) goto ouch;
       qd_delim(qd, '}');
       g = group_prime(&dp);
       dh_paramfree(&dp);
@@ -76,12 +61,13 @@ group *group_parse(qd_parse *qd)
     case 1: {
       ec_info ei;
       qd_delim(qd, '{');
-      if (ec_infoparse(qd, &ei)) break;
+      if (ec_infoparse(qd, &ei)) goto ouch;
       qd_delim(qd, '}');
       g = group_ec(&ei);
     } break;
   }
   if (!g) qd->e = "bad group parameters";
+ouch:
   return (g);
 }