openpgp-ktx: accept emails without a TLD

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2021-05-02 11:06:30 +05:30
parent ec7daf895e
commit 2fab258bc0
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80
2 changed files with 2 additions and 1 deletions

View file

@ -3,6 +3,7 @@
### [Unreleased]
- The library now requires Kotlin 1.5.0 configured with `kotlinOptions.languageVersion = "1.5"`.
- Accept emails without a TLD
### [3.0.0] - 2021-04-10
- Relicence under Apache 2.0

View file

@ -20,7 +20,7 @@ public object OpenPgpUtils {
Pattern.DOTALL
)
private val USER_ID_PATTERN = Pattern.compile("^(.*?)(?: \\((.*)\\))?(?: <(.*)>)?$")
private val EMAIL_PATTERN = Pattern.compile("^<?\"?([^<>\"]*@[^<>\"]*\\.[^<>\"]*)\"?>?$")
private val EMAIL_PATTERN = Pattern.compile("^<?\"?([^<>\"]*@[^<>\"]*[.]?[^<>\"]*)\"?>?$")
public const val PARSE_RESULT_NO_PGP: Int = -1
public const val PARSE_RESULT_MESSAGE: Int = 0
public const val PARSE_RESULT_SIGNED_MESSAGE: Int = 1