Changeset View
Changeset View
Standalone View
Standalone View
dh.c
/* $OpenBSD: dh.c,v 1.68 2018/09/17 15:40:14 millert Exp $ */ | /* $OpenBSD: dh.c,v 1.71 2019/09/06 06:08:11 djm Exp $ */ | ||||
/* | /* | ||||
* Copyright (c) 2000 Niels Provos. All rights reserved. | * Copyright (c) 2000 Niels Provos. All rights reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions | * modification, are permitted provided that the following conditions | ||||
* are met: | * are met: | ||||
* 1. Redistributions of source code must retain the above copyright | * 1. Redistributions of source code must retain the above copyright | ||||
* notice, this list of conditions and the following disclaimer. | * notice, this list of conditions and the following disclaimer. | ||||
Show All 12 Lines | |||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
*/ | */ | ||||
#include "includes.h" | #include "includes.h" | ||||
#ifdef WITH_OPENSSL | #ifdef WITH_OPENSSL | ||||
#include <openssl/bn.h> | |||||
#include <openssl/dh.h> | |||||
#include <errno.h> | #include <errno.h> | ||||
#include <stdarg.h> | #include <stdarg.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <limits.h> | #include <limits.h> | ||||
#include <openssl/bn.h> | |||||
#include <openssl/dh.h> | |||||
#include "dh.h" | #include "dh.h" | ||||
#include "pathnames.h" | #include "pathnames.h" | ||||
#include "log.h" | #include "log.h" | ||||
#include "misc.h" | #include "misc.h" | ||||
#include "ssherr.h" | #include "ssherr.h" | ||||
#include "openbsd-compat/openssl-compat.h" | #include "openbsd-compat/openssl-compat.h" | ||||
▲ Show 20 Lines • Show All 353 Lines • ▼ Show 20 Lines | dh_new_group16(void) | ||||
return (dh_new_group_asc(gen, group16)); | return (dh_new_group_asc(gen, group16)); | ||||
} | } | ||||
/* rfc3526 group 18 "8192-bit MODP Group" */ | /* rfc3526 group 18 "8192-bit MODP Group" */ | ||||
DH * | DH * | ||||
dh_new_group18(void) | dh_new_group18(void) | ||||
{ | { | ||||
static char *gen = "2", *group16 = | static char *gen = "2", *group18 = | ||||
"FFFFFFFF" "FFFFFFFF" "C90FDAA2" "2168C234" "C4C6628B" "80DC1CD1" | "FFFFFFFF" "FFFFFFFF" "C90FDAA2" "2168C234" "C4C6628B" "80DC1CD1" | ||||
"29024E08" "8A67CC74" "020BBEA6" "3B139B22" "514A0879" "8E3404DD" | "29024E08" "8A67CC74" "020BBEA6" "3B139B22" "514A0879" "8E3404DD" | ||||
"EF9519B3" "CD3A431B" "302B0A6D" "F25F1437" "4FE1356D" "6D51C245" | "EF9519B3" "CD3A431B" "302B0A6D" "F25F1437" "4FE1356D" "6D51C245" | ||||
"E485B576" "625E7EC6" "F44C42E9" "A637ED6B" "0BFF5CB6" "F406B7ED" | "E485B576" "625E7EC6" "F44C42E9" "A637ED6B" "0BFF5CB6" "F406B7ED" | ||||
"EE386BFB" "5A899FA5" "AE9F2411" "7C4B1FE6" "49286651" "ECE45B3D" | "EE386BFB" "5A899FA5" "AE9F2411" "7C4B1FE6" "49286651" "ECE45B3D" | ||||
"C2007CB8" "A163BF05" "98DA4836" "1C55D39A" "69163FA8" "FD24CF5F" | "C2007CB8" "A163BF05" "98DA4836" "1C55D39A" "69163FA8" "FD24CF5F" | ||||
"83655D23" "DCA3AD96" "1C62F356" "208552BB" "9ED52907" "7096966D" | "83655D23" "DCA3AD96" "1C62F356" "208552BB" "9ED52907" "7096966D" | ||||
"670C354E" "4ABC9804" "F1746C08" "CA18217C" "32905E46" "2E36CE3B" | "670C354E" "4ABC9804" "F1746C08" "CA18217C" "32905E46" "2E36CE3B" | ||||
Show All 28 Lines | static char *gen = "2", *group18 = | ||||
"4BCBC886" "2F8385DD" "FA9D4B7F" "A2C087E8" "79683303" "ED5BDD3A" | "4BCBC886" "2F8385DD" "FA9D4B7F" "A2C087E8" "79683303" "ED5BDD3A" | ||||
"062B3CF5" "B3A278A6" "6D2A13F8" "3F44F82D" "DF310EE0" "74AB6A36" | "062B3CF5" "B3A278A6" "6D2A13F8" "3F44F82D" "DF310EE0" "74AB6A36" | ||||
"4597E899" "A0255DC1" "64F31CC5" "0846851D" "F9AB4819" "5DED7EA1" | "4597E899" "A0255DC1" "64F31CC5" "0846851D" "F9AB4819" "5DED7EA1" | ||||
"B1D510BD" "7EE74D73" "FAF36BC3" "1ECFA268" "359046F4" "EB879F92" | "B1D510BD" "7EE74D73" "FAF36BC3" "1ECFA268" "359046F4" "EB879F92" | ||||
"4009438B" "481C6CD7" "889A002E" "D5EE382B" "C9190DA6" "FC026E47" | "4009438B" "481C6CD7" "889A002E" "D5EE382B" "C9190DA6" "FC026E47" | ||||
"9558E447" "5677E9AA" "9E3050E2" "765694DF" "C81F56E8" "80B96E71" | "9558E447" "5677E9AA" "9E3050E2" "765694DF" "C81F56E8" "80B96E71" | ||||
"60C980DD" "98EDD3DF" "FFFFFFFF" "FFFFFFFF"; | "60C980DD" "98EDD3DF" "FFFFFFFF" "FFFFFFFF"; | ||||
return (dh_new_group_asc(gen, group16)); | return (dh_new_group_asc(gen, group18)); | ||||
} | } | ||||
/* Select fallback group used by DH-GEX if moduli file cannot be read. */ | /* Select fallback group used by DH-GEX if moduli file cannot be read. */ | ||||
DH * | DH * | ||||
dh_new_group_fallback(int max) | dh_new_group_fallback(int max) | ||||
{ | { | ||||
debug3("%s: requested max size %d", __func__, max); | debug3("%s: requested max size %d", __func__, max); | ||||
if (max < 3072) { | if (max < 3072) { | ||||
Show All 30 Lines |