Skip to content

Commit

Permalink
fix tls and ech auto generate
Browse files Browse the repository at this point in the history
  • Loading branch information
alireza0 committed Jun 30, 2024
1 parent 60b374e commit 2095614
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions frontend/src/components/tls/Ech.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
<v-textarea
:label="$t('tls.key')"
hide-details
rows="3"
v-model="echKeyText">
</v-textarea>
</v-col>
Expand All @@ -69,7 +68,6 @@
<v-textarea
:label="$t('tls.cert')"
hide-details
rows="3"
v-model="echConfigText">
</v-textarea>
</v-col>
Expand All @@ -88,7 +86,7 @@ export default {
props: ['iTls','oTls'],
data() {
return {
useEchPath: 0,
useEchPath: this.$props.iTls?.ech?.key? 1:0,
loading: false,
}
},
Expand All @@ -110,13 +108,17 @@ export default {
if (line === "-----BEGIN ECH CONFIGS-----") {
isConfig = true
isKey = false
config.push(line)
} else if (line === "-----END ECH CONFIGS-----") {
isConfig = false
config.push(line)
} else if (line === "-----BEGIN ECH KEYS-----") {
isKey = true
isConfig = false
key.push(line)
} else if (line === "-----END ECH KEYS-----") {
isKey = false
key.push(line)
} else if (isConfig) {
config.push(line)
} else if (isKey) {
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/layouts/modals/Tls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{ $t('actions.' + title) + " " + $t('objects.tls') }}
</v-card-title>
<v-divider></v-divider>
<v-card-text>
<v-card-text style="padding: 0 16px; overflow-y: scroll;">
<v-card class="rounded-lg">
<v-row>
<v-col cols="12" sm="6" md="4">
Expand Down Expand Up @@ -407,13 +407,17 @@ export default {
if (line === "-----BEGIN PRIVATE KEY-----") {
isPrivateKey = true
isPublicKey = false
privateKey.push(line)
} else if (line === "-----END PRIVATE KEY-----") {
isPrivateKey = false
privateKey.push(line)
} else if (line === "-----BEGIN CERTIFICATE-----") {
isPublicKey = true
isPrivateKey = false
publicKey.push(line)
} else if (line === "-----END CERTIFICATE-----") {
isPublicKey = false
publicKey.push(line)
} else if (isPrivateKey) {
privateKey.push(line)
} else if (isPublicKey) {
Expand Down

0 comments on commit 2095614

Please sign in to comment.