diff options
author | Jack Lloyd <[email protected]> | 2016-12-23 01:12:17 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-12-23 01:12:17 -0500 |
commit | dfcdc9012fd0b7a75ec35de614e9011416612f0e (patch) | |
tree | b7ac61afc06400a371e35edc05bfe30aecaaf4b0 /src/lib/pubkey/dl_group | |
parent | f1061aa4d2b6b07ff5291eb758aee6fecc8f1905 (diff) |
Add DL_Group tests
Fix a bug in how the 6144 and 8192 IETF MODP groups were encoded; they
have g and q values switched. Fixed by just switching the PEM header
to match the actual encoded format.
Rename DL_Group::X942_DH_PARAMETERS to ANSI_X9_42_DH_PARAMETERS to avoid
a macro conflict with Windows cryptography headers (GH #482)
Diffstat (limited to 'src/lib/pubkey/dl_group')
-rw-r--r-- | src/lib/pubkey/dl_group/dl_group.h | 4 | ||||
-rw-r--r-- | src/lib/pubkey/dl_group/dl_named.cpp | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/pubkey/dl_group/dl_group.h b/src/lib/pubkey/dl_group/dl_group.h index 39ad9b954..98a49649c 100644 --- a/src/lib/pubkey/dl_group/dl_group.h +++ b/src/lib/pubkey/dl_group/dl_group.h @@ -49,7 +49,7 @@ class BOTAN_DLL DL_Group DSA_PARAMETERS = ANSI_X9_57, DH_PARAMETERS = ANSI_X9_42, - X942_DH_PARAMETERS = ANSI_X9_42, + ANSI_X9_42_DH_PARAMETERS = ANSI_X9_42, PKCS3_DH_PARAMETERS = PKCS_3 }; @@ -106,7 +106,7 @@ class BOTAN_DLL DL_Group * @param name the name that is configured in the global configuration * for the desired group. If no configuration file is specified, * the default values from the file policy.cpp will be used. For instance, - * use "modp/ietf/768" as name. + * use "modp/ietf/3072". */ DL_Group(const std::string& name); diff --git a/src/lib/pubkey/dl_group/dl_named.cpp b/src/lib/pubkey/dl_group/dl_named.cpp index 9c084c80b..56871657e 100644 --- a/src/lib/pubkey/dl_group/dl_named.cpp +++ b/src/lib/pubkey/dl_group/dl_named.cpp @@ -170,7 +170,7 @@ const char* DL_Group::PEM_for_named_group(const std::string& name) if(name == "modp/ietf/6144") return - "-----BEGIN X942 DH PARAMETERS-----" + "-----BEGIN DSA PARAMETERS-----" "MIIGDAKCAwEA///////////JD9qiIWjCNMTGYouA3BzRKQJOCIpnzHQCC76mOxOb" "IlFKCHmONATd75UZs806QxswKwpt8l8UN0/hNW1tUcJF5IW1dmJefsb0TELppjft" "awv/XLb0Brft7jhr+1qJn6WunyQRfEsf5kkoZlHs5Fs9wgB8uKFjvwWY2kg2HFXT" @@ -204,7 +204,7 @@ const char* DL_Group::PEM_for_named_group(const std::string& name) "2/+sLWKl6gPZFaCqVWZHtr9fpHDsCmYvaQfAG/BTy4r3eU3xlANQ6sXb4u07eqhV" "HsUP3/h1jOZY0Ynqrm0rZPYXeUsZHD/0a7ceAjQCH0ezH6Qwdwlflq2Fujprc0p8" "jzbmIBJ//////////wIBAg==" - "-----END X942 DH PARAMETERS-----"; + "-----END DSA PARAMETERS-----"; if(name == "modp/srp/6144") return @@ -230,7 +230,7 @@ const char* DL_Group::PEM_for_named_group(const std::string& name) if(name == "modp/ietf/8192") return - "-----BEGIN X942 DH PARAMETERS-----" + "-----BEGIN DSA PARAMETERS-----" "MIIIDAKCBAEA///////////JD9qiIWjCNMTGYouA3BzRKQJOCIpnzHQCC76mOxOb" "IlFKCHmONATd75UZs806QxswKwpt8l8UN0/hNW1tUcJF5IW1dmJefsb0TELppjft" "awv/XLb0Brft7jhr+1qJn6WunyQRfEsf5kkoZlHs5Fs9wgB8uKFjvwWY2kg2HFXT" @@ -274,7 +274,7 @@ const char* DL_Group::PEM_for_named_group(const std::string& name) "gfat7p0DFZ562dE8UzaVCfwfonwW75iHcDpVtRsiy/RM0BKu4LJ5jmKEI0KO/NWk" "DK72v1DY6ohev3Omuf15teGPZ9E0GsgjenXDz8kgBKHFpA42a8RNABdq9xwV5IyG" "034BNyPKrHIjqzv01U8YKHE7K0pv5A+rdEBctziwZMBuzHbp7///////////AgEC" - "-----END X942 DH PARAMETERS-----"; + "-----END DSA PARAMETERS-----"; if(name == "modp/srp/8192") return |