diff --git a/AwsCryptographyPrimitives/test/TestECDH.dfy b/AwsCryptographyPrimitives/test/TestECDH.dfy index b1ad68033..4039e7145 100644 --- a/AwsCryptographyPrimitives/test/TestECDH.dfy +++ b/AwsCryptographyPrimitives/test/TestECDH.dfy @@ -124,6 +124,9 @@ module TestECDH { const OUT_OF_BOUNDS_ERR_MSG_NET6 := "value invalid for Fp field element (Parameter 'x')" const OUT_OF_BOUNDS_ERR_MSG_NE48 := "value invalid for Fp field element\r\nParameter name: x" + // Rust does not provide a separate error message for infinity or out of bounds + const BAD_X509_KEY_ERR_MSG_RUST := "Invalid X509 Public Key." + method {:test} TestKeyGen() { var supportedCurves := [P256, P384, P521]; @@ -285,6 +288,7 @@ module TestECDH { var errMsg := validPublicKey.error.message; expect ( + errMsg == BAD_X509_KEY_ERR_MSG_RUST || errMsg == INFINITY_POINT_ERR_MSG_JAVA || errMsg == INFINITY_POINT_ERR_MSG_NET6 || errMsg == INFINITY_POINT_ERR_MSG_NET48 @@ -334,6 +338,7 @@ module TestECDH { var errMsg := validPublicKey.error.message; expect ( seq_contains(errMsg, OUT_OF_BOUNDS_ERR_MSG_JAVA) || + errMsg == BAD_X509_KEY_ERR_MSG_RUST || errMsg == OUT_OF_BOUNDS_ERR_MSG_NET6 || errMsg == OUT_OF_BOUNDS_ERR_MSG_NE48 );